/*
 * DFIR Dictionary - Main Glossary Page Styles
 * Student-focused design for the KC7 Cyber Training glossary
 */

/* Local palette — remapped for dark mode in themes/dark.css */
:root {
  --g-surface: #ffffff;
  --g-raised: #f8f9fa;
  --g-hover: #f1f3f4;
  --g-border: #dadce0;
  --g-border-input: #dfe1e5;
  --g-text: #202124;
  --g-text-secondary: #5f6368;
  --g-text-muted: #9aa0a6;
  --g-text-result: #70757a;
  --g-text-desc: #4d5156;
  --g-link: #1a0dab;
  --g-badge-bg: #e8f0fe;
  --g-badge-text: #1967d2;
  --g-warn-bg: #fef7e0;
  --g-warn-text: #ea8600;
  --g-mark-bg: #fff3cd;
  --g-shadow: rgba(64, 60, 67, 0.16);
  --g-shadow-strong: rgba(64, 60, 67, 0.24);
  --g-card-shadow: rgba(60, 64, 67, 0.3);
}

/* Main container */
.glossary-container {
    max-width: 750px;
    margin: 0 auto;
    padding: 48px 20px 20px;
    min-height: calc(100vh - 200px);
}

/* Header styling */
.glossary-header {
    text-align: center;
    margin-bottom: 48px;
}

.glossary-logo {
    font-size: 72px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--color-primary);
    letter-spacing: -2px;
}

.glossary-subtitle {
    color: var(--g-text-secondary);
    font-size: 16px;
    margin-top: 8px;
}

/* Search box */
.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto 32px;
}

.search-wrapper {
    position: relative;
    margin-bottom: 16px;
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--g-text-muted);
    font-size: 16px;
}

.search-input {
    width: 100%;
    padding: 16px 20px 16px 48px;
    font-size: 16px;
    border: 1px solid var(--g-border-input);
    border-radius: 24px;
    background: var(--g-surface);
    color: var(--g-text);
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px 1px var(--g-shadow);
}

.search-input:hover {
    box-shadow: 0 2px 8px 1px var(--g-shadow-strong);
    background-color: var(--g-surface);
}

.search-input:focus {
    outline: none;
    box-shadow: 0 2px 8px 1px var(--g-shadow-strong);
    border-color: rgba(223,225,229,0);
}

/* I'm Feeling Lucky Button */
.lucky-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    margin-bottom: 16px;
    font-size: 15px;
    font-weight: 500;
    color: var(--g-text);
    background: transparent;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: none;
}

.lucky-button:hover {
    transform: translateY(-2px);
    background: transparent;
}

.lucky-button:active {
    transform: translateY(0);
}

.lucky-button i {
    font-size: 16px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.lucky-button:hover i {
    animation-duration: 0.5s;
}

/* Category filter */
.category-filter {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.category-label {
    color: var(--g-text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.category-select {
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid var(--g-border);
    border-radius: 4px;
    background: var(--g-surface);
    color: var(--g-text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-select:hover {
    border-color: var(--g-text-secondary);
}

.category-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary);
}

/* Results section */
.results-info {
    color: var(--g-text-result);
    font-size: 14px;
    margin-bottom: 16px;
}

/* Term items (previously tag items) */
.tag-item {
    background: var(--g-surface);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 12px;
    border: 1px solid var(--g-surface);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    text-decoration: none;
    display: block;
}

.tag-item:hover {
    border-color: var(--g-border);
    box-shadow: 0 1px 2px 0 var(--g-card-shadow);
    text-decoration: none;
}

.tag-title {
    color: var(--g-link);
    font-size: 20px;
    line-height: 1.3;
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
    font-weight: 400;
}

.tag-title:hover {
    text-decoration: underline;
    color: var(--g-link);
}

.tag-category-badge {
    display: inline-block;
    background: var(--g-badge-bg);
    color: var(--g-badge-text);
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    margin-bottom: 8px;
    font-weight: 500;
}

.tag-description {
    color: var(--g-text-desc);
    font-size: 14px;
    line-height: 1.58;
    margin-top: 4px;
}

.needs-description-badge {
    display: inline-block;
    background: var(--g-warn-bg);
    color: var(--g-warn-text);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 3px;
    margin-left: 8px;
    font-weight: 500;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--g-text-secondary);
}

.empty-icon {
    font-size: 48px;
    color: var(--g-border);
    margin-bottom: 16px;
}

.empty-title {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--g-text);
    font-weight: 400;
}

.empty-text {
    font-size: 14px;
    color: var(--g-text-secondary);
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 40px;
    gap: 24px;
}

.page-numbers {
    display: flex;
    gap: 4px;
    align-items: center;
}

.page-num {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
    color: var(--color-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-num:hover {
    background: var(--g-hover);
}

.page-num.active {
    background: var(--color-primary);
    color: white;
    cursor: default;
}

.page-nav {
    color: var(--color-primary);
    font-size: 14px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
    user-select: none;
}

.page-nav:hover:not(.disabled) {
    background: var(--g-hover);
}

.page-nav.disabled {
    color: var(--g-border);
    cursor: default;
}

.page-ellipsis {
    color: var(--g-text-secondary);
    padding: 0 4px;
}

/* Loading state */
.loading {
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid var(--g-border);
    border-top: 3px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Autocomplete dropdown */
#autocompleteDropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--g-surface);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
    margin-top: 8px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--g-hover);
    transition: background 0.2s ease;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: var(--g-raised);
}

.suggestion-main {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.suggestion-icon {
    color: var(--color-primary);
    font-size: 14px;
}

.suggestion-name {
    font-weight: 500;
    color: var(--g-text);
    flex: 1;
}

.suggestion-category {
    font-size: 11px;
    background: var(--g-badge-bg);
    color: var(--g-badge-text);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.suggestion-desc {
    font-size: 13px;
    color: var(--g-text-secondary);
    margin-left: 22px;
    line-height: 1.4;
}

/* Search highlighting */
mark {
    background: var(--g-mark-bg);
    color: var(--g-text);
    padding: 1px 2px;
    border-radius: 2px;
    font-weight: 500;
}

/* Welcome state */
.welcome-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--g-text-secondary);
}

.welcome-icon {
    font-size: 64px;
    color: var(--g-border);
    margin-bottom: 24px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.welcome-title {
    font-size: 24px;
    margin-bottom: 12px;
    color: var(--g-text);
    font-weight: 400;
}

.welcome-text {
    font-size: 16px;
    color: var(--g-text-secondary);
    margin-bottom: 24px;
}

.welcome-examples {
    max-width: 500px;
    margin: 0 auto;
}

.examples-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--g-text-secondary);
    font-weight: 500;
}

.examples-label i {
    color: #fbbc04;
    font-size: 16px;
}

.examples-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.example-term {
    display: inline-block;
    padding: 8px 16px;
    background: var(--g-raised);
    border: 1px solid var(--g-border);
    border-radius: 20px;
    font-size: 14px;
    color: var(--g-text);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.example-term:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.example-term:active {
    transform: translateY(0);
}

/* Responsive design */
@media (max-width: 768px) {
    .glossary-container {
        padding: 32px 16px;
    }

    .glossary-logo {
        font-size: 48px;
        margin-bottom: 24px;
    }

    .search-container {
        max-width: 100%;
    }

    .tag-item {
        padding: 16px;
    }

    .tag-title {
        font-size: 18px;
    }

    .pagination-container {
        gap: 16px;
    }

    .welcome-state {
        padding: 60px 20px;
    }

    .welcome-icon {
        font-size: 48px;
    }

    .welcome-title {
        font-size: 20px;
    }

    .autocomplete-item {
        padding: 10px 12px;
    }
}
