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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Login Page */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-container {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-container h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #333;
}

/* Admin Panel */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: #2c3e50;
    color: white;
    padding: 1rem;
}

.sidebar h3 {
    text-align: center;
    padding: 1rem 0;
    border-bottom: 1px solid #34495e;
}

.sidebar ul {
    list-style: none;
    margin-top: 1rem;
}

.sidebar ul li a {
    display: block;
    padding: 0.8rem 1rem;
    color: #ecf0f1;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s;
}

.sidebar ul li a:hover,
.sidebar ul li a.active {
    background: #34495e;
}

.main-content {
    flex: 1;
    padding: 2rem;
    background: #f5f6fa;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h3 {
    color: #7f8c8d;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2c3e50;
}

/* Forms */
.form-section {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-section h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 0.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

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

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

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

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Buttons */
.btn-primary {
    background: #3498db;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
    text-decoration: none;
    display: inline-block;
}

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

.btn-secondary {
    background: #95a5a6;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-small {
    background: #2ecc71;
    color: white;
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

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

/* Tables */
.data-table {
    width: 100%;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.data-table thead {
    background: #34495e;
    color: white;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
}

.data-table tbody tr {
    border-bottom: 1px solid #ecf0f1;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

/* Status Badges */
.status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-block;
}

.status.pending { background: #f39c12; color: white; }
.status.picked_up { background: #3498db; color: white; }
.status.in_transit { background: #9b59b6; color: white; }
.status.out_for_delivery { background: #e67e22; color: white; }
.status.delivered { background: #27ae60; color: white; }
.status.cancelled { background: #e74c3c; color: white; }

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

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

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

/* Client Tracking Page */
.client-page {
    background: #f8f9fa;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.back-link {
    color: white;
    text-decoration: none;
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(255,255,255,0.2);
    border-radius: 5px;
}

.back-link:hover {
    background: rgba(255,255,255,0.3);
}

.tracking-container {
    max-width: 800px;
    margin: 3rem auto;
    padding: 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    text-align: center;
}

.tracking-container h2 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.tracking-form {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
}

.tracking-form input {
    flex: 1;
    padding: 1rem;
    border: 2px solid #ecf0f1;
    border-radius: 5px;
    font-size: 1rem;
}

.tracking-form input:focus {
    border-color: #667eea;
    outline: none;
}

.tracking-form button {
    padding: 1rem 2rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

.tracking-form button:hover {
    background: #764ba2;
}

.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #ecf0f1;
}

.feature h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.feature p {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Tracking Result Page */
.tracking-result {
    max-width: 900px;
    margin: 2rem auto;
    padding: 2rem;
}

.consignment-header {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-weight: bold;
}

.consignment-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

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

.detail-card h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #ecf0f1;
}

.detail-card p {
    margin-bottom: 0.5rem;
}

.detail-card p strong {
    color: #34495e;
}

/* Timeline */
.tracking-timeline {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ecf0f1;
}

.timeline-item {
    position: relative;
    padding-bottom: 2rem;
}

.timeline-dot {
    position: absolute;
    left: -2.1rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: #3498db;
    border: 2px solid white;
    box-shadow: 0 0 0 2px #ecf0f1;
}

.timeline-content {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
}

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

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

.timeline-location {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #7f8c8d;
}

.close:hover {
    color: #333;
}

/* Search Bar */
.search-bar {
    margin-bottom: 2rem;
}

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

.search-bar input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    background: #2c3e50;
    color: white;
    margin-top: 3rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .admin-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .consignment-details {
        grid-template-columns: 1fr;
    }
    
    .tracking-form {
        flex-direction: column;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
    
    .consignment-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
}