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

:root {
    /* Brand Colors */
    --green-rice: #2D6A4F;
    --yellow-road: #FFB703;
    --blue-mountain: #1D3557;
    --red-vietnam: #E63946;
    --off-white: #F8F9FA;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--green-rice) 0%, var(--blue-mountain) 100%);
    --gradient-accent: linear-gradient(135deg, var(--yellow-road) 0%, var(--red-vietnam) 100%);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(29, 53, 87, 0.08);
    --shadow-md: 0 4px 16px rgba(29, 53, 87, 0.12);
    --shadow-lg: 0 8px 32px rgba(29, 53, 87, 0.16);

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

body {
    font-family: 'Heebo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(to bottom, var(--off-white) 0%, #ffffff 100%);
    color: var(--blue-mountain);
    line-height: 1.6;
    direction: rtl;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ========================================
   Header
======================================== */
.header {
    background: var(--gradient-primary);
    color: white;
    padding: var(--spacing-xl) 0;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.header-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.logo {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tagline {
    font-size: 1.1rem;
    font-weight: 300;
    opacity: 0.95;
}

/* ========================================
   Main Content
======================================== */
.main-content {
    padding: var(--spacing-xl) 0;
}

/* ========================================
   Stats Bar
======================================== */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--yellow-road);
}

.stat-icon {
    font-size: 2.5rem;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--off-white) 0%, #e8f5e9 100%);
    border-radius: var(--radius-md);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--green-rice);
    line-height: 1;
    margin-bottom: var(--spacing-xs);
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

/* ========================================
   Calendar Section
======================================== */
.calendar-section {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-xl);
}

.calendar-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.calendar-header h2 {
    font-size: 1.8rem;
    color: var(--blue-mountain);
    margin-bottom: var(--spacing-sm);
}

.calendar-header p {
    color: #6c757d;
    font-size: 1rem;
}

/* FullCalendar Customization */
#calendar {
    direction: ltr; /* Calendar grid works better LTR */
}

.fc {
    font-family: 'Heebo', sans-serif;
}

.fc-toolbar {
    margin-bottom: 1.5rem !important;
}

.fc-toolbar-title {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    color: var(--blue-mountain) !important;
}

.fc-button {
    background: var(--green-rice) !important;
    border: none !important;
    border-radius: var(--radius-sm) !important;
    padding: 0.5rem 1rem !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
}

.fc-button:hover {
    background: var(--blue-mountain) !important;
    transform: translateY(-2px);
}

.fc-button:focus {
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.3) !important;
}

.fc-button:active {
    transform: translateY(0) !important;
}

.fc-daygrid-day {
    transition: all 0.2s ease;
    cursor: pointer;
}

.fc-daygrid-day:hover {
    background: rgba(255, 183, 3, 0.1);
}

.fc-daygrid-day-top {
    padding: 0.5rem;
}

.fc-daygrid-day-number {
    padding: 0.25rem;
    text-decoration: none !important;
}

.fc-day-past {
    opacity: 0.5;
}

.fc-day-past:hover {
    background: transparent;
    cursor: not-allowed;
}

.fc-event {
    border: none !important;
    border-radius: var(--radius-sm) !important;
    padding: 0.25rem 0.5rem !important;
    margin: 0.25rem !important;
    font-weight: 500 !important;
    box-shadow: var(--shadow-sm);
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.fc-event:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.fc-event-title {
    font-size: 0.85rem;
}

.event-open {
    background-color: var(--green-rice) !important;
}

.event-full {
    background-color: var(--red-vietnam) !important;
}

/* ========================================
   How It Works
======================================== */
.how-it-works {
    background: linear-gradient(135deg, rgba(45, 106, 79, 0.05) 0%, rgba(29, 53, 87, 0.05) 100%);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.how-it-works h3 {
    text-align: center;
    font-size: 1.8rem;
    color: var(--blue-mountain);
    margin-bottom: var(--spacing-lg);
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
}

.step {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: var(--spacing-md);
    transition: all 0.3s ease;
}

.step:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.step-number {
    width: 48px;
    height: 48px;
    background: var(--gradient-accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content h4 {
    color: var(--blue-mountain);
    margin-bottom: var(--spacing-xs);
    font-size: 1.2rem;
}

.step-content p {
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ========================================
   Modal
======================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(29, 53, 87, 0.7);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: relative;
    background: white;
    border-radius: var(--radius-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: var(--spacing-md);
    left: var(--spacing-md);
    background: var(--off-white);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1;
}

.modal-close:hover {
    background: var(--red-vietnam);
    color: white;
    transform: rotate(90deg);
}

.modal-header {
    background: var(--gradient-primary);
    color: white;
    padding: var(--spacing-xl) var(--spacing-lg);
    text-align: center;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-header h3 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-xs);
}

.modal-date {
    font-size: 1.1rem;
    opacity: 0.95;
    font-weight: 300;
}

.modal-body {
    padding: var(--spacing-lg);
}

.participants-info {
    background: linear-gradient(135deg, rgba(45, 106, 79, 0.1) 0%, rgba(255, 183, 3, 0.1) 100%);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    text-align: center;
    margin-bottom: var(--spacing-lg);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--green-rice);
}

.participants-icon {
    font-size: 1.5rem;
    margin-left: var(--spacing-xs);
}

/* ========================================
   Form
======================================== */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--blue-mountain);
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: 'Heebo', sans-serif;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--green-rice);
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.1);
}

.form-group small {
    display: block;
    margin-top: var(--spacing-xs);
    color: #6c757d;
    font-size: 0.85rem;
}

.btn-primary {
    width: 100%;
    background: var(--gradient-accent);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    box-shadow: var(--shadow-sm);
    flex-direction: row-reverse;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-icon {
    font-size: 1.2rem;
    order: -1;
}

/* ========================================
   Success Modal
======================================== */
.success-modal {
    text-align: center;
    padding: var(--spacing-xl);
}

.success-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.success-modal h3 {
    font-size: 1.8rem;
    color: var(--green-rice);
    margin-bottom: var(--spacing-sm);
}

.success-modal p {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: var(--spacing-sm);
}

.success-note {
    background: rgba(45, 106, 79, 0.1);
    padding: var(--spacing-md);
    border-radius: var(--radius-sm);
    font-size: 0.95rem !important;
    margin-bottom: var(--spacing-lg) !important;
}

/* ========================================
   Footer
======================================== */
.footer {
    background: var(--blue-mountain);
    color: white;
    padding: var(--spacing-lg) 0;
    text-align: center;
    margin-top: var(--spacing-xl);
}

.footer p {
    opacity: 0.9;
}

/* ========================================
   Responsive
======================================== */
@media (max-width: 768px) {
    /* Typography */
    .logo {
        font-size: 1.8rem;
    }

    .tagline {
        font-size: 1rem;
    }

    /* Layout */
    .container {
        padding: 0 1rem;
    }

    /* Stats */
    .stats-bar {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-icon {
        font-size: 2rem;
        width: 50px;
        height: 50px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.85rem;
    }

    /* Calendar Section */
    .calendar-section {
        padding: 1rem;
        border-radius: var(--radius-md);
    }

    .calendar-header h2 {
        font-size: 1.4rem;
    }

    .calendar-header p {
        font-size: 0.9rem;
    }

    /* FullCalendar Mobile Improvements */
    .fc-toolbar {
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 1rem !important;
    }

    .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
        width: 100%;
    }

    .fc-toolbar-title {
        font-size: 1.2rem !important;
        margin-bottom: 0.5rem;
    }

    .fc-button {
        font-size: 0.85rem !important;
        padding: 0.4rem 0.7rem !important;
    }

    .fc-daygrid-day-number {
        font-size: 0.9rem;
        padding: 0.25rem;
    }

    .fc-event {
        font-size: 0.75rem !important;
        padding: 0.2rem 0.4rem !important;
    }

    .fc-daygrid-day-events {
        margin-top: 2px !important;
    }

    .fc-daygrid-event-harness {
        margin-top: 2px !important;
    }

    /* How it Works */
    .steps {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .step {
        padding: 1rem;
    }

    .step-number {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .step-content h4 {
        font-size: 1rem;
    }

    .step-content p {
        font-size: 0.9rem;
    }

    /* Modal */
    .modal-content {
        width: 95%;
        max-height: 90vh;
        border-radius: var(--radius-md);
    }

    .modal-header {
        padding: 1.5rem 1rem;
        border-radius: var(--radius-md) var(--radius-md) 0 0;
    }

    .modal-header h3 {
        font-size: 1.3rem;
    }

    .modal-date {
        font-size: 0.95rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-close {
        width: 32px;
        height: 32px;
        font-size: 1.3rem;
        top: 1rem;
        left: 1rem;
    }

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

    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px !important;
        padding: 0.75rem;
    }

    .form-group small {
        font-size: 0.8rem;
    }

    .btn-primary {
        font-size: 1rem;
        padding: 0.875rem 1.5rem;
    }

    .participants-info {
        font-size: 0.95rem;
        padding: 0.875rem;
        margin-bottom: 1rem;
    }

    /* Success Modal */
    .success-modal {
        padding: 2rem 1rem;
    }

    .success-icon {
        font-size: 3rem;
        margin-bottom: 1rem;
    }

    .success-modal h3 {
        font-size: 1.4rem;
    }

    .success-modal p {
        font-size: 0.95rem;
    }

    .success-note {
        padding: 0.875rem;
        font-size: 0.9rem !important;
    }
}

/* Extra Small Mobile - iPhone SE, small Android */
@media (max-width: 480px) {
    /* Header */
    .logo {
        font-size: 1.5rem;
    }

    .tagline {
        font-size: 0.9rem;
    }

    /* Container */
    .container {
        padding: 0 0.75rem;
    }

    /* Stats */
    .stat-card {
        padding: 0.875rem;
        gap: 0.75rem;
    }

    .stat-icon {
        font-size: 1.8rem;
        width: 45px;
        height: 45px;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    /* Calendar */
    .calendar-section {
        padding: 0.75rem;
    }

    .calendar-header h2 {
        font-size: 1.2rem;
    }

    .calendar-header p {
        font-size: 0.85rem;
    }

    .fc-toolbar-title {
        font-size: 1rem !important;
    }

    .fc-button {
        font-size: 0.75rem !important;
        padding: 0.35rem 0.6rem !important;
    }

    .fc-daygrid-day-number {
        font-size: 0.8rem;
    }

    .fc-event {
        font-size: 0.7rem !important;
    }

    /* Modal */
    .modal-content {
        width: 92%;
        max-height: 82vh;
    }

    .modal-header {
        padding: 1rem 0.75rem;
    }

    .modal-header h3 {
        font-size: 1rem;
    }

    .modal-date {
        font-size: 0.8rem;
    }

    .modal-body {
        padding: 0.65rem;
    }

    .participants-info {
        padding: 0.6rem !important;
        margin-bottom: 0.75rem !important;
        font-size: 0.9rem !important;
    }

    .form-group {
        margin-bottom: 0.7rem !important;
    }

    .form-group label {
        font-size: 0.85rem !important;
        margin-bottom: 0.3rem !important;
    }

    .total-price-display {
        padding: 0.75rem !important;
        margin-bottom: 0.75rem !important;
    }

    #totalPrice {
        font-size: 1.25rem !important;
        margin: 0.3rem 0 !important;
    }

    .payment-note {
        font-size: 0.75rem !important;
        margin: 0.3rem 0 0 0 !important;
    }

    .modal-close {
        width: 28px;
        height: 28px;
        font-size: 1.2rem;
        top: 0.75rem;
        left: 0.75rem;
    }

    /* Form */
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px !important;
        padding: 0.65rem;
    }

    .form-group small {
        font-size: 0.7rem;
    }

    .btn-primary {
        font-size: 0.9rem;
        padding: 0.7rem 1rem;
    }

    .btn-icon {
        font-size: 1rem;
    }

    .participants-info {
        font-size: 0.85rem;
        padding: 0.75rem;
    }

    .participants-icon {
        font-size: 1.2rem;
    }

    /* Success Modal */
    .success-modal {
        padding: 1.5rem 0.75rem;
    }

    .success-icon {
        font-size: 2.5rem;
    }

    .success-modal h3 {
        font-size: 1.2rem;
    }

    .success-modal p {
        font-size: 0.85rem;
    }

    /* How it Works */
    .step {
        padding: 0.875rem;
    }

    .step-number {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }

    .step-content h4 {
        font-size: 0.95rem;
    }

    .step-content p {
        font-size: 0.85rem;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .modal-content {
        max-height: 80vh;
    }

    .modal-header {
        padding: 0.75rem;
    }

    .modal-body {
        padding: 0.5rem;
    }

    .form-group {
        margin-bottom: 0.5rem !important;
    }

    .fc-toolbar {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

/* ========================================
   Loading State
======================================== */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid var(--off-white);
    border-top-color: var(--green-rice);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
