/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

header {
    background: #2c3e50;
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

header h1 {
    font-size: 1.5rem;
}

.user-info {
    font-size: 0.9rem;
}

.user-info a {
    color: #ecf0f1;
    text-decoration: underline;
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    margin: 0.5rem 0.5rem 0.5rem 0;
}

.btn:hover {
    background: #2980b9;
}

.btn-primary {
    background: #2ecc71;
}

.btn-primary:hover {
    background: #27ae60;
}

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

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input, select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background: #f8f9fa;
    font-weight: 600;
}

/* Mobile styles */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    header h1 {
        font-size: 1.25rem;
    }
    
    main {
        margin: 1rem auto;
        padding: 0 0.5rem;
    }
    
    .container {
        padding: 1rem;
    }
    
    .btn {
        width: 100%;
        margin: 0.25rem 0;
        text-align: center;
    }
    
    /* Stack table on mobile */
    table, thead, tbody, th, td, tr {
        display: block;
    }
    
    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    tr {
        border: 1px solid #ccc;
        margin-bottom: 0.5rem;
        padding: 0.5rem;
        border-radius: 4px;
        background: white;
    }
    
    td {
        border: none;
        position: relative;
        padding-left: 40% !important;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
    
    /*
    td:before {
        content: attr(data-label) ": ";
        position: absolute;
        left: 6px;
        width: 35%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
    }
    */
}

/* Time slots flex layout */
.time-slots-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
}

.time-slot-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1 1 200px;
    min-width: 150px;
    text-align: center;
}

.time-slot-card:hover {
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.time-slot-time {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.time-slot-price {
    font-size: 1.3rem;
    font-weight: bold;
    color: #27ae60;
    margin-bottom: 0.25rem;
}

.time-slot-availability {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.time-slot-card.conflicted {
    background: #f8f8f8;
    border-color: #bdc3c7;
    opacity: 0.6;
    cursor: not-allowed !important;
}

.time-slot-card.conflicted:hover {
    border-color: #bdc3c7;
    transform: none;
    box-shadow: none;
}

.time-slot-card.conflicted .time-slot-price {
    color: #95a5a6;
}

.time-slot-card.conflicted .time-slot-time {
    color: #7f8c8d;
}

/* Application form styles */
.application-intro {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border-left: 4px solid #3498db;
}

.application-form {
    max-width: 800px;
}

.form-section {
    background: white;
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.form-section h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.form-section h4 {
    margin-bottom: 1rem;
    color: #34495e;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #3498db;
    outline: 0;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.form-description {
    margin-bottom: 1.5rem;
    color: #6c757d;
    font-style: italic;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

.reference-group {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e0e0e0;
}

.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 2rem;
}

.alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Desktop styles */
@media (min-width: 769px) {
    .mobile-only {
        display: none;
    }

    .form-row {
        flex-direction: row;
    }
}

/* Mobile responsive for forms */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-section {
        padding: 1rem;
    }
    
    .btn-group {
        display: flex;
        gap: 0.5rem;
    }
    
    .btn-group .btn {
        flex: 1;
        margin: 0;
    }
    
    .form-row {
        display: flex;
        gap: 1rem;
    }
    
    .form-row .form-group {
        flex: 1;
    }
    
    .time-slots-flex {
        justify-content: flex-start;
    }
    
    .time-slot-card {
        flex: 0 1 180px;
    }
}

/* Mobile adjustments for time slots */
@media (max-width: 768px) {
    .time-slots-flex {
        flex-direction: column;
    }
    
    .time-slot-card {
        flex: none;
        width: 100%;
    }
}

/* Application status styles */
.status-card {
    margin: 2rem 0;
}

.alert-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.actions {
    margin-top: 2rem;
    text-align: center;
}

/* Application review styles */
.review-section {
    margin: 3rem 0;
}

.review-section h3 {
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
    margin-bottom: 2rem;
}

.application-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.application-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.application-header h4 {
    margin: 0;
    color: #2c3e50;
}

.application-date {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.application-details {
    margin-bottom: 2rem;
}

.detail-group {
    margin-bottom: 1.5rem;
}

.detail-group strong {
    display: block;
    margin-bottom: 0.5rem;
    color: #34495e;
}

.detail-group p {
    margin: 0.25rem 0;
    line-height: 1.5;
}

.application-actions {
    border-top: 1px solid #f0f0f0;
    padding-top: 1.5rem;
}

.review-form .form-group {
    margin-bottom: 1.5rem;
}

.button-group {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.no-applications {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Recently reviewed applications */
.reviewed-applications {
    display: grid;
    gap: 1rem;
}

.reviewed-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1.5rem;
}

.reviewed-card.status-approved {
    border-left: 4px solid #27ae60;
}

.reviewed-card.status-rejected {
    border-left: 4px solid #e74c3c;
}

.reviewed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.applicant-name {
    font-weight: 600;
    color: #2c3e50;
}

.review-status {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
}

.review-status.status-approved {
    background: #d4edda;
    color: #155724;
}

.review-status.status-rejected {
    background: #f8d7da;
    color: #721c24;
}

.reviewed-details p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
    color: #6c757d;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .application-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .reviewed-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Admin styles */
.admin-login-form {
    max-width: 400px;
    margin: 4rem auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.admin-login-form h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #3498db;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
    border-left: 4px solid #3498db;
}

.stat-card h3 {
    font-size: 2.5rem;
    margin: 0;
    color: #2c3e50;
    font-weight: bold;
}

.stat-card p {
    margin: 0.5rem 0 0 0;
    color: #7f8c8d;
    font-weight: 500;
}

.admin-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.admin-section {
    margin: 3rem 0;
}

.admin-section h3 {
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.recent-table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.recent-table table {
    margin: 0;
}

.recent-table th {
    background: #34495e;
    color: white;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-badge.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-badge.status-approved {
    background: #d4edda;
    color: #155724;
}

.status-badge.status-rejected {
    background: #f8d7da;
    color: #721c24;
}

.no-data {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Mobile responsive for admin */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .admin-actions {
        flex-direction: column;
    }
    
    .admin-actions .btn {
        width: 100%;
        margin: 0;
    }
}
