/* ============================================
   COLOR PALETTE - FilmDizi
   Light Mode (Default) & Dark Mode
   ============================================ */

:root {
    /* Light Mode - Default */
    /* Backgrounds */
    --bg-primary: #F5F7FB;
    --bg-secondary: #FFFFFF;
    --bg-section: #EEF1F7;

    /* Text Colors */
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #64748B;
    --text-disabled: #94A3B8;

    /* Borders & Dividers */
    --border-color: #E2E8F0;
    --divider-color: #CBD5E1;
    --focus-ring: rgba(76, 201, 240, 0.35);

    /* Accent / Highlight Colors */
    --accent-primary: #4CC9F0;
    --accent-primary-hover: #38BDF8;
    --accent-primary-active: #0EA5E9;
    --accent-secondary: #9D8CFF;
    --accent-tertiary: #2DD4BF;

    /* Buttons - Primary */
    --btn-primary-bg: #4CC9F0;
    --btn-primary-text: #0F172A;
    --btn-primary-hover: #38BDF8;
    --btn-primary-active: #0EA5E9;

    /* Buttons - Secondary */
    --btn-secondary-bg: #E2E8F0;
    --btn-secondary-text: #0F172A;
    --btn-secondary-hover: #CBD5E1;

    /* Category / Mood Colors (for badges, icons, small UI only) */
    --color-happy: #EAB308;
    --color-sad: #3B82F6;
    --color-energetic: #10B981;
    --color-romantic: #EC4899;
    --color-mystery: #8B5CF6;
    --color-surprise: #14B8A6;

    /* Legacy variables for compatibility (mapped to new variables) */
    --bg-color: var(--bg-primary);
    --card-bg: var(--bg-secondary);
    --accent-color: var(--accent-primary);
    --accent-hover: var(--accent-primary-hover);
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: var(--border-color);
    --font-main: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ============================================
   BASE STYLES
   ============================================ */

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* ============================================
   NAVBAR
   ============================================ */

.navbar {
    background-color: var(--bg-secondary) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

[data-theme="dark"] .navbar {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.navbar-brand {
    font-weight: 700;
    color: var(--accent-primary) !important;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.nav-link {
    color: var(--text-primary) !important;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem !important;
    border-radius: 50px;
    margin: 0 0.2rem;
}

.nav-link:hover {
    color: var(--accent-primary) !important;
    background-color: rgba(76, 201, 240, 0.1);
    /* 10% opacity of accent-primary */
    transform: translateY(-2px);
    text-decoration: none !important;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-primary);
    font-weight: 600;
}

.text-muted {
    color: var(--text-muted) !important;
}

/* ============================================
   BUTTONS
   ============================================ */

/* Primary Button */
.btn-primary {
    background-color: var(--btn-primary-bg);
    border-color: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    font-weight: 600;
    border-radius: 50px;
    padding: 0.5rem 1.5rem;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--btn-primary-hover);
    border-color: var(--btn-primary-hover);
    color: var(--btn-primary-text);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 201, 240, 0.3);
}

.btn-primary:active,
.btn-primary:focus {
    background-color: var(--btn-primary-active);
    border-color: var(--btn-primary-active);
    color: var(--btn-primary-text);
}

/* Outline Primary Button */
.btn-outline-primary {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    background-color: transparent;
    border-radius: 50px;
}

.btn-outline-primary:hover {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--btn-primary-text);
}

/* Secondary Button */
.btn-secondary,
.btn-outline-secondary {
    background-color: var(--btn-secondary-bg);
    border-color: var(--btn-secondary-bg);
    color: var(--btn-secondary-text);
    font-weight: 500;
    border-radius: 50px;
}

.btn-outline-secondary {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover,
.btn-outline-secondary:hover {
    background-color: var(--btn-secondary-hover);
    border-color: var(--btn-secondary-hover);
    color: var(--btn-secondary-text);
}

/* Success Button (for "Bana Öner" etc.) */
.btn-success {
    background-color: var(--accent-tertiary);
    border-color: var(--accent-tertiary);
    color: #0B1220;
    font-weight: 600;
    border-radius: 50px;
}

.btn-success:hover {
    background-color: #20B5A4;
    border-color: #20B5A4;
    color: #0B1220;
}

/* ============================================
   CARDS
   ============================================ */

.card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

[data-theme="dark"] .card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
    border-color: var(--accent-primary);
}

[data-theme="dark"] .card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.card-title {
    color: var(--text-primary);
    font-weight: 700;
}

.card-text {
    color: var(--text-secondary);
}

/* Badge */
.badge.bg-secondary {
    background-color: var(--btn-secondary-bg) !important;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

/* ============================================
   MODAL
   ============================================ */

.modal-content {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .modal-content {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-header {
    border-bottom: 1px solid var(--divider-color);
}

.modal-footer {
    border-top: 1px solid var(--divider-color);
}

.btn-close {
    filter: none;
    opacity: 0.5;
}

.btn-close:hover {
    opacity: 1;
}

/* ============================================
   INPUTS & FORMS
   ============================================ */

.form-control,
.form-select {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 10px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    background-color: var(--bg-secondary);
    border-color: var(--accent-primary);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.25rem var(--focus-ring);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* Custom Search & Filter Styles */
.search-control {
    border-radius: 50px !important;
    padding-left: 1.5rem;
    min-width: 250px;
}

.filter-select {
    border-radius: 50px !important;
    min-width: 200px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-position: right 1.25rem center;
}

[data-theme="dark"] .filter-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23E6E8EC' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
}

/* ============================================
   SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--divider-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    background-color: var(--bg-primary);
    border-top: 1px solid var(--divider-color) !important;
    color: var(--text-muted);
    margin-top: auto;
    padding: 20px 0;
}

/* ============================================
   LINKS
   ============================================ */

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-primary-hover);
    text-decoration: underline;
}

/* ============================================
   TABLE
   ============================================ */

.table-responsive {
    position: relative;
}

.table-responsive table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--bg-section);
}

.table-responsive table thead th {
    background-color: var(--bg-section);
    border-bottom: 2px solid var(--divider-color);
    color: var(--text-primary);
}

/* ============================================
   ADMIN PANEL BUTTONS
   ============================================ */

/* Override oval shape for btn-lg buttons in admin panel */
.btn-success.btn-lg,
.btn-primary.btn-lg,
.btn-warning.btn-lg,
.btn-info.btn-lg,
.btn-danger.btn-lg {
    border-radius: 0.375rem !important;
}

/* Override btn-primary oval shape specifically for admin area buttons */
a[href*="/Admin/"].btn-primary,
a[href*="/Admin/"].btn-primary.btn-lg {
    border-radius: 0.375rem !important;
}

/* ============================================
   CATEGORY / MOOD COLORS (Utility Classes)
   ============================================ */

/* These can be used for badges, icons, or small UI elements */
.badge-mood-happy {
    background-color: var(--color-happy);
    color: var(--text-primary);
}

.badge-mood-sad {
    background-color: var(--color-sad);
    color: var(--bg-secondary);
}

.badge-mood-energetic {
    background-color: var(--color-energetic);
    color: var(--bg-secondary);
}

.badge-mood-romantic {
    background-color: var(--color-romantic);
    color: var(--bg-secondary);
}

.badge-mood-mystery {
    background-color: var(--color-mystery);
    color: var(--bg-secondary);
}

.badge-mood-surprise {
    background-color: var(--color-surprise);
    color: var(--text-primary);
}

/* ============================================
   DARK MODE COLOR PALETTE
   ============================================ */

[data-theme="dark"] {
    /* Backgrounds */
    --bg-primary: #0B1220;
    --bg-secondary: #161F33;
    --bg-section: #1E293B;

    /* Text Colors */
    --text-primary: #E6E8EC;
    --text-secondary: #9AA4B2;
    --text-muted: #6B7280;
    --text-disabled: #4B5563;

    /* Borders & Dividers */
    --border-color: #24324A;
    --divider-color: #1F2937;
    --focus-ring: rgba(76, 201, 240, 0.35);

    /* Accent / Highlight Colors (Same as Light Mode) */
    --accent-primary: #4CC9F0;
    --accent-primary-hover: #38BDF8;
    --accent-primary-active: #0EA5E9;
    --accent-secondary: #9D8CFF;
    --accent-tertiary: #2DD4BF;

    /* Buttons - Primary (Same accent, different text) */
    --btn-primary-bg: #4CC9F0;
    --btn-primary-text: #0B1220;
    --btn-primary-hover: #38BDF8;
    --btn-primary-active: #0EA5E9;

    /* Buttons - Secondary */
    --btn-secondary-bg: #1E293B;
    --btn-secondary-text: #E6E8EC;
    --btn-secondary-hover: #24324A;

    /* Category / Mood Colors (Same as Light Mode) */
    --color-happy: #EAB308;
    --color-sad: #3B82F6;
    --color-energetic: #10B981;
    --color-romantic: #EC4899;
    --color-mystery: #8B5CF6;
    --color-surprise: #14B8A6;

    /* Legacy variables for compatibility */
    --bg-color: var(--bg-primary);
    --card-bg: var(--bg-secondary);
    --accent-color: var(--accent-primary);
    --accent-hover: var(--accent-primary-hover);
    --glass-bg: rgba(22, 31, 51, 0.9);
    --glass-border: var(--border-color);
}

/* ============================================
   SMOOTH TRANSITIONS FOR THEME SWITCHING
   ============================================ */

.navbar,
.card,
.modal-content,
.form-control,
.form-select,
.footer,
.btn-primary,
.btn-secondary,
.btn-outline-primary,
.btn-outline-secondary {
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

/* ============================================
   THEME TOGGLE SWITCH
   ============================================ */

.theme-toggle {
    position: relative;
    width: 56px;
    height: 32px;
    background: var(--btn-secondary-bg);
    border-radius: 16px;
    border: 1.5px solid var(--border-color);
    cursor: pointer;
    transition: all 0.25s ease;
    padding: 2px;
    flex-shrink: 0;
}

.theme-toggle:hover {
    border-color: var(--accent-primary);
}

.theme-toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 26px;
    height: 26px;
    background: var(--accent-primary);
    border-radius: 50%;
    transition: transform 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .theme-toggle-slider {
    transform: translateX(24px);
}

.theme-toggle-icon {
    font-size: 14px;
    color: var(--btn-primary-text);
    line-height: 1;
}

.theme-toggle-container {
    display: flex;
    align-items: center;
    margin-left: 1rem;
}

/* ============================================
   FOOTER STYLES
   ============================================ */

.footer {
    background-color: var(--bg-secondary);
    padding: 1rem 0;
}

.footer a {
    transition: color 0.2s ease;
}

.footer a:hover {
    color: var(--accent-primary) !important;
}

.footer a i {
    transition: transform 0.2s ease;
}

.footer a:hover i {
    transform: translateY(-2px);
}

/* ============================================
   MODERN TYPOGRAPHY UTILITIES
   ============================================ */

.text-gradient-primary {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: var(--accent-primary);
    /* Fallback */
    font-weight: 800;
}

.hero-subtitle {
    font-weight: 300;
    letter-spacing: 0.5px;
    opacity: 0.85;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.section-title-modern {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 1rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.section-title-modern::before {
    content: '';
    position: absolute;
    left: 0;
    height: 100%;
    width: 6px;
    background: linear-gradient(to bottom, var(--accent-primary), var(--accent-secondary));
    border-radius: 4px;
    box-shadow: 0 0 15px var(--accent-primary);
}

.section-title-modern span {
    z-index: 1;
}

.comment-text {
    color: var(--text-primary);
    white-space: pre-wrap;
    /* Preserves whitespace but handles wrapping */
    word-break: break-word;
    /* Break words if they are too long */
    overflow-wrap: break-word;
    /* Standard property for breaking long words */
    max-width: 100%;
    /* Ensure it doesn't exceed container */
    overflow-x: hidden;
    /* Hide any potential overflow */
    max-height: 200px;
    overflow-y: auto;
}

[data-theme="dark"] .comment-text {
    color: #ffffff !important;
}

/* ============================================
   SPOILER STYLES (Redacted Mode)
   ============================================ */
.spoiler-blur {
    background-color: #000 !important;
    color: transparent !important;
    text-shadow: none !important;
    cursor: pointer;
    user-select: none;
    border-radius: 4px;
    padding: 0 4px;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
}

.spoiler-blur::before {
    content: "SPOILER";
    color: rgba(255, 255, 255, 0.4);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.7em;
    font-weight: bold;
    pointer-events: none;
    letter-spacing: 1px;
}

.spoiler-revealed {
    background-color: transparent !important;
    color: inherit !important;
    text-shadow: none;
    cursor: text;
    animation: fadeIn 0.5s;
    user-select: text;
}

.spoiler-revealed::before {
    display: none;
}

/* Modal styles */
.spoiler-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.spoiler-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.spoiler-modal {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 90%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.spoiler-overlay.visible .spoiler-modal {
    transform: scale(1);
}

.spoiler-modal h3 {
    margin-top: 0;
    margin-bottom: 12px;
    color: #dc3545;
}

.spoiler-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
}

.btn-spoiler-yes {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 8px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-spoiler-yes:hover {
    background-color: #bb2d3b;
}

.btn-spoiler-no {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 8px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-spoiler-no:hover {
    background-color: #5c636a;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ============================================
   FOOTER REDESIGN STYLES
   ============================================ */

.footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0;
    margin-top: auto;
}

[data-theme="dark"] .footer {
    background-color: #0d121f;
    /* Slightly darker than main bg for contrast */
}

/* Social Media Icons */
.social-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 1.25rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--border-color);
    text-decoration: none !important;
}

.social-icon-btn:hover {
    transform: translateY(-5px) rotate(8deg);
    background-color: var(--accent-primary);
    color: white;
    box-shadow: 0 5px 15px rgba(76, 201, 240, 0.3);
    border-color: var(--accent-primary);
}

/* Footer Links */
.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.footer-links a:hover {
    color: var(--accent-primary);
    background-color: rgba(76, 201, 240, 0.1);
    transform: translateY(-2px);
}

/* Designer Button */
.designer-btn {
    padding: 0.85rem 1.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    display: inline-block;
}

[data-theme="dark"] .designer-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.designer-btn::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50px;
    padding: 2px;
    background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary), var(--accent-tertiary));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.5;
    transition: opacity 0.4s ease;
}

.designer-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(76, 201, 240, 0.2);
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.designer-btn:hover::before {
    opacity: 1;
}

.designer-text strong,
.designer-text i {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease;
    font-weight: 700;
}

.designer-btn:hover .designer-text strong,
.designer-btn:hover .designer-text i {
    background: none;
    -webkit-text-fill-color: white;
    color: white;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Shimmer Animation */
.shimmer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
    transform: skewX(-20deg) translateX(-150%);
    transition: transform 0.5s;
    pointer-events: none;
}

.designer-btn:hover .shimmer {
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: skewX(-20deg) translateX(-150%);
    }

    100% {
        transform: skewX(-20deg) translateX(150%);
    }
}