/* Air Crew Self-Scheduling System Styles */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #eee 0%, #e2d2f1 100%);
    min-height: 100vh;
}

/* Utility classes */
.page {
    display: none;
    min-height: 100vh;
}

.page.active {
    display: block;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
    color: white;
}

/* Network status indicator */
.network-status {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #ff6b6b;
    color: white;
    padding: 10px 15px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideIn 0.3s ease-out;
}

.network-status.online {
    background: #51cf66;
}

.status-icon {
    font-size: 16px;
}

/* Profile Form Styles */
.profile-form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.profile-form {
    background: white;
    padding: 0;
}

.form-description {
    color: #666;
    margin-bottom: 30px;
    font-size: 16px;
}

.form-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h4 {
    color: #333;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 250px;
}

.form-group.full-width {
    flex: 1 1 100%;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-group input:invalid {
    border-color: #dc3545;
}

.form-group select {
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.btn-primary {
    background: #007bff;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-secondary:hover {
    background: #545b62;
}

/* Responsive design for profile form */
@media (max-width: 768px) {
    .profile-form-container {
        padding: 10px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .form-group {
        min-width: auto;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Alert styles */
.alert {
    padding: 12px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-weight: 500;
    animation: slideIn 0.3s ease-out;
}

.alert-error {
    background: #fee;
    color: #c53030;
    border: 1px solid #feb2b2;
}

.alert-success {
    background: #f0fff4;
    color: #38a169;
    border: 1px solid #9ae6b4;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Login page styles */
#loginPage {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 450px;
    animation: fadeInUp 0.6s ease-out;
}

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

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    width: 80px;
    height: auto;
    margin-bottom: 20px;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 8px;
}

.login-header p {
    color: #718096;
    font-size: 14px;
}

/* Auth tabs */
.auth-tabs {
    display: flex;
    margin-bottom: 30px;
    border-radius: 8px;
    background: #f7fafc;
    padding: 4px;
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #718096;
}

.tab-btn.active {
    background: white;
    color: #2d3748;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Auth forms */
.auth-form {
    display: block;
}

.auth-form.active {
    display: block;
}

.auth-form h2 {
    font-size: 20px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 24px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #4a5568;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.email-hint {
    font-size: 12px;
    color: #718096;
    margin-top: 4px;
    display: block;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    padding: 8px 16px;
    background: #f7fafc;
    color: #4a5568;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.forgot-password {
    text-align: center;
    margin-top: 20px;
}

.forgot-password a {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.forgot-password a:hover {
    text-decoration: underline;
}

/* Dashboard styles */
#dashboardPage {
    background: #f8fafc;
}

.navbar {
    background: white;
    padding: 16px 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-logo {
    width: 40px;
    height: auto;
}

.nav-brand span {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-user span {
    font-weight: 500;
    color: #4a5568;
}

.dashboard-container {
    display: flex;
    min-height: calc(100vh - 72px);
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: white;
    border-right: 1px solid #e2e8f0;
    padding: 24px 0;
}

.nav-menu {
    list-style: none;
}

.nav-menu li {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: #4a5568;
    text-decoration: none;
    transition: all 0.2s ease;
    border-right: 3px solid transparent;
}

.nav-link:hover {
    background: #f7fafc;
    color: #2d3748;
}

.nav-link.active {
    background: #edf2f7;
    color: #667eea;
    border-right-color: #667eea;
}

.nav-icon {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.nav-label {
    font-weight: 500;
    font-size: 14px;
}

/* Main content */
.main-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.interface {
    display: none;
}

.interface h1 {
    font-size: 28px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 24px;
}

/* Dashboard grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.card.full-width {
    grid-column: 1 / -1;
}

.card h3 {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 16px;
}

.card .btn-primary {
    width: auto;
    padding: 10px 20px;
    font-size: 14px;
    margin-top: 16px;
}

/* Schedule items */
.schedule-item {
    background: #f7fafc;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    border-left: 4px solid #667eea;
}

.flight-info strong {
    color: #2d3748;
    font-size: 16px;
}

/* City Data Search and Filter Styles */
.search-filter-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid #e9ecef;
}

.search-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 20px;
    align-items: end;
}

/* Qualification Search and Filter Styles */
.search-filter-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 20px;
    align-items: end;
}

.filter-actions {
    display: flex;
    align-items: end;
}

.filter-actions .btn {
    white-space: nowrap;
    padding: 10px 16px;
    font-size: 14px;
}

.search-group,
.filter-group {
    display: flex;
    flex-direction: column;
}

.search-group label,
.filter-group label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 8px;
    font-size: 14px;
}

.search-group input,
.filter-group select {
    padding: 10px 12px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    background: white;
}

.search-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* City Cards Grid */
.city-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.city-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #e9ecef;
    position: relative;
}

.city-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.city-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.city-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.city-card-type {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.city-card-type.domestic {
    background: #38a169;
}

.city-card-type.international {
    background: #3182ce;
}

.city-card-details {
    margin-bottom: 16px;
}

.city-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f4;
}

.city-detail-row:last-child {
    border-bottom: none;
}

.city-detail-label {
    font-weight: 500;
    color: #6c757d;
    font-size: 14px;
}

.city-detail-value {
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
}

.city-card-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 12px;
    border-top: 1px solid #f1f3f4;
}

.city-card-actions .btn {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.city-card-actions .btn-edit {
    background: #ffc107;
    color: #212529;
}

.city-card-actions .btn-edit:hover {
    background: #e0a800;
}

.city-card-actions .btn-delete {
    background: #dc3545;
    color: white;
}

.city-card-actions .btn-delete:hover {
    background: #c82333;
}

.no-data-message {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-size: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 20px;
}

/* Responsive Design for Search and Cards */
@media (max-width: 768px) {
    .search-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .city-cards-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .city-card {
        padding: 16px;
    }
    
    .city-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

.flight-info .time {
    color: #718096;
    font-size: 14px;
    margin-top: 4px;
}

.flight-info .role {
    color: #667eea;
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
    text-transform: uppercase;
}

/* Crew overview */
.crew-overview {
    background: #f7fafc;
    border-radius: 8px;
    padding: 20px;
}

.crew-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: #718096;
    font-weight: 500;
}

/* Access summary */
.access-summary {
    background: #f7fafc;
    border-radius: 8px;
    padding: 16px;
}

.access-summary div {
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
    color: #4a5568;
}

.access-summary div:last-child {
    border-bottom: none;
}

/* Responsive design */
@media (max-width: 768px) {
    .login-container {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .dashboard-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .nav-menu {
        display: flex;
        overflow-x: auto;
        padding: 0 16px;
    }
    
    .nav-menu li {
        margin-bottom: 0;
        margin-right: 8px;
        white-space: nowrap;
    }
    
    .nav-link {
        padding: 8px 16px;
        border-right: none;
        border-bottom: 3px solid transparent;
    }
    
    .nav-link.active {
        border-right: none;
        border-bottom-color: #667eea;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .navbar {
        padding: 12px 16px;
    }
    
    .nav-user {
        gap: 8px;
    }
    
    .nav-user span {
        display: none;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 20px 16px;
    }
    
    .interface h1 {
        font-size: 24px;
    }
    
    .card {
        padding: 16px;
    }
    
    .auth-tabs {
        margin-bottom: 20px;
    }
    
    .tab-btn {
        padding: 10px 16px;
        font-size: 14px;
    }
}

/* Print styles */
@media print {
    .sidebar,
    .navbar,
    .btn-primary,
    .btn-secondary {
        display: none;
    }
    
    .main-content {
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #e2e8f0;
        break-inside: avoid;
    }
}