/* IMPORTANT: Before modifying this file, please update CHANGELOG.md with a summary of your changes. */

/* Color Scheme:
 * Primary: #1c476c (dark blue)
 * Secondary: #8d9e88 (sage green)
 * Accent: #f2ce8a (gold)
 * Background: #e9e7df (light beige)
 * Cards/borders: #9db3c1 (light blue)
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background-color: #e9e7df;
    color: #333;
    line-height: 1.6;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background-color: #1c476c;
    color: white;
    padding: 1.5rem 2rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
}
/* Home Button */
.home-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: max(1.5rem, calc((100vw - 1800px) / 2 + 1.5rem));
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #f2ce8a;
    color: #1c476c;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.home-button:hover {
    background-color: #f5d89f;
    transform: translateY(calc(-50% - 2px));
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.home-button:active {
    transform: translateY(-50%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.home-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.home-text {
    font-weight: 600;
}

/* Adjust header for button placement */
.header {
    position: relative;
}

/* Search Container */
.search-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 1rem 1.5rem 0;
    width: 100%;
}

.search-box {
    display: flex;
    gap: 0.5rem;
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.search-input {
    flex: 1;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border: 2px solid #9db3c1;
    border-radius: 6px;
    font-size: 1rem;
    background-color: white;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #1c476c;
    box-shadow: 0 0 0 3px rgba(28, 71, 108, 0.1);
}

.search-input::placeholder {
    color: #999;
}

.search-clear {
    position: absolute;
    right: 120px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 0.5rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.search-clear:hover {
    color: #1c476c;
}

.search-button {
    padding: 0.75rem 1.5rem;
    background-color: #1c476c;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.search-button:hover {
    background-color: #2a5a8a;
}

.search-button:active {
    background-color: #153555;
}

.search-results {
    position: relative;
    max-width: 800px;
    margin: 0.5rem auto 0;
    background-color: white;
    border: 2px solid #9db3c1;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 500px;
    overflow-y: auto;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-results-header {
    padding: 0.75rem 1rem;
    background-color: #f8f8f8;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
}

.search-results-list {
    padding: 0.5rem;
}

.search-result-item {
    padding: 1rem;
    margin-bottom: 0.5rem;
    background-color: #f8f8f8;
    border: 2px solid #9db3c1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-result-item:hover {
    background-color: #f2ce8a;
    border-color: #1c476c;
    transform: translateX(5px);
}

.search-result-item:last-child {
    margin-bottom: 0;
}

.search-result-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.search-result-code {
    font-weight: 700;
    color: #1c476c;
    font-size: 1rem;
}

.search-result-badges {
    display: flex;
    gap: 0.5rem;
}

.search-result-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: #8d9e88;
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.search-result-domain {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.search-result-desc {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #555;
}

.search-highlight {
    background-color: #f2ce8a;
    font-weight: 600;
    padding: 0 2px;
    border-radius: 2px;
}

.search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    color: #1c476c;
    font-size: 1rem;
}

.search-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #9db3c1;
    border-top-color: #1c476c;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.search-empty,
.search-min-chars {
    padding: 2rem;
    text-align: center;
    color: #666;
    font-style: italic;
}

.search-min-chars {
    color: #999;
}


/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    gap: 1.5rem;
    padding: 1.5rem;
    max-width: 1800px;
    margin: 0 auto;
    width: 100%;
}

/* Left Panel */
.left-panel {
    flex: 0 0 350px;
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow-y: auto;
    max-height: calc(100vh - 150px);
    border: 2px solid #9db3c1;
}

.panel-header h2 {
    color: #1c476c;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #9db3c1;
}

.selector-group {
    margin-bottom: 1.5rem;
}

.selector-group label {
    display: block;
    font-weight: 600;
    color: #1c476c;
    margin-bottom: 0.5rem;
}

.selector {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #9db3c1;
    border-radius: 6px;
    font-size: 1rem;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.selector:hover {
    border-color: #1c476c;
}

.selector:focus {
    outline: none;
    border-color: #1c476c;
    box-shadow: 0 0 0 3px rgba(28, 71, 108, 0.1);
}

/* Standards List */
#standards-list-container h3 {
    color: #1c476c;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #9db3c1;
}

.standards-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.standard-item {
    padding: 1rem;
    background-color: #f8f8f8;
    border: 2px solid #9db3c1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.standard-item:hover {
    background-color: #f2ce8a;
    border-color: #1c476c;
    transform: translateX(5px);
}

.standard-item.active {
    background-color: #1c476c;
    color: white;
    border-color: #1c476c;
}

.standard-code {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.standard-desc {
    font-size: 0.85rem;
    line-height: 1.4;
    opacity: 0.9;
}

/* Right Panel */
.right-panel {
    flex: 1;
    background-color: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow-y: auto;
    max-height: calc(100vh - 150px);
    border: 2px solid #9db3c1;
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: 3rem 2rem;
}

.welcome-message h2 {
    color: #1c476c;
    font-size: 2rem;
    margin-bottom: 1rem;
}
/* Search Responsive Styles */
@media (max-width: 768px) {
    .search-container {
        padding: 1rem 1rem 0;
    }
    
    .search-box {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .search-input {
        padding-right: 2.5rem;
    }
    
    .search-clear {
        right: 10px;
    }
    
    .search-button {
        width: 100%;
    }
    
    .search-results {
        max-height: 400px;
    }
}


.welcome-message > p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2rem;
}

.info-box {
    background-color: #f2ce8a;
    border: 2px solid #1c476c;
    border-radius: 8px;
    padding: 2rem;
    text-align: left;
    max-width: 600px;
    margin: 0 auto;
}

.info-box h3 {
    color: #1c476c;
    margin-bottom: 1rem;
}

.info-box ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.info-box li {
    margin-bottom: 0.5rem;
}

/* Standard Details */
.standard-details {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.standard-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid #9db3c1;
}

.standard-header h2 {
    color: #1c476c;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.standard-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: #8d9e88;
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Standard Sections */
.standard-section {
    margin-bottom: 2rem;
}

.standard-section h3 {
    color: #1c476c;
    font-size: 1.4rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-text {
    font-size: 0.9rem;
    color: #666;
    font-weight: normal;
}

.description-content {
    padding: 1.5rem;
    background-color: #f8f8f8;
    border-left: 4px solid #8d9e88;
    border-radius: 4px;
    line-height: 1.8;
}

.description-content p {
    margin-bottom: 1rem;
}

.description-content p:last-child {
    margin-bottom: 0;
}

/* Relationships */
.relationships-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.grade-group {
    background-color: #f8f8f8;
    border: 2px solid #9db3c1;
    border-radius: 8px;
    padding: 1.5rem;
}

.grade-group-header {
    background-color: #1c476c;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.related-standards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.related-standard {
    background-color: white;
    border: 2px solid #9db3c1;
    border-radius: 6px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.related-standard:hover {
    background-color: #f2ce8a;
    border-color: #1c476c;
    transform: translateX(5px);
}

.related-standard-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.5rem;
}

.related-standard-code {
    font-weight: 700;
    color: #1c476c;
    font-size: 1rem;
}

.depth-badge {
    background-color: #8d9e88;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.related-standard-desc {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #555;
}

.related-standard-meta {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.meta-item {
    font-size: 0.85rem;
    color: #666;
}

.meta-label {
    font-weight: 600;
    color: #1c476c;
}

.empty-message {
    padding: 2rem;
    text-align: center;
    color: #666;
    font-style: italic;
    background-color: #f8f8f8;
    border-radius: 6px;
    border: 2px dashed #9db3c1;
}

/* Loading States */
.loading {
    text-align: center;
    padding: 2rem;
    color: #1c476c;
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }
    
    .left-panel {
        flex: 0 0 auto;
        max-height: none;
    }
    
    .right-panel {
        max-height: none;
    }
}

@media (max-width: 768px) {
    .home-button {
        position: static;
        margin: 0 auto 1rem;
        width: fit-content;
    }
    
    .header {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .main-content {
        padding: 1rem;
        gap: 1rem;
    }
    
    .left-panel,
    .right-panel {
        padding: 1rem;
    }
    
    .standard-header h2 {
        font-size: 1.4rem;
    }
    
    .standard-section h3 {
        font-size: 1.2rem;
    }
}

/* Scrollbar Styling */
.left-panel::-webkit-scrollbar,
.right-panel::-webkit-scrollbar {
    width: 8px;
}

.left-panel::-webkit-scrollbar-track,
.right-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.left-panel::-webkit-scrollbar-thumb,
.right-panel::-webkit-scrollbar-thumb {
    background: #9db3c1;
    border-radius: 4px;
}

.left-panel::-webkit-scrollbar-thumb:hover,
.right-panel::-webkit-scrollbar-thumb:hover {
    background: #1c476c;
}