/* Common CSS for Games Online - Shared Components */

:root {
    --primary: #DD768C;
    --primary-dark: #c15a72;
    --primary-light: #a5b4fc;
    --danger: #684F7E;
    --success: #22c55e;
    --bg-start: #00082F;
    --bg-end: #251766;
    --surface: #ffffff;
    --text-main: #DD768C;
    --text-muted: #FDB29F;
    --radius: 12px;
    --shadow: 0 4px 18px rgba(0, 8, 47, .45);
    --shadow-hover: 0 6px 24px rgba(221, 118, 140, .35);
    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Added for consistency */
    --glass-bg: rgba(37, 23, 102, 0.7);
    --glass-border: rgba(104, 79, 126, 0.7);
    --text-light: var(--text-main);
    --transition: all 0.2s ease-in-out;
    --primary-color: var(--primary);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 6px;
}

/* Common Navbar Styles */
.page-navbar {

    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    padding: 12px 24px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0 0 var(--radius) var(--radius);

    /*background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
    /*color: white;*/
    /*padding: 0.75rem 1rem;*/
    /*box-shadow: 0 2px 4px rgba(0,0,0,0.1);*/
    /*position: sticky;*/
    /*top: 0;*/
    /*z-index: 100;*/
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.navbar-left,
.navbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-btn {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

.nav-btn:active {
    transform: translateY(0);
}

.game-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-left: 1rem;
    opacity: 0.9;
}

/* Language Switcher */
.lang-switch {
    position: relative;
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 0.375rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 200;
    margin-top: 0.5rem;
}

.lang-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    color: #333;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.875rem;
}

.lang-option:hover {
    background: #f8f9fa;
}

.lang-option.active {
    background: #e3f2fd;
    color: #1976d2;
    font-weight: 600;
}

.lang-option:first-child {
    border-radius: 0.375rem 0.375rem 0 0;
}

.lang-option:last-child {
    border-radius: 0 0 0.375rem 0.375rem;
}

/* Settings Dropdown */
.settings-dropdown {
    position: relative;
}

.settings-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 0.375rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 200;
    margin-top: 0.5rem;
}

.settings-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.settings-option {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    color: #333;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.875rem;
}

.settings-option:hover {
    background: #f8f9fa;
}

/* Page Layout */
.page-container {
    display: flex;
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.sidebar {
    width: 240px;
    padding: 2rem 1rem;
    background-color: #fff;
    border-right: 1px solid #e5e7eb;
}

.sidebar h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #111827;
}

.game-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.game-list li a {
    display: block;
    padding: 0.75rem 1rem;
    color: #374151;
    text-decoration: none;
    border-radius: 0.375rem;
    transition: background-color 0.2s;
}

.game-list li a:hover {
    background-color: #f3f4f6;
}


/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 1rem;
}

.container {
    max-width: 100%;
    margin: 0 auto;
}

/* Common UI Components */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #4b5563;
    transform: translateY(-1px);
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #059669;
    transform: translateY(-1px);
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: #3b82f6;
    border: 1px solid #3b82f6;
}

.btn-outline:hover:not(:disabled) {
    background: #3b82f6;
    color: white;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Notifications */
.notifications-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    max-width: 400px;
}

.notification {
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease;
}

.notification.success {
    border-left: 4px solid #10b981;
}

.notification.error {
    border-left: 4px solid #ef4444;
}

.notification.warning {
    border-left: 4px solid #f59e0b;
}

.notification.info {
    border-left: 4px solid #3b82f6;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: white;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Footer */
.footer {
    background: #1f2937;
    color: #d1d5db;
    padding: 2rem 1rem 1rem;
    margin-top: auto;
    text-align: center;
}

.footer .container {
    max-width: 1200px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar-container {
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .navbar-left,
    .navbar-right {
        gap: 0.5rem;
    }
    
    .game-title {
        display: none;
    }
    
    .nav-btn {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    
    .main-content {
        padding: 1rem 0.5rem;
    }
    
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.75rem;
    }
    
    .notifications-container {
        left: 1rem;
        right: 1rem;
        max-width: none;
    }
    
    .modal-content {
        width: 95%;
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .navbar-container {
        padding: 0.5rem;
    }
    
    .nav-btn {
        padding: 0.375rem 0.5rem;
    }
    
    .lang-dropdown,
    .settings-menu {
        min-width: 140px;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

.hidden { display: none !important; }
.visible { display: block !important; }

.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }

/* Focus styles for accessibility */
*:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.nav-btn:focus,
.btn:focus {
    outline-color: rgba(255,255,255,0.8);
}

/* Print styles */
@media print {
    .page-navbar,
    .footer,
    .notifications-container,
    .loading-overlay,
    .modal {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .main-content {
        padding: 0 !important;
        max-width: none !important;
    }
}
