/* =========================================
   CSS Custom Properties (Variables)
   ========================================= */
:root {
    /* Colors - inspired by Android theme */
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --accent-color: #e67e22; /* For settings button */
    --danger-color: #e74c3c;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --bg-body: #f5f7fa;
    --bg-card: #ffffff;
    
    /* Spacing */
    --spacing-sm: 10px;
    --spacing-md: 20px;
    --spacing-lg: 40px;
    
    /* Typography */
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-size-base: 16px;
    --font-size-title: 2.5rem;
    --font-size-subtitle: 1.8rem;
    
    /* Borders & Shadows */
    --border-radius: 8px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.15);
}

/* =========================================
   Reset & Base Styles
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    min-width: fit-content;
    min-height: fit-content;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-body);
    color: var(--text-dark);
    direction: rtl; /* RTL support */
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

/* =========================================
   Typography
   ========================================= */
h1.main-title,
h1.page-title,
h2.section-title,
h3.section-subtitle {
    direction: rtl;
}

h1.main-title,
h1.page-title {
    text-align: center;
    font-size: var(--font-size-title);
    color: var(--text-dark);
    margin-bottom: var(--spacing-lg);
}

h2.section-title {
    font-size: 1.8rem;
    color: var(--primary-color);
    border-bottom: 2px solid #ddd;
    padding-bottom: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

h3.section-subtitle {
    font-size: 1.4rem;
    color: var(--text-light);
    margin-bottom: var(--spacing-md);
}

/* =========================================
   Navigation & Back Buttons
   ========================================= */
.back-btn-container {
    display: flex;
    justify-content: flex-start; /* RTL: aligns to left (start) */
    margin-bottom: var(--spacing-md);
}

.back-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: var(--border-radius);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.back-btn::before {
    content: '←';
    font-size: 1.2rem;
}

/* =========================================
   Buttons
   ========================================= */
.btn {
    display: block;
    padding: 16px 32px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: bold;
    transition: all 0.3s ease;
    cursor: pointer;
    margin: 15px auto;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    width: 90%;
    text-align: center;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
    width: 90%;
    text-align: center;
}

.btn-accent {
    background-color: var(--accent-color);
    color: white;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* =========================================
   Event Selector (Home Page)
   ========================================= */
.form-label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: bold;
    color: var(--text-dark);
}

.form-select {
    width: 15rem;
    padding: 12px 20px;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    background-color: white;
    direction: rtl;
}

/* =========================================
   Search Inputs
   ========================================= */
.search-container {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.search-input {
    padding: 12px 20px;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    direction: rtl;
}

.table-num {
    width: 150px;
}

.btn-clear {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
}

/* =========================================
   Guest List
   ========================================= */
.guest-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.guest-item {
    background-color: var(--bg-card);
    padding: 15px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    direction: rtl;
}

.guest-info {
    flex-grow: 1;
}

.guest-name {
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--text-dark);
}

.guest-relation,
.guest-table {
    font-size: 0.95rem;
    color: var(--text-light);
}

.arrival-checkbox {
    margin-right: 10px;
}

/* =========================================
   Table Grid
   ========================================= */
.table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.table-card {
    background-color: var(--bg-card);
    border-radius: calc(var(--border-radius) * 1.5);
    padding: 25px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.table-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    background-color: #f9fbfd;
}

.table-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.table-guest-count {
    font-size: 1rem;
    color: var(--text-light);
}

/* =========================================
   Guest Info Panel
   ========================================= */
.guest-info-panel {
    background-color: var(--bg-card);
    border-radius: calc(var(--border-radius) * 1.5);
    padding: 30px;
    box-shadow: var(--shadow-md);
}

.panel-title {
    text-align: center;
    font-size: var(--font-size-subtitle);
    color: var(--text-dark);
    margin-bottom: var(--spacing-lg);
}

.panel-section h3 {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
}

.btn-close {
    display: block;
    margin: var(--spacing-lg) auto 0;
    background-color: var(--danger-color);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1.1rem;
}

/* =========================================
   Utility Classes
   ========================================= */
.hidden {
    display: none !important;
}

/* =========================================
   Responsive Design
   ========================================= */
@media (max-width: 768px) {
    :root {
        --font-size-title: 2rem;
        --spacing-lg: 30px;
    }
    
    .container {
        padding: var(--spacing-md);
    }
    
    .event-selector-container,
    .btn-settings {
        width: 100%;
    }
    
    .data-actions {
        flex-direction: column;
    }
}

/* =========================================
   Print Styles
   ========================================= */
@media print {
    :root {
        --primary-color: #3498db;
        --secondary-color: #2ecc71;
    }
    
    .back-btn-container,
    .btn-clear,
    .btn-close,
    .event-form,
    .data-actions {
        display: none !important;
    }
}