:root {
    --primary: #4361ee;
    --secondary: #3a0ca3;
    --accent: #f72585;
    --light: #f8f9fa;
    --dark: #212529;
    --success: #4cc9f0;
    --warning: #f8961e;
    --danger: #ef233c;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background: #f5f5f5;
    color: var(--dark);
    padding: 20px;
    min-height: 100vh;
}

.admin-container {
    max-width: 100%;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

header h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

header p {
    opacity: 0.9;
    font-size: 0.95rem;
}

.admin-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px;
}

.route-form, .all-routes {
    flex: 1;
    min-width: 25%;
    background: var(--light);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

.route-form h2, .all-routes h2 {
    color: var(--secondary);
    margin-bottom: 15px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--dark);
}

.admin-select, .admin-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
}

.admin-input {
    margin-top: 5px;
}

.or-text {
    display: block;
    text-align: center;
    margin: 5px 0;
    color: #666;
    font-size: 0.9rem;
}

.admin-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    margin-top: 5px;
}

.admin-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.admin-btn.primary {
    background: var(--accent);
}

.admin-btn.danger {
    background: var(--danger);
}

#add-time {
    background: var(--success);
    margin-left: 10px;
}

.time-list-container {
    margin-top: 20px;
}

.time-list-container h3 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: var(--dark);
}

#current-route {
    font-weight: 700;
    color: var(--secondary);
}

.time-list {
    list-style: none;
    max-height: 15%;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 5px;
    padding: 5px;
}

.time-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: white;
    border-radius: 3px;
    margin-bottom: 5px;
    border: 1px solid #eee;
}

.time-list li:last-child {
    margin-bottom: 0;
}

.time-list li .time-value {
    font-family: monospace;
}

.time-list li .delete-time {
    color: var(--danger);
    cursor: pointer;
    background: none;
    border: none;
    font-size: 0.9rem;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.routes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
    max-height: 45%px;
    overflow-y: auto;
    padding: 5px;
}

.route-card {
    background: white;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border: 1px solid #eee;
}

.route-card h3 {
    font-size: 1rem;
    color: var(--secondary);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

.route-card h3 .route-edit {
    color: var(--primary);
    cursor: pointer;
    font-size: 0.9rem;
}

.route-times {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.route-time {
    background: #e9ecef;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.8rem;
    font-family: monospace;
}

.back-link {
    text-align: center;
    padding: 15px;
    border-top: 1px solid #eee;
}

.back-link a {
    color: var(--primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.back-link a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .admin-controls {
        flex-direction: column;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .admin-btn {
        width: 100%;
    }
    
    #add-time {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
    }
}
