/**
 * Modern Theme CSS
 * Hornstown Game - New Design System
 * Created: 2025-10-07
 * 
 * This file contains the modern theme CSS variables, base styles, and animations
 * for the new visual novel-style interface.
 */

/* === FONTS === */
@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:ital,wght@0,400;0,600;1,400&family=Quicksand:wght@400;500;600;700&display=swap');

/* === CSS VARIABLES - DARK MODE (DEFAULT) === */
:root[data-theme="modern"],
:root[data-theme="default"] {
    /* Background colors */
    --bg-main: #1a1118;
    --bg-card: rgba(37, 22, 32, 0.92);
    --bg-sidebar: rgba(37, 22, 32, 0.92);
    --content-bg: rgba(37, 22, 32, 0.98);
    --modal-bg: rgba(0, 0, 0, 0.8);
    
    /* Accent colors */
    --accent-purple: #9b6b9b;
    --accent-pink: #a66b7a;
    --accent-rose: #8b5a6a;
    --accent-green: #5fa85f;
    
    /* Text colors */
    --text-primary: #f0e0e8;
    --text-secondary: #c8b0c0;
    --text-light: #a090a0;
    
    /* Link colors */
    --link-color: #f0a8b0;
    --link-hover: #ffb8c0;
    --link-bg: rgba(240, 168, 176, 0.2);
    --link-bg-hover: rgba(240, 168, 176, 0.35);
    
    /* UI elements */
    --border-soft: rgba(150, 100, 150, 0.3);
    --shadow-soft: rgba(0, 0, 0, 0.5);
    --glow: rgba(200, 162, 200, 0.3);
    
    /* Layout */
    --sidebar-width: 280px;
    --status-bar-height: 65px;
    --border-radius-large: 20px;
    --border-radius-medium: 15px;
    --border-radius-small: 12px;
    
    /* Font families */
    --font-family-primary: 'Crimson Text', serif;
    --font-family-secondary: 'Quicksand', sans-serif;
    
    /* Font sizes */
    --font-size-base: 18px;
    --font-size-small: 14px;
    --font-size-large: 24px;
    --font-size-xlarge: 32px;
    
    /* Z-index layers */
    --z-background: 0;
    --z-particles: 1;
    --z-content: 5;
    --z-sidebar: 10;
    --z-controls: 20;
    --z-header: 100;
    --z-modal: 200;
    --z-mobile-overlay: 250;
}

/* === CSS VARIABLES - LIGHT MODE === */
:root[data-theme="modern-light"] {
    /* Background colors */
    --bg-main: #f9f5f2;
    --bg-card: rgba(255, 251, 248, 0.92);
    --bg-sidebar: rgba(255, 251, 248, 0.92);
    --content-bg: rgba(255, 251, 248, 0.98);
    --modal-bg: rgba(0, 0, 0, 0.7);
    
    /* Accent colors */
    --accent-purple: #c8a2c8;
    --accent-pink: #e6b8c2;
    --accent-rose: #d4919b;
    --accent-green: #7bc87b;
    
    /* Text colors */
    --text-primary: #5d4954;
    --text-secondary: #8b7082;
    --text-light: #a89aa4;
    
    /* Link colors */
    --link-color: #d4919b;
    --link-hover: #c47a86;
    --link-bg: rgba(212, 145, 155, 0.15);
    --link-bg-hover: rgba(212, 145, 155, 0.25);
    
    /* UI elements */
    --border-soft: rgba(200, 162, 200, 0.25);
    --shadow-soft: rgba(150, 100, 120, 0.15);
    --glow: rgba(200, 162, 200, 0.4);
}

/* === BASE RESET === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* === BODY & HTML === */
html,
body {
    height: 100%;
    overflow-x: hidden !important; /* Csak vízszintes scroll tiltása */
    overflow-y: auto !important; /* Függőleges scroll engedélyezése */
    margin: 0 !important;
    padding: 0 !important;
}

body {
    font-family: var(--font-family-primary) !important;
    color: var(--text-primary) !important;
    background: var(--bg-main) !important;
    background-image: none !important; /* Override legacy background image */
    background-repeat: no-repeat !important;
    background-size: cover !important;
    transition: all 0.5s ease;
    font-size: var(--font-size-base) !important;
    line-height: 1.6;
    margin: 0 !important;
    padding: 0 !important;
}

/* === FALLING PARTICLES ANIMATION === */
/* Particle CSS moved to ingame-ui.css to avoid conflicts */

/* Light mode particles - moved to ingame-ui.css */

/* @keyframes fall animation moved to ingame-ui.css */

/* Particle positioning moved to ingame-ui.css */

/* === FLOATING ANIMATION === */
@keyframes float {
    0%, 100% { 
        transform: translateY(0px); 
    }
    50% { 
        transform: translateY(-20px); 
    }
}

/* === FADE IN ANIMATION === */
@keyframes fadeIn {
    from { 
        opacity: 0; 
    }
    to { 
        opacity: 1; 
    }
}

/* === SLIDE IN ANIMATION === */
@keyframes slideIn {
    from { 
        transform: translateY(-20px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

/* === SLIDE IN UP ANIMATION === */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* === ZOOM ANIMATION === */
@keyframes zoom {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

/* === ANIMATE TOP (for modals) === */
@keyframes animatetop {
    from {
        top: -300px;
        opacity: 0;
    }
    to {
        top: 0;
        opacity: 1;
    }
}

/* === BACKGROUND GRADIENTS === */
.background-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-background);
    background: linear-gradient(135deg, #2a1a2a 0%, #1a1118 50%, #251620 100%);
}

.background-layer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(155, 107, 155, 0.15), transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(166, 107, 122, 0.15), transparent 50%);
    pointer-events: none;
}

/* Light mode background */
:root[data-theme="modern-light"] .background-layer {
    background: linear-gradient(135deg, #f5d0c5 0%, #d4a5a5 50%, #c89f9c 100%);
}

:root[data-theme="modern-light"] .background-layer::before {
    background: 
        radial-gradient(circle at 20% 50%, rgba(200, 162, 200, 0.2), transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(230, 184, 194, 0.2), transparent 50%);
}

/* === GLASSMORPHISM EFFECT === */
.glass-effect {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-soft);
    border-radius: var(--border-radius-large);
    box-shadow: 0 10px 30px var(--shadow-soft);
}

/* === BUTTON STYLES === */
.btn-modern {
    padding: 16px 40px;
    border-radius: 30px;
    font-family: var(--font-family-secondary);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-modern-primary {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    color: white;
    box-shadow: 0 8px 25px rgba(155, 107, 155, 0.3);
}

.btn-modern-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(155, 107, 155, 0.4);
}

.btn-modern-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-soft);
    backdrop-filter: blur(10px);
}

.btn-modern-secondary:hover {
    background: rgba(155, 107, 155, 0.2);
    transform: translateY(-3px);
}

/* === LINK STYLES === */
a {
    color: var(--link-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--link-hover);
}

/* In-text links with background */
.choice-link,
.dialogue-text a {
    color: var(--link-color);
    font-weight: 500;
    padding: 2px 6px;
    margin: 0 -2px;
    border-radius: 4px;
    background: var(--link-bg);
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.choice-link:hover,
.dialogue-text a:hover {
    color: var(--link-hover);
    background: var(--link-bg-hover);
    border-bottom-color: var(--link-hover);
}

/* === SCROLLBAR STYLES === */
/* Auto-hide scrollbar */
.auto-hide-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    transition: scrollbar-color 0.3s ease;
}

.auto-hide-scrollbar:hover,
.auto-hide-scrollbar:active {
    scrollbar-color: var(--accent-purple) transparent;
}

.auto-hide-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.auto-hide-scrollbar::-webkit-scrollbar-track {
    background: transparent;
    margin: 25px 0;
}

.auto-hide-scrollbar::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 10px;
    transition: background 0.3s ease;
}

.auto-hide-scrollbar:hover::-webkit-scrollbar-thumb,
.auto-hide-scrollbar:active::-webkit-scrollbar-thumb {
    background: rgba(200, 162, 200, 0.5);
}

.auto-hide-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(200, 162, 200, 0.7);
}

/* === UTILITY CLASSES === */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.font-primary {
    font-family: var(--font-family-primary);
}

.font-secondary {
    font-family: var(--font-family-secondary);
}

.font-weight-normal {
    font-weight: 400;
}

.font-weight-semibold {
    font-weight: 600;
}

.font-weight-bold {
    font-weight: 700;
}

.cursor-pointer {
    cursor: pointer;
}

.no-select {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* === RESPONSIVE UTILITIES === */
@media (max-width: 1200px) {
    :root {
        --sidebar-width: 260px;
        --font-size-base: 17px;
    }
}

@media (max-width: 992px) {
    :root {
        --font-size-base: 16px;
        --status-bar-height: 60px;
    }
}

@media (max-width: 640px) {
    :root {
        --font-size-base: 15px;
        --status-bar-height: 55px;
    }
}

/* === TRANSITION CLASSES === */
.transition-all {
    transition: all 0.3s ease;
}

.transition-fast {
    transition: all 0.15s ease;
}

.transition-slow {
    transition: all 0.6s ease;
}

/* === HOVER EFFECTS === */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px var(--shadow-soft);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px var(--glow);
}

/* === FOCUS STATES === */
*:focus {
    outline: 2px solid var(--accent-purple);
    outline-offset: 2px;
}

button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--accent-purple);
    outline-offset: 2px;
}

/* === ACCESSIBILITY === */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* === PRINT STYLES === */
@media print {
    .particles,
    .background-layer {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* === MODERN THEME OVERRIDES (ensure modern styles take priority) === */
:root[data-theme="modern"],
:root[data-theme="modern-light"] {
    /* Force modern theme styles */
}

/* Override legacy layout styles when modern theme is active */
:root[data-theme="modern"] #imgplace,
:root[data-theme="modern-light"] #imgplace {
    display: none !important; /* Hide legacy background image container */
}

:root[data-theme="modern"] #textContent,
:root[data-theme="modern-light"] #textContent {
    /* Modern theme uses different layout */
    position: relative;
    z-index: var(--z-content);
    padding: 0 !important; /* Eltávolítjuk a felső üres csíkot */
}

:root[data-theme="modern"] #avatarContainer,
:root[data-theme="modern-light"] #avatarContainer {
    /* Modern theme uses different layout */
    position: relative;
    z-index: var(--z-sidebar);
}

/* Ensure particles are visible only in modern theme */
:root[data-theme="legacy"] .particles,
:root[data-theme="bimbo"] .particles,
:root[data-theme="himbo"] .particles,
:root[data-theme="kinktopia"] .particles {
    display: none !important;
}

:root[data-theme="legacy"] .background-layer,
:root[data-theme="bimbo"] .background-layer,
:root[data-theme="himbo"] .background-layer,
:root[data-theme="kinktopia"] .background-layer {
    display: none !important;
}

/* Override legacy font sizes */
:root[data-theme="modern"] *,
:root[data-theme="modern-light"] * {
    /* Let modern theme control font sizes */
}

/* Modern theme link styles (override legacy) */
:root[data-theme="modern"] a,
:root[data-theme="modern-light"] a {
    color: var(--link-color) !important;
    text-decoration: none;
    transition: all 0.3s ease;
}

:root[data-theme="modern"] a:hover,
:root[data-theme="modern-light"] a:hover {
    color: var(--link-hover) !important;
}

/* Modern theme button styles (override legacy where needed) */
:root[data-theme="modern"] button:not([class]),
:root[data-theme="modern-light"] button:not([class]) {
    font-family: var(--font-family-secondary);
    transition: all 0.3s ease;
}

/* Modern theme modal styles */
:root[data-theme="modern"] .modal-content,
:root[data-theme="modern-light"] .modal-content {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-soft) !important;
    border-radius: var(--border-radius-large) !important;
    backdrop-filter: blur(10px);
}

/* Modern theme input styles */
:root[data-theme="modern"] input,
:root[data-theme="modern"] textarea,
:root[data-theme="modern"] select,
:root[data-theme="modern-light"] input,
:root[data-theme="modern-light"] textarea,
:root[data-theme="modern-light"] select {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--border-soft) !important;
    border-radius: var(--border-radius-small) !important;
    color: var(--text-primary) !important;
    font-family: var(--font-family-primary);
    padding: 12px 18px;
    transition: all 0.3s ease;
}

:root[data-theme="modern"] input:focus,
:root[data-theme="modern"] textarea:focus,
:root[data-theme="modern"] select:focus,
:root[data-theme="modern-light"] input:focus,
:root[data-theme="modern-light"] textarea:focus,
:root[data-theme="modern-light"] select:focus {
    outline: none;
    border-color: var(--accent-purple) !important;
    background: rgba(155, 107, 155, 0.1) !important;
}

