/* Pastel Dress-up Game CSS Framework */
:root {
    /* Light Theme (default) */
    --primary: #FFB5E8;      /* Soft Pink */
    --secondary: #B5B9FF;    /* Soft Blue */
    --accent: #B5FFC9;       /* Soft Mint */
    --background: #FFF5F7;   /* Soft Rose */
    --surface: #FFFFFF;      /* Pure White */
    --text: #2D3748;        /* Dark Gray */
    --text-light: #718096;  /* Medium Gray */
    
    /* Component Colors */
    --card-bg: var(--surface);
    --navbar-bg: var(--surface);
    --footer-bg: var(--surface);
    
    /* Border & Shadow */
    --border-color: #FED7E2;
    --border-radius: 12px;
    --border-width: 1px;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    /* Theme Toggle */
    --theme-toggle-bg: var(--surface);
    --theme-toggle-color: var(--text);
    --theme-toggle-shadow: var(--shadow-sm);
    
    /* Typography */
    --font-primary: 'Plus Jakarta Sans', sans-serif;
    --font-secondary: 'Inter', sans-serif;
    
    /* Spacing - Consistent Scale */
    --space-2xs: 0.25rem;   /* 4px */
    --space-xs: 0.5rem;     /* 8px */
    --space-sm: 0.75rem;    /* 12px */
    --space-md: 1rem;       /* 16px */
    --space-lg: 1.5rem;     /* 24px */
    --space-xl: 2rem;       /* 32px */
    --space-2xl: 3rem;      /* 48px */
    
    /* Container */
    --container-width: 1200px;
    --container-padding: var(--space-md);
    
    /* Animation */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;

    /* Add RGB values for primary color to support rgba */
    --primary-rgb: 255, 181, 232;
}

[data-theme="dark"] {
    /* Dark Theme */
    --primary: #FF85D4;      /* Brighter Pink */
    --secondary: #8589FF;    /* Brighter Blue */
    --accent: #85FFA9;       /* Brighter Mint */
    --background: #1a1a1a;   /* Dark Background */
    --surface: #2d2d2d;      /* Dark Surface */
    --text: #E2E8F0;        /* Light Gray */
    --text-light: #A0AEC0;  /* Medium Light Gray */
    
    /* Component Colors */
    --card-bg: var(--surface);
    --navbar-bg: rgba(45, 45, 45, 0.8);
    --footer-bg: var(--surface);
    
    /* Border & Shadow */
    --border-color: #4A5568;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    
    /* Theme Toggle */
    --theme-toggle-bg: var(--surface);
    --theme-toggle-color: var(--text);
    --theme-toggle-shadow: var(--shadow-sm);

    /* Add RGB values for primary color to support rgba */
    --primary-rgb: 255, 133, 212;
}

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

body {
    font-family: var(--font-primary);
    background-color: var(--background);
    color: var(--text);
    line-height: 1.5;
    transition: background-color 0.3s, color 0.3s;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255, 181, 232, 0.15) 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, rgba(181, 185, 255, 0.15) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: 0 0, 20px 20px;
}

[data-theme="dark"] body {
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255, 133, 212, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, rgba(133, 137, 255, 0.1) 1px, transparent 1px);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--space-md);
    color: var(--text);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: var(--space-md);
    color: var(--text-light);
}

/* Layout */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* Header & Navigation */
.game-header {
    background-color: var(--navbar-bg);
    border-bottom: var(--border-width) solid var(--border-color);
    padding: var(--space-md) 0;
    z-index: 9999;
    backdrop-filter: blur(8px);
}

.game-header .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

.game-header h1 {
    margin-bottom: 0;
    font-size: 1.75rem;
    text-align: center;
}

.game-nav {
    display: flex;
    gap: var(--space-md);
    border-top: var(--border-width) solid var(--border-color);
    padding-top: var(--space-md);
    position: relative;
    align-items: center;
}

/* Navigation Links */
.game-nav > a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--border-radius);
    transition: var(--transition-fast);
    height: 32px;
    line-height: 1;
    display: flex;
    align-items: center;
}

.game-nav > a:hover,
.game-nav > a.active {
    color: var(--primary);
    background-color: rgba(255, 181, 232, 0.1);
}

/* Account Dropdown */
.nav-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.account-link {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    height: 32px;
    line-height: 1;
}

.profile-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--primary);
    display: inline-block;
    border: 2px solid var(--surface);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
}

.account-link:hover .profile-circle {
    transform: scale(1.1);
}

.nav-dropdown-content {
    position: absolute;
    top: calc(100% + var(--space-xs));
    right: 0;
    transform: translateX(0);
    background-color: var(--surface);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--space-sm);
    min-width: 160px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
    z-index: 101;
}

.nav-dropdown:hover .nav-dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-content a {
    display: block;
    padding: var(--space-xs) var(--space-sm);
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition-fast);
    border-radius: var(--border-radius);
    text-align: left;
    line-height: 1.2;
}

.nav-dropdown-content a:hover {
    background-color: rgba(255, 181, 232, 0.1);
    color: var(--primary);
}

/* Main Content */
.game-main {
    padding: var(--space-md) 0;
    width: 100%;
    overflow-x: hidden;
}

.game-container {
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
    box-sizing: border-box;
}

/* Preview Section */
.preview-section {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    border: var(--border-width) solid var(--border-color);
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    aspect-ratio: 1;
    max-width: 300px;
    margin: 0 auto var(--space-xl);
}

.preview-window {
    width: 100%;
    height: 100%;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--background);
    position: relative;
    overflow: hidden;
    animation: bounce 3s ease-in-out infinite alternate;
}

.preview-window img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-width: 100%;
    max-height: 100%;
    border-radius: var(--border-radius);
    animation: bounce 3s ease-in-out infinite alternate-reverse;
}

@keyframes bounce {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(5px);
    }
}


/* Guestbook Styles */
.guestbook-section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.guestbook-section h2 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
}

.guestbook-form {
    margin-bottom: 2rem;
}

.guestbook-form textarea {
    width: 100%;
    min-height: 100px;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 1rem;
    font-family: inherit;
    resize: vertical;
    background: rgba(255, 255, 255, 0.9);
}

.guestbook-form textarea:focus {
    outline: none;
    border-color: #9147ff;
    box-shadow: 0 0 0 2px rgba(145, 71, 255, 0.2);
}

.guestbook-form .button-group {
    display: flex;
    gap: 1rem;
}

.guestbook-form button {
    background: #9147ff;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
}

.guestbook-form button:hover {
    background: #772ce8;
}

.guestbook-entries {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.guestbook-entry {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.entry-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    align-items: start;
}

.entry-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    grid-row: span 2;
}

.entry-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.entry-info {
    grid-column: 2;
}

.entry-header {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eee;
}

.entry-author {
    color: #9147ff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
}

.entry-author:hover {
    text-decoration: underline;
}

.entry-timestamp {
    color: #666;
    font-size: 0.9rem;
}

.entry-actions {
    justify-self: end;
}

.entry-message {
    grid-column: 2;
    color: #333;
    line-height: 1.5;
    white-space: pre-wrap;
    margin-top: 0.5rem;
}

.delete-button {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.delete-button:hover {
    background: #c82333;
}

.no-entries {
    text-align: center;
    color: #666;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .entry-grid {
        grid-template-columns: 1fr;
    }
    
    .entry-avatar {
        grid-row: auto;
        margin-bottom: 0.5rem;
    }
    
    .entry-header {
        grid-template-columns: 1fr auto;
    }
    
    .entry-info {
        grid-column: 1;
    }
    
    .entry-message {
        grid-column: 1;
    }
    
    .guestbook-form .button-group {
        flex-direction: column;
    }
}

/* Footer */
.game-footer {
    background-color: var(--footer-bg);
    border-top: var(--border-width) solid var(--border-color);
    padding: var(--space-xl) 0;
    margin-top: var(--space-2xl);
    text-align: center;
}

.game-footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

.game-footer nav {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
}

.game-footer a {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition-fast);
}

.game-footer a:hover {
    color: var(--primary);
}

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

/* Selection Styling */
::selection {
    background-color: var(--primary);
    color: var(--text);
}

/* Responsive Navigation */
@media (max-width: 768px) {
    .game-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--space-sm);
    }

    .game-nav > a,
    .account-link {
        height: 28px;
        font-size: 0.875rem;
    }

    .profile-circle {
        width: 20px;
        height: 20px;
    }

    .nav-dropdown-content {
        position: fixed;
        top: auto;
        left: 0;
        right: 0;
        transform: none;
        border-radius: 0;
        border-left: none;
        border-right: none;
        box-shadow: var(--shadow-lg);
    }

    .nav-dropdown:hover .nav-dropdown-content {
        transform: none;
    }

    .preview-section {
        max-width: 100%;
        aspect-ratio: 1;
    }
}

@media (max-width: 480px) {
    .game-header h1 {
        font-size: 1.25rem;
    }

    .game-nav {
        gap: var(--space-xs);
    }

    .game-nav a {
        padding: var(--space-2xs) var(--space-xs);
        font-size: 0.875rem;
    }

    .nav-dropdown-content {
        min-width: 100%;
    }
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--theme-toggle-bg);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--theme-toggle-color);
    font-size: 1.2rem;
    box-shadow: var(--theme-toggle-shadow);
    transition: all 0.3s ease;
    z-index: 1000;
}

.theme-toggle:hover {
    transform: scale(1.1);
    background: var(--primary);
    color: var(--surface);
}

/* Update scrollbar colors for dark theme */
[data-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--surface);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--border-color);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* News Container and List Styles */
.news-container {
    background-color: var(--background);
    min-height: 100vh;
    padding: var(--space-xl) 0;
}

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

/* News Article Styles */
.news-article {
    background-color: var(--surface);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-md);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .news-article {
    background-color: #2d2d2d;  /* Explicit dark background for dark mode */
}

.article-header {
    margin-bottom: var(--space-md);
}

.article-header h3 {
    color: var(--text);
    margin: var(--space-sm) 0;
    font-size: 1.5rem;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-light);
    font-size: 0.875rem;
}

.article-category {
    background-color: var(--primary);
    color: var(--surface);
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-block;
}

.article-author {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-top: var(--space-xs);
}

.article-content {
    color: var(--text);
    background-color: transparent;  /* Ensure content area is transparent */
}

.article-text {
    color: var(--text);
    line-height: 1.6;
    margin-bottom: var(--space-md);
    background-color: transparent;  /* Ensure text area is transparent */
}

.article-text p {
    color: var(--text);
    margin-bottom: var(--space-md);
    background-color: transparent;  /* Ensure paragraphs are transparent */
}

.article-text:last-child {
    margin-bottom: 0;
}

.article-image {
    margin-bottom: var(--space-md);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--border-radius);
}

/* News Page Title */
.page-title {
    color: var(--text);
    margin-bottom: var(--space-xl);
    text-align: center;
    font-size: 2.5rem;
    font-weight: 600;
}

/* News Buttons */
.twitch-button, .petition-button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    color: var(--surface);
}

.twitch-button {
    background-color: #9147ff;
}

.twitch-button:hover {
    background-color: #772ce8;
}

.petition-button {
    background-color: var(--primary);
}

.petition-button:hover {
    background-color: var(--secondary);
}

/* AI Chat Styles */
.chat-container {
    background-color: var(--card-bg);
}

.message-text {
    color: var(--text);
    background-color: var(--surface);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--border-radius);
    border: var(--border-width) solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.message-text p {
    color: var(--text);
    margin: 0;
}

.ai-message .message-text {
    background-color: var(--primary);
    color: var(--surface);
}

.ai-message .message-text p {
    color: var(--surface);
}

.chat-input-container input {
    background-color: var(--surface);
    color: var(--text);
    border: var(--border-width) solid var(--border-color);
}

.chat-input-container input::placeholder {
    color: var(--text-light);
}

.suggestion-chip {
    background-color: var(--surface);
    color: var(--text);
    border: var(--border-width) solid var(--border-color);
}

.suggestion-chip:hover {
    background-color: var(--primary);
    color: var(--surface);
}

/* Guestbook Styles Update */
.guestbook-form textarea {
    background-color: var(--surface);
    color: var(--text);
    border: var(--border-width) solid var(--border-color);
}

.guestbook-form textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.2);
}

.guestbook-entry {
    background-color: var(--card-bg);
    border: var(--border-width) solid var(--border-color);
}

.entry-message {
    color: var(--text);
}

.entry-timestamp {
    color: var(--text-light);
}

.no-entries {
    background-color: var(--surface);
    color: var(--text-light);
} 