@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800&family=Lato:wght@300;400;700&display=swap');

:root {
    --primary: #c8102e; /* Maple Red */
    --navy: #1d355e;    /* Form Navy Blue */
    --gold: #d4af37;
}

/* Typography & Direction */
html[lang="ar"] body { font-family: 'Tajawal', sans-serif; }
html[lang="en"] body { font-family: 'Lato', sans-serif; }

/* STRICT VIEW SYSTEM */
.page-view { display: none !important; opacity: 0; transition: opacity 0.3s ease; }
.page-view.active { display: block !important; opacity: 1; }
#view-admin.active { display: flex !important; }

/* Professional Form Styling */
.form-card { 
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 2rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    position: relative;
    transition: box-shadow 0.3s ease;
    border-top: 5px solid var(--navy); 
}

.form-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.section-header { 
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--navy); 
}

.form-label { 
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 0.75rem;
    letter-spacing: 0.025em;
}

/* Increased Input Size & Spacing for better UX */
.form-input { 
    width: 100%;
    padding: 0.75rem 1.25rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #f9fafb;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    height: 3rem;
}

.form-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(29, 53, 94, 0.2), 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-color: #1e3a8a;
    background-color: white;
}

.required { 
    color: #dc2626;
    margin-left: 0.25rem;
    font-weight: 700;
}

/* Hero Slider */
.hero-slide { 
    position: absolute; 
    inset: 0; 
    background-size: cover; 
    background-position: center; 
    opacity: 0; 
    transition: opacity 1.5s ease-in-out;
    transform: scale(1.1);
}
.hero-slide.active { 
    opacity: 1; 
    transform: scale(1);
}

.hero-indicator {
    cursor: pointer;
    transition: all 0.3s ease;
}

.hero-indicator.active {
    width: 2rem;
    border-radius: 0.5rem;
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #1d355e; border-radius: 5px; border: 2px solid #f1f1f1; }

/* Enhanced Form Styling */
.form-section {
    position: relative;
    margin-bottom: 2rem;
}

.form-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--navy) 0%, var(--primary) 100%);
    border-radius: 2px;
}

.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.form-input:invalid:not(:placeholder-shown) {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.form-input:valid:not(:placeholder-shown) {
    border-color: #10b981;
}

.form-input:focus:valid {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Progress Indicator */
.form-progress {
    position: sticky;
    top: 80px;
    z-index: 10;
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-step {
    flex: 1;
    text-align: center;
    position: relative;
    padding: 0.5rem;
}

.progress-step::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 0;
    width: 100%;
    height: 3px;
    background: var(--line-color, #e5e7eb);
    z-index: 0;
    transform: translateY(-50%);
    transition: background 0.3s ease;
}

.progress-step:last-child::after {
    display: none;
}

.progress-step.active::after {
    background: var(--navy);
}

.progress-step.completed::after {
    background: var(--primary);
}

.step-number {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin: 0 auto 0.5rem;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    border: 2px solid transparent;
}

.progress-step.active .step-number {
    background: var(--navy);
    color: white;
    transform: scale(1.1);
}

.progress-step.completed .step-number {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.progress-step.completed .step-number::after {
    content: '✓';
    position: absolute;
    font-size: 0.875rem;
}

.step-title {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 600;
}

.progress-step.active .step-title {
    color: var(--navy);
    font-weight: 700;
}

.progress-step.viewing .step-number {
    border: 2px solid var(--navy);
    box-shadow: 0 0 0 4px rgba(29, 53, 94, 0.1);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(29, 53, 94, 0.1);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(29, 53, 94, 0.05);
    }
}

/* Photo Upload Enhancement */
.photo-upload-area {
    position: relative;
    overflow: hidden;
}

.photo-upload-area:hover .upload-overlay {
    opacity: 1;
}

.upload-overlay {
    position: absolute;
    inset: 0;
    background: rgba(29, 53, 94, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    color: white;
    font-weight: bold;
}

/* Form Validation Messages */
.field-error {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.field-success {
    color: #10b981;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Smooth Transitions */
.form-card {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Section Numbering */
.form-card[data-section]::before {
    content: attr(data-section);
    position: absolute;
    top: -15px;
    right: 30px;
    width: 35px;
    height: 35px;
    background: var(--navy);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 1;
}

/* Enhanced Input Focus States */
.form-input:focus {
    transform: translateY(-2px);
    box-shadow: 0 0 0 2px rgba(29, 53, 94, 0.2), 0 4px 12px rgba(29, 53, 94, 0.15);
    border-color: #1e3a8a;
}

/* Select Arrow Styling */
select.form-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231d355e' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 1rem center;
    padding-left: 2.5rem;
    appearance: none;
    cursor: pointer;
}

/* Loading State */
.form-submitting {
    opacity: 0.6;
    pointer-events: none;
}

.form-submitting::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Success Checkmark Animation */
@keyframes checkmark {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.field-success::before {
    content: '✓';
    animation: checkmark 0.3s ease-out;
}

/* Line Clamp Utility */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Fade In Animation */
.fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Improvements */
@media (max-width: 768px) {
    .form-card {
        padding: 1.5rem;
    }
    
    .section-header {
        font-size: 1.5rem;
    }
    
    .progress-steps {
        flex-direction: column;
        gap: 1rem;
    }
    
    .progress-step::after {
        display: none;
    }
    
    .form-card[data-section]::before {
        width: 30px;
        height: 30px;
        font-size: 0.875rem;
        top: -12px;
        right: 20px;
    }
    
    /* Hide navigation arrows on mobile */
    #hero-prev, #hero-next {
        display: none;
    }
    
    /* Smaller hero text on mobile */
    header h1 {
        font-size: 2.5rem !important;
    }
}

/* Admin Dashboard Styles */
#admin-interface {
    font-family: 'Tajawal', sans-serif;
}

#admin-nav button {
    transition: all 0.3s ease;
}

#admin-nav button:hover {
    transform: translateX(-5px);
}

/* Chart Container */
canvas {
    max-height: 300px;
}

/* Admin Table Styles */
#adm-booking-rows tr,
#adm-user-rows tr {
    transition: background-color 0.2s ease;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
}

/* File Status Colors */
.file-status-complete {
    background-color: #10b981;
    color: white;
}

.file-status-missing {
    background-color: #f59e0b;
    color: white;
}

.file-status-incomplete {
    background-color: #ef4444;
    color: white;
}

.file-status-paid {
    background-color: #3b82f6;
    color: white;
}

/* Smooth Scrollbar for Admin */
#admin-interface ::-webkit-scrollbar {
    width: 8px;
}

#admin-interface ::-webkit-scrollbar-track {
    background: #1e293b;
}

#admin-interface ::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

#admin-interface ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Admin Card Hover Effects */
.bg-slate-800.rounded-xl {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bg-slate-800.rounded-xl:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* Loading Animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 0.8s linear infinite;
}

/* Fade In Animation for Admin Content */
[id^="adm-tab-"] {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Auth Page Styles */
#view-auth {
    background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #1e293b 100%);
}

#auth-form-login,
#auth-form-register {
    animation: fadeIn 0.3s ease-in;
}

/* User Dropdown Menu */
#user-dropdown {
    animation: fadeIn 0.2s ease-in;
}

#user-dropdown button {
    transition: all 0.2s ease;
}

#user-dropdown button:hover {
    transform: translateX(-5px);
}

/* Auth Form Input Focus */
#view-auth input:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Success Message Animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fixed.bg-green-600 {
    animation: slideDown 0.3s ease-out;
}
