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

/* Custom Properties for Colors and Typography */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #059669;
    --warning-color: #d97706;
    --error-color: #dc2626;
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #cfcfcf;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
}

/* Base Styles */
body {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
    font-weight: 400;
}

select, input, textarea, button {
    font-family: inherit;
}

/* Container Layout */
.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Header Styles */
.header {
    padding: var(--spacing-xl) 0;
    text-align: center;
}

.logo-container {
    margin-bottom: var(--spacing-lg);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
}

.logo-letter {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    transition: transform 0.3s ease;
}

.logo-letter:nth-child(1) { color: #ef4444; }
.logo-letter:nth-child(2) { color: #f59e0b; }
.logo-letter:nth-child(3) { color: #10b981; }
.logo-text {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-right: var(--spacing-xs);
}

.logo:hover .logo-letter {
    transform: scale(1.1);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 400;
    margin: 0;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-2xl) 0;
}

.search-container {
    background: var(--surface-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-2xl);
    width: 100%;
    max-width: 600px;
    text-align: center;
}

.search-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.search-description {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: var(--spacing-xl);
}

/* Search Form */
.search-form {
    margin-top: var(--spacing-xl);
}

.input-group {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
    background: var(--background-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-sm);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.input-group:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1rem;
    padding: var(--spacing-md);
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.search-button {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.search-button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.search-icon {
    width: 18px;
    height: 18px;
}

/* Back Link */
.back-link {
    margin-bottom: var(--spacing-xl);
    text-align: right;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.back-button:hover {
    background: rgb(37 99 235 / 0.1);
    transform: translateX(4px);
}

.back-icon {
    width: 16px;
    height: 16px;
}

/* Search Results */
.search-results-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xl);
}

/* No Results */
.no-results {
    text-align: center;
    padding: var(--spacing-2xl) 0;
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-lg);
}

.no-results h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

.no-results p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: var(--spacing-sm);
}

/* Results Container */
.results-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

.area-group {
    background: var(--surface-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.area-title {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    padding: var(--spacing-lg) var(--spacing-xl);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.schedules-container {
    padding: var(--spacing-lg);
    display: grid;
    gap: var(--spacing-md);
}

.schedule-card {
    background: var(--background-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

    .schedule-card.highlight {
        background: #d4fc86;
    }

.highlight .persian-date {
    color: initial;
}

.highlight .schedule-header {
    border-bottom-color: initial;
}

.highlight .time-start, .highlight .time-end {
    border-color: initial;
}

.highlight .time-separator {
    color: initial;
}

.highlight .date-label {
    background: #efd34f;
    color: #000;
    box-shadow: 0 0 0 5px #efd34f;
    border: 3px solid;
}

.schedule-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.date-label {
    background: var(--primary-color);
    color: white;
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.persian-date {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.schedule-time {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    font-size: 1.25rem;
    font-weight: 600;
}

.time-start, .time-end {
    color: var(--text-primary);
    background: var(--surface-color);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius);
    border: 2px solid var(--border-color);
}

.time-separator {
    color: var(--text-secondary);
    font-weight: 400;
}

/* Footer */
.footer {
    text-align: center;
    padding: var(--spacing-xl) 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .search-container {
        padding: var(--spacing-lg);
        margin: 0 var(--spacing-sm);
    }
    
    .logo-letter {
        font-size: 2.5rem;
    }
    
    .logo-text {
        font-size: 2rem;
    }
    
    .search-title {
        font-size: 1.75rem;
    }
    
    .input-group {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .search-button {
        width: 100%;
        justify-content: center;
    }
    
    .schedule-header {
        flex-direction: column;
        gap: var(--spacing-sm);
        text-align: center;
    }
    
    .schedule-time {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .time-start, .time-end {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .logo-letter {
        font-size: 2rem;
    }
    
    .logo-text {
        font-size: 1.75rem;
    }
    
    .search-title {
        font-size: 1.5rem;
    }
    
    .search-description {
        font-size: 1rem;
    }
    
    .area-title {
        font-size: 1.1rem;
        padding: var(--spacing-md) var(--spacing-lg);
    }
    
    .schedules-container {
        padding: var(--spacing-md);
    }
    
    .schedule-card {
        padding: var(--spacing-md);
    }
}

/* Animation for page load */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-container {
    animation: fadeInUp 0.6s ease-out;
}

.schedule-card {
    animation: fadeInUp 0.4s ease-out;
}

.schedule-card:nth-child(1) { animation-delay: 0.1s; }
.schedule-card:nth-child(2) { animation-delay: 0.2s; }
.schedule-card:nth-child(3) { animation-delay: 0.3s; }
.schedule-card:nth-child(4) { animation-delay: 0.4s; }
.schedule-card:nth-child(5) { animation-delay: 0.5s; }
