/* ============================================
   GİB Özelge Semantic Search - Styles
   Modern, Dark Mode, Glassmorphism Design
   ============================================ */

/* === CSS Variables === */
:root {
    /* Colors - Dark Theme */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-card: rgba(26, 26, 37, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.03);

    /* Accent Colors */
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --accent-glow: rgba(99, 102, 241, 0.3);

    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --text-muted: #475569;

    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px var(--accent-glow);

    /* Spacing */
    --space-xs: 0.35rem;
    --space-sm: 0.75rem;
    --space-md: 1.25rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 5rem;

    /* Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
}

/* === Reset & Base === */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* === Background Effects === */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 100% 50%, rgba(139, 92, 246, 0.1) 0%, transparent 40%),
        radial-gradient(ellipse 60% 40% at 0% 80%, rgba(168, 85, 247, 0.08) 0%, transparent 40%);
    pointer-events: none;
    z-index: -2;
}

.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: -1;
}

/* === Container === */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-lg);
    position: relative;
    z-index: 1;
}

/* === Header === */
.header {
    text-align: center;
    margin-bottom: var(--space-2xl);
    animation: fadeInDown 0.6s ease;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.logo-icon {
    width: 48px;
    height: 48px;
    color: var(--accent-primary);
    filter: drop-shadow(0 0 20px var(--accent-glow));
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 400;
}

/* === Search Section === */
.search-section {
    margin-bottom: var(--space-2xl);
    animation: fadeInUp 0.6s ease 0.1s both;
}

.search-container {
    position: relative;
    margin-bottom: var(--space-lg);
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-sm);
    transition: all var(--transition-base);
    backdrop-filter: blur(20px);
}

.search-input-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.search-icon {
    width: 24px;
    height: 24px;
    color: var(--text-tertiary);
    margin-left: var(--space-md);
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 1.1rem;
    padding: var(--space-md);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-button {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-xl);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
}

.search-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--accent-glow);
}

.search-button svg {
    width: 20px;
    height: 20px;
}

/* Suggestions Dropdown */
.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-top: var(--space-sm);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    z-index: 100;
}

.suggestions.hidden {
    display: none;
}

.suggestion-item {
    padding: var(--space-md) var(--space-lg);
    cursor: pointer;
    transition: background var(--transition-fast);
    border-bottom: 1px solid var(--border-color);
}

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

.suggestion-item:hover {
    background: var(--bg-tertiary);
}

/* Quick Filters - Removed as per user request */
.quick-filters {
    display: none;
}

/* Search Options */
.search-options {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

/* Mode Tabs */
.mode-tabs {
    display: flex;
    gap: var(--space-xs);
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: var(--space-xs);
}

.mode-tab {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    border: none;
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-base);
}

.mode-tab:hover {
    color: var(--text-primary);
}

.mode-tab.active {
    background: var(--accent-gradient);
    color: white;
}

.mode-tab svg {
    flex-shrink: 0;
}

.option-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.option-toggle input {
    display: none;
}

.toggle-slider {
    width: 44px;
    height: 24px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    position: relative;
    transition: background var(--transition-base);
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: all var(--transition-base);
}

.option-toggle input:checked+.toggle-slider {
    background: var(--accent-primary);
}

.option-toggle input:checked+.toggle-slider::after {
    transform: translateX(20px);
    background: white;
}

/* === AI Answer Section === */
.ai-answer-section {
    margin-bottom: var(--space-2xl);
    animation: fadeInUp 0.4s ease;
}

.ai-answer-section.hidden {
    display: none;
}

.ai-answer-card {
    background: var(--bg-card);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    backdrop-filter: blur(10px);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.15);
}

.ai-answer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-color);
}

.ai-badge {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--accent-gradient);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-full);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.ai-confidence {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.9rem;
}

.confidence-label {
    color: var(--text-tertiary);
}

.confidence-value {
    font-weight: 600;
    color: var(--success);
}

.ai-answer-content {
    color: var(--text-primary);
    line-height: 1.8;
    margin-bottom: var(--space-lg);
    white-space: pre-wrap;
}

.ai-sources {
    margin-bottom: var(--space-md);
}

.ai-sources h4 {
    font-size: 0.85rem;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-sm);
}

.source-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.source-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-glass);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.source-item:hover {
    background: var(--bg-tertiary);
}

.source-konu {
    color: var(--text-secondary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.source-score {
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

.ai-disclaimer {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    font-size: 0.85rem;
    color: var(--warning);
}

/* === Results Section === */
.results-section {
    animation: fadeIn 0.4s ease;
}

.results-section.hidden {
    display: none;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-color);
}

.results-info {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.results-info span:first-child {
    color: var(--accent-primary);
    font-weight: 600;
}

.results-time {
    color: var(--text-muted);
}

.results-sort select {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: var(--space-sm) var(--space-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
}

/* Results List */
.results-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* Result Card */
.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    backdrop-filter: blur(10px);
}

.result-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-md);
}

.result-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    flex: 1;
    margin-right: var(--space-md);
}

.result-score {
    background: var(--accent-gradient);
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.result-meta-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.result-meta-item svg {
    width: 14px;
    height: 14px;
}

.result-snippet {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.result-snippet mark {
    background: rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
    padding: 0 2px;
    border-radius: 2px;
}

/* === Loading State === */
.loading-state {
    text-align: center;
    padding: var(--space-2xl);
}

.loading-state.hidden {
    display: none;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    margin: 0 auto var(--space-md);
    animation: spin 1s linear infinite;
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-secondary);
}

.empty-state.hidden {
    display: none;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: var(--space-md);
    color: var(--text-muted);
}

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

/* === Stats Section === */
.stats-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin-top: var(--space-2xl);
    animation: fadeInUp 0.6s ease 0.2s both;
}

.stat-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    backdrop-filter: blur(10px);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: var(--space-xs);
}

/* === Modal === */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    max-width: 800px;
    max-height: 80vh;
    width: 100%;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s ease;
}

.modal-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius-sm);
    padding: var(--space-sm);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    z-index: 10;
}

.modal-close:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-body {
    padding: var(--space-xl);
    overflow-y: auto;
    max-height: 80vh;
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: var(--space-lg);
    padding-right: var(--space-xl);
}

.modal-section {
    margin-bottom: var(--space-lg);
}

.modal-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-sm);
}

.modal-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.modal-meta-item {
    background: var(--bg-glass);
    border-radius: var(--radius-sm);
    padding: var(--space-md);
}

.modal-meta-label {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-bottom: var(--space-xs);
}

.modal-meta-value {
    font-weight: 500;
}

.modal-content-text {
    color: var(--text-secondary);
    line-height: 1.8;
    white-space: pre-wrap;
}

/* === Pagination === */
.pagination {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    margin-top: var(--space-xl);
}

.pagination.hidden {
    display: none;
}

.page-btn {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: var(--space-sm) var(--space-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.page-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.page-btn.active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
}

/* === Animations === */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* === Responsive === */
@media (max-width: 768px) {
    .container {
        padding: var(--space-md);
    }

    .logo h1 {
        font-size: 1.8rem;
    }

    .search-input-wrapper {
        flex-direction: column;
        padding: var(--space-md);
    }

    .search-input {
        width: 100%;
    }

    .search-button {
        width: 100%;
        justify-content: center;
        margin-top: var(--space-sm);
    }

    .stats-section {
        grid-template-columns: 1fr;
    }

    .results-header {
        flex-direction: column;
        gap: var(--space-md);
        align-items: flex-start;
    }

    .modal-meta-grid {
        grid-template-columns: 1fr;
    }
}

/* === Utility Classes === */
.hidden {
    display: none !important;
}

.text-gradient {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}