/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color System - Light Mode */
    --gh-light-bg: #f8fafc;
    --gh-light-card-bg: #ffffff;
    --gh-light-text: #2d3748;
    --gh-light-text-secondary: #4a5568;
    --gh-light-border: #e2e8f0;
    
    /* Color System - Dark Mode */
    --gh-dark-bg: #1a202c;
    --gh-dark-card-bg: #2d3748;
    --gh-dark-text: #f7fafc;
    --gh-dark-text-secondary: #e2e8f0;
    --gh-dark-border: #4a5568;
    
    /* Brand Colors */
    --gh-primary: #667eea;
    --gh-primary-dark: #5a67d8;
    --gh-secondary: #764ba2;
    --gh-accent: #f56565;
    --gh-success: #48bb78;
    
    /* Gradients */
    --gh-gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gh-gradient-dark: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    --gh-gradient-card-1: linear-gradient(135deg, #ff6b6b, #ee5a24);
    --gh-gradient-card-2: linear-gradient(135deg, #4834d4, #686de0);
    --gh-gradient-card-3: linear-gradient(135deg, #00d2d3, #54a0ff);
    
    /* Spacing */
    --gh-space-xs: 0.5rem;
    --gh-space-sm: 1rem;
    --gh-space-md: 1.5rem;
    --gh-space-lg: 2rem;
    --gh-space-xl: 3rem;
    
    /* Border Radius */
    --gh-radius-sm: 8px;
    --gh-radius-md: 12px;
    --gh-radius-lg: 16px;
    --gh-radius-xl: 24px;
    
    /* Shadows */
    --gh-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --gh-shadow-md: 0 4px 15px rgba(0, 0, 0, 0.1);
    --gh-shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.15);
    --gh-shadow-dark: 0 4px 15px rgba(0, 0, 0, 0.3);
    
    /* Transitions */
    --gh-transition-fast: 0.2s ease;
    --gh-transition-normal: 0.3s ease;
    --gh-transition-slow: 0.5s ease;
    
    /* Typography */
    --gh-font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --gh-font-size-xs: 0.75rem;
    --gh-font-size-sm: 0.875rem;
    --gh-font-size-base: 1rem;
    --gh-font-size-lg: 1.125rem;
    --gh-font-size-xl: 1.25rem;
    --gh-font-size-2xl: 1.5rem;
    --gh-font-size-3xl: 2rem;
    --gh-font-size-4xl: 2.5rem;
    
    /* Layout */
    --gh-max-width: 1200px;
    --gh-header-height: 80px;
    --gh-footer-height: 120px;
}

/* Base Body Styles */
.GH-body {
    font-family: var(--gh-font-family);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: all var(--gh-transition-normal);
    line-height: 1.6;
}

/* Light Mode */
.GH-light-mode {
    background-color: var(--gh-light-bg);
    color: var(--gh-light-text);
}

.GH-light-mode .GH-header {
    background: var(--gh-gradient-primary);
    color: white;
}

.GH-light-mode .GH-card:not([class*="GH-card-"]) {
    background: var(--gh-light-card-bg);
    box-shadow: var(--gh-shadow-md);
    color: var(--gh-light-text);
    border: 1px solid var(--gh-light-border);
}

.GH-light-mode .GH-footer {
    background: #2c3e50;
    color: white;
}

/* Dark Mode */
.GH-dark-mode {
    background-color: var(--gh-dark-bg);
    color: var(--gh-dark-text);
}

.GH-dark-mode .GH-header {
    background: var(--gh-gradient-dark);
    color: white;
}

.GH-dark-mode .GH-card:not([class*="GH-card-"]) {
    background: var(--gh-dark-card-bg);
    box-shadow: var(--gh-shadow-dark);
    color: var(--gh-dark-text);
    border: 1px solid var(--gh-dark-border);
}

.GH-dark-mode .GH-footer {
    background: #1a202c;
    color: var(--gh-dark-text);
}

/* Header Styles */
.GH-header {
    padding: var(--gh-space-sm) var(--gh-space-lg);
    box-shadow: var(--gh-shadow-sm);
    height: var(--gh-header-height);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.GH-header-content {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    max-width: var(--gh-max-width);
    margin: 0 auto;
    gap: var(--gh-space-md);
    height: 100%;
}

.GH-logo-section {
    display: flex;
    align-items: center;
}

.GH-general-logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    transition: transform var(--gh-transition-normal);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.GH-general-logo:hover {
    transform: scale(1.1) rotate(5deg);
}

.GH-title {
    font-size: var(--gh-font-size-3xl);
    font-weight: 700;
    text-align: center;
    justify-self: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.GH-controls {
    display: flex;
    gap: var(--gh-space-sm);
    align-items: center;
    justify-self: end;
}

/* Control Elements */
.GH-language-select,
.GH-mode-toggle,
.GH-notification-toggle {
    padding: var(--gh-space-xs) var(--gh-space-sm);
    border: none;
    border-radius: var(--gh-radius-md);
    cursor: pointer;
    transition: all var(--gh-transition-normal);
    font-size: var(--gh-font-size-sm);
    font-weight: 500;
}

.GH-light-mode .GH-language-select,
.GH-light-mode .GH-mode-toggle,
.GH-light-mode .GH-notification-toggle {
    background: rgba(255, 255, 255, 0.95);
    color: var(--gh-light-text);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.GH-dark-mode .GH-language-select,
.GH-dark-mode .GH-mode-toggle,
.GH-dark-mode .GH-notification-toggle {
    background: rgba(255, 255, 255, 0.95);
    color: var(--gh-dark-bg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.GH-language-select:hover,
.GH-mode-toggle:hover,
.GH-notification-toggle:hover {
    transform: translateY(-2px);
    box-shadow: var(--gh-shadow-lg);
}

.GH-language-select:focus,
.GH-mode-toggle:focus,
.GH-notification-toggle:focus {
    outline: 2px solid var(--gh-primary);
    outline-offset: 2px;
}

/* Main Content */
.GH-main {
    flex: 1;
    padding: var(--gh-space-xl) var(--gh-space-lg);
    max-width: var(--gh-max-width);
    margin: 0 auto;
    width: 100%;
    animation: fadeIn var(--gh-transition-slow);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.GH-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--gh-space-lg);
    margin-top: var(--gh-space-lg);
}

.GH-card {
    padding: var(--gh-space-xl);
    border-radius: var(--gh-radius-lg);
    text-align: center;
    transition: all var(--gh-transition-normal);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.GH-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    transform: scaleX(0);
    transition: transform var(--gh-transition-normal);
}

.GH-card:hover::before {
    transform: scaleX(1);
}

.GH-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--gh-shadow-lg);
}

/* Colored Cards */
.GH-card-1 {
    background: var(--gh-gradient-card-1);
    color: white;
}

.GH-card-2 {
    background: var(--gh-gradient-card-2);
    color: white;
}

.GH-card-3 {
    background: var(--gh-gradient-card-3);
    color: white;
}

.GH-card h2 {
    font-size: var(--gh-font-size-2xl);
    margin-bottom: var(--gh-space-sm);
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.GH-card p {
    font-size: var(--gh-font-size-lg);
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

/* Footer */
.GH-footer {
    padding: var(--gh-space-lg);
    margin-top: auto;
    background: #2c3e50;
}

.GH-footer-content {
    max-width: var(--gh-max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gh-space-lg);
    text-align: center;
}

.GH-footer-column {
    display: flex;
    flex-direction: column;
    gap: var(--gh-space-xs);
}

.GH-footer-column a {
    color: inherit;
    text-decoration: none;
    transition: color var(--gh-transition-fast);
    padding: 2px 4px;
    border-radius: var(--gh-radius-sm);
}

.GH-footer-column a:hover {
    color: var(--gh-primary);
    background: rgba(255, 255, 255, 0.1);
}

/* Icon Styles */
.GH-icon {
    font-size: 1.2rem;
    display: inline-block;
    transition: transform var(--gh-transition-normal);
}

.GH-mode-toggle:hover .GH-icon,
.GH-notification-toggle:hover .GH-icon {
    transform: scale(1.3) rotate(15deg);
}

/* Button Styles for Icon Buttons */
.GH-mode-toggle,
.GH-notification-toggle {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Tooltip Styles */
.GH-logo-link,
.GH-mode-toggle,
.GH-notification-toggle {
    position: relative;
}

.GH-logo-link::after,
.GH-mode-toggle::after,
.GH-notification-toggle::after {
    content: attr(title);
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: var(--gh-radius-sm);
    font-size: var(--gh-font-size-xs);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--gh-transition-normal);
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.GH-logo-link:hover::after,
.GH-mode-toggle:hover::after,
.GH-notification-toggle:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* RTL Support */
[dir="rtl"] .GH-logo-link::after,
[dir="rtl"] .GH-mode-toggle::after,
[dir="rtl"] .GH-notification-toggle::after {
    left: auto;
    right: 50%;
    transform: translateX(50%) translateY(10px);
}

[dir="rtl"] .GH-logo-link:hover::after,
[dir="rtl"] .GH-mode-toggle:hover::after,
[dir="rtl"] .GH-notification-toggle:hover::after {
    transform: translateX(50%) translateY(0);
}

/* Focus Styles for Accessibility */
button:focus-visible,
select:focus-visible {
    outline: 2px solid var(--gh-primary);
    outline-offset: 2px;
}

/* Loading Animation */
.GH-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    :root {
        --gh-space-lg: 1.5rem;
        --gh-space-xl: 2rem;
    }

    .GH-header {
        padding: var(--gh-space-sm);
        height: auto;
    }

    .GH-header-content {
        grid-template-columns: 1fr;
        gap: var(--gh-space-sm);
        text-align: center;
    }

    .GH-title {
        font-size: var(--gh-font-size-2xl);
        order: -1;
    }

    .GH-controls {
        justify-self: center;
        flex-wrap: wrap;
    }

    .GH-main {
        padding: var(--gh-space-lg) var(--gh-space-sm);
    }

    .GH-cards-container {
        grid-template-columns: 1fr;
        gap: var(--gh-space-md);
    }

    .GH-card {
        padding: var(--gh-space-lg);
    }

    .GH-footer-content {
        grid-template-columns: 1fr;
        gap: var(--gh-space-md);
        text-align: center;
    }

    .GH-footer-column {
        align-items: center;
    }
}

@media (max-width: 480px) {
    .GH-header-content {
        grid-template-columns: 1fr;
    }

    .GH-title {
        font-size: var(--gh-font-size-xl);
    }

    .GH-controls {
        gap: var(--gh-space-xs);
    }

    .GH-language-select {
        font-size: var(--gh-font-size-xs);
        padding: var(--gh-space-xs);
    }

    .GH-mode-toggle,
    .GH-notification-toggle {
        width: 36px;
        height: 36px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --gh-light-border: #000000;
        --gh-dark-border: #ffffff;
    }

    .GH-card {
        border-width: 2px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    .GH-header,
    .GH-footer,
    .GH-controls {
        display: none;
    }

    .GH-body {
        background: white !important;
        color: black !important;
    }

    .GH-card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }
}

/* Toast Notification Styles */
.GH-global-toast {
    padding: 12px 20px;
    border-radius: var(--gh-radius-md);
    color: white;
    font-weight: 500;
    box-shadow: var(--gh-shadow-lg);
    transform: translateX(150%);
    transition: transform 0.3s ease;
    cursor: pointer;
    backdrop-filter: blur(10px);
    margin-bottom: 10px;
}

.GH-toast-success {
    background-color: var(--gh-success);
}

.GH-toast-error {
    background-color: var(--gh-accent);
}

.GH-toast-warning {
    background-color: var(--game-warning);
    color: var(--gh-dark-text);
}

.GH-toast-info {
    background-color: var(--gh-primary);
}

/* Add styles for the game notification */
.GH-game-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: var(--gh-space-md);
    border-radius: var(--gh-radius-md);
    color: white;
    font-weight: bold;
    box-shadow: var(--gh-shadow-lg);
    z-index: 1000;
    transform: translateX(150%);
    transition: transform 0.3s ease;
    max-width: 300px;
}

.GH-game-notification.show {
    transform: translateX(0);
}

.GH-game-notification.success {
    background-color: var(--game-success);
}

.GH-game-notification.error {
    background-color: var(--game-error);
}

.GH-game-notification.info {
    background-color: var(--game-primary);
}

.GH-game-notification.warning {
    background-color: var(--game-warning);
    color: var(--gh-dark-text);
}

