:root {
    /* Light Mode Colors */
    --background-gradient: linear-gradient(to right, #fef9f9, rgb(180, 224, 241));
    --text-color: #333;
    --header-bg: linear-gradient(90deg, #00a8cc, #d8f4ff);
    --header-text: #ffffff;
    --hero-bg: linear-gradient(135deg, rgba(0, 169, 204, 0.5), rgba(0, 201, 167, 0.4)), var(--hero-bg-image) no-repeat center center/cover;
    --hero-text: #ffffff;
    --hero-text-shadow: 3px 3px 8px rgba(0, 0, 0, 0.4);
    --card-bg: linear-gradient(145deg, #fdfcfe, #d8f4ff);
    --card-text: #00a8cc;
    --card-secondary-text: #444;
    --btn-primary-bg: linear-gradient(90deg, #00c9a7, #12d3cf);
    --btn-primary-bg-hover: linear-gradient(90deg, #00b49c, #0ec7c3);
    --btn-primary-shadow: 0 4px 12px rgba(0, 201, 167, 0.5);
    --btn-secondary-bg: linear-gradient(90deg, #6c757d, #adb5bd);
    --btn-secondary-bg-hover: linear-gradient(90deg, #5c636a, #90969c);
    --btn-success-bg: linear-gradient(90deg, #28a745, #34ce57);
    --btn-success-bg-hover: linear-gradient(90deg, #218838, #2ea44f);
    --btn-success-shadow: 0 4px 12px rgba(40, 167, 69, 0.5);
    --alert-info-bg: #cce5ff;
    --alert-info-text: #004085;
    --alert-success-bg: #d4edda;
    --alert-success-text: #155724;
}

/* Dark Mode Colors */
body.dark-mode {
    --background-gradient: linear-gradient(to right, #1a1a1a, #2c3e50);
    --text-color: #e0e0e0;
    --header-bg: linear-gradient(90deg, #2c3e50, #34495e);
    --header-text: #e0e0e0;
    --hero-bg: linear-gradient(135deg, rgba(44, 62, 80, 0.5), rgba(52, 73, 94, 0.4)), var(--hero-bg-image) no-repeat center center/cover;
    --hero-text: #e0e0e0;
    --hero-text-shadow: 3px 3px 8px rgba(0, 0, 0, 0.6);
    --card-bg: linear-gradient(145deg, #2c2c2c, #3a3a3a);
    --card-text: #3498db;
    --card-secondary-text: #b0b0b0;
    --btn-primary-bg: linear-gradient(90deg, #3498db, #2980b9);
    --btn-primary-bg-hover: linear-gradient(90deg, #2980b9, #1f618d);
    --btn-primary-shadow: 0 4px 12px rgba(52, 152, 219, 0.5);
    --btn-secondary-bg: linear-gradient(90deg, #6c757d, #5a6268);
    --btn-secondary-bg-hover: linear-gradient(90deg, #5c636a, #4b5156);
    --btn-success-bg: linear-gradient(90deg, #28a745, #218838);
    --btn-success-bg-hover: linear-gradient(90deg, #218838, #1c7430);
    --btn-success-shadow: 0 4px 12px rgba(40, 167, 69, 0.5);
    --alert-info-bg: #3498db;
    --alert-info-text: #ffffff;
    --alert-success-bg: #28a745;
    --alert-success-text: #ffffff;
}

body {
    margin: 0;
    font-family: 'Cairo', sans-serif;
    background: var(--background-gradient);
    color: var(--text-color);
    transition: background 0.3s ease, color 0.3s ease;
}

html[dir="rtl"] body {
    text-align: right;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: var(--header-bg);
    color: var(--header-text);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.8s ease-out forwards;
}

@keyframes slideDown {
    0% { transform: translateY(-100%); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.header a {
    color: var(--header-text);
    text-decoration: none;
    margin: 0 15px;
    font-size: 18px;
    font-weight: 500;
    position: relative;
    transition: color 0.3s ease;
}

.header a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background-color: var(--header-text);
    left: 0;
    bottom: -5px;
    transition: width 0.3s ease;
}

html[dir="rtl"] .header a::after {
    left: unset;
    right: 0;
}

.header a:hover::after { width: 100%; }
.header a:hover { color: #f0f8ff; }

.logo {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 1px;
    transition: transform 0.3s ease;
}

.logo:hover { transform: scale(1.05); }

.menu {
    display: flex;
    align-items: center;
}

html[dir="rtl"] .menu {
    flex-direction: row-reverse;
}

.coins-display {
    margin-left: 10px;
    font-weight: bold;
    color: var(--header-text);
    background: var(--header-bg);
    padding: 5px 10px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

html[dir="rtl"] .coins-display {
    margin-left: 0;
    margin-right: 10px;
}

.coins-icon {
    font-size: 16px;
    color: #ffd700;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Dark Mode Toggle */
.dark-mode-toggle, .language-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin: 0 10px;
}

.dark-mode-toggle i, .language-toggle i {
    font-size: 20px;
    color: var(--header-text);
    transition: color 0.3s ease;
}

.hamburger {
    display: none;
    font-size: 24px;
    background: none;
    border: none;
    color: var(--header-text);
    cursor: pointer;
}

@media (max-width: 768px) {
    .menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background: var(--header-bg);
        padding: 20px 0;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    html[dir="rtl"] .menu {
        flex-direction: column;
        left: unset;
        right: 0;
    }

    .menu.active { display: flex; }
    .menu a, .menu .coins-display { margin: 10px 0; font-size: 20px; }
    .hamburger { display: block; }
    .coins-display { display: flex; justify-content: center; }
}

/* Hero Section */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 50vh;
    background: var(--hero-bg);
    color: var(--hero-text);
    text-align: center;
    padding: 0 20px;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 70%);
    z-index: -1;
    animation: pulse 6s infinite ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.2); opacity: 0.3; }
    100% { transform: scale(1); opacity: 0.7; }
}

.hero h1 {
    font-size: 48px;
    font-weight: 700;
    margin: 0;
    text-shadow: var(--hero-text-shadow);
    animation: slideInFromTop 1s ease-out forwards;
}

.hero p {
    font-size: 24px;
    font-weight: 400;
    margin: 20px 0 30px;
    max-width: 800px;
    line-height: 1.6;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.3);
    animation: fadeIn 1.2s ease-out 0.3s forwards;
    opacity: 0;
}

/* Main Content */
.container {
    margin-top: 50px;
    max-width: 1400px;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h2 {
    text-align: center;
    font-size: 36px;
    font-weight: 700;
    color: var(--card-text);
    margin-bottom: 30px;
    animation: slideInFromTop 1s ease-out forwards;
    transition: color 0.3s ease;
}

@keyframes slideInFromTop {
    0% { transform: translateY(-50px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.room-card {
    flex: 0 0 calc(25% - 20px);
    max-width: 320px;
    min-width: 260px;
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.4s ease, box-shadow 0.4s ease, background 0.3s ease;
    animation: fadeIn 1s ease-out forwards;
}

.room-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.card-body {
    padding: 20px;
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--card-text);
    margin-bottom: 15px;
    transition: color 0.3s ease;
}

.card-text {
    font-size: 16px;
    color: var(--card-secondary-text);
    margin: 5px 0;
    transition: color 0.3s ease;
}

.card-text span {
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s ease;
}

.btn-primary, .btn-secondary, .btn-success {
    background: var(--btn-primary-bg);
    border: none;
    padding: 10px 25px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 50px;
    box-shadow: var(--btn-primary-shadow);
    transition: all 0.4s ease;
    color: #ffffff;
    margin: 5px;
}

.btn-secondary {
    background: var(--btn-secondary-bg);
}

.btn-success {
    background: var(--btn-success-bg);
    box-shadow: var(--btn-success-shadow);
}

.btn-primary:hover {
    background: var(--btn-primary-bg-hover);
    transform: scale(1.1);
    box-shadow: 0 10px 25px rgba(0, 201, 167, 0.7);
}

.btn-secondary:hover {
    background: var(--btn-secondary-bg-hover);
    transform: scale(1.1);
    box-shadow: 0 10px 25px rgba(108, 117, 125, 0.7);
}

.btn-success:hover {
    background: var(--btn-success-bg-hover);
    transform: scale(1.1);
    box-shadow: 0 10px 25px rgba(40, 167, 69, 0.7);
}

.messages {
    margin-bottom: 20px;
    width: 100%;
    max-width: 800px;
}

.alert {
    border-radius: 10px;
    font-size: 16px;
    animation: fadeIn 1s ease-out;
    background-color: var(--alert-info-bg);
    color: var(--alert-info-text);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.alert-success {
    background-color: var(--alert-success-bg);
    color: var(--alert-success-text);
}

.no-rooms {
    text-align: center;
    font-size: 18px;
    color: var(--card-secondary-text);
    animation: fadeIn 1s ease-out;
    transition: color 0.3s ease;
}

/* Footer */
.footer {
    background: var(--card-bg);
    text-align: center;
    padding: 10px 0;
    font-size: 14px;
    color: var(--text-color);
    margin-top: 40px;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .room-card { flex: 0 0 calc(33.33% - 20px); }
}

@media (max-width: 900px) {
    .hero h1 { font-size: 36px; }
    .hero p { font-size: 20px; }
    h2 { font-size: 30px; }
    .room-card { flex: 0 0 calc(50% - 20px); }
}

@media (max-width: 600px) {
    .hero h1 { font-size: 28px; }
    .hero p { font-size: 16px; }
    h2 { font-size: 24px; }
    .btn-primary, .btn-secondary, .btn-success {
        padding: 8px 20px;
        font-size: 14px;
    }
    .room-card { flex: 0 0 100%; }
    .card-title { font-size: 18px; }
    .card-text { font-size: 14px; }
}