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

:root {
    --primary: #030213;
    --primary-foreground: #ffffff;
    --secondary: #f3f4f6;
    --secondary-foreground: #030213;
    --muted: #ececf0;
    --muted-foreground: #717182;
    --background: #ffffff;
    --foreground: #030213;
    --card: #ffffff;
    --card-foreground: #030213;
    --border: rgba(0, 0, 0, 0.1);
    --input-background: #f3f3f5;
    --destructive: #d4183d;
    --destructive-foreground: #ffffff;
    --success: #10b981;
    --warning: #f59e0b;
    --info: #3b82f6;
    --radius: 0.625rem;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --blue-50: #eff6ff;
    --blue-100: #dbeafe;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --blue-800: #1e40af;
    --green-500: #10b981;
    --green-600: #059669;
    --yellow-500: #f59e0b;
    --red-200: #fecaca;
    --red-50: #fef2f2;
    --red-800: #991b1b;
}

body {
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--foreground);
    background-color: var(--gray-50);
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .container {
        padding: 0 1.5rem;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 2rem;
    }
}

/* Header Styles */
.header {
    background-color: var(--background);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo i {
    width: 2rem;
    height: 2rem;
    color: var(--blue-600);
    font-size: 2rem;
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
}

.navigation {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

.nav-btn:hover {
    background-color: var(--gray-100);
    color: var(--gray-900);
}

.nav-btn.active {
    background-color: var(--primary);
    color: var(--primary-foreground);
}

.nav-btn i {
    width: 1rem;
    height: 1rem;
}

/* Main Content */
.main-content {
    padding: 2rem 0;
}

.view-content {
    display: block;
}

.view-content.hidden {
    display: none;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

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

.flex-1 {
    flex: 1;
}

.full-height {
    height: 100%;
}

.no-padding {
    padding: 0 !important;
}

/* Card Styles */
.card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--card-foreground);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-title i {
    width: 1.25rem;
    height: 1.25rem;
}

.card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-content {
    padding: 1.5rem;
}

.card-description {
    color: var(--gray-600);
    margin-top: 0.5rem;
}

/* Form Styles */
.form-input, .form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--input-background);
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--blue-500);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--foreground);
}

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

@media (min-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

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

.password-field {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    padding: 0 0.75rem;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--gray-500);
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    border: 1px solid transparent;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
}

.btn-primary:hover:not(:disabled) {
    background-color: #020110;
}

.btn-outline {
    background-color: transparent;
    color: var(--foreground);
    border-color: var(--border);
}

.btn-outline:hover:not(:disabled) {
    background-color: var(--gray-100);
}

.btn i {
    width: 1rem;
    height: 1rem;
}

/* Badge Styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge.status-delivered {
    background-color: var(--green-500);
    color: white;
}

.badge.status-in-transit {
    background-color: var(--blue-500);
    color: white;
}

.badge.status-pending {
    background-color: var(--yellow-500);
    color: white;
}

.badge.status-secondary {
    background-color: var(--gray-200);
    color: var(--gray-800);
}

/* Alert Styles */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-top: 1rem;
}

.alert-error {
    background-color: var(--red-50);
    border: 1px solid var(--red-200);
    color: var(--red-800);
}

/* Shipment Details */
.shipment-details {
    margin-top: 1.5rem;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .details-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.details-left {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.info-item {
    min-width: 0;
}

.info-label {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

.info-value {
    font-weight: 600;
    color: var(--foreground);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.info-value i {
    color: var(--blue-500);
}

.info-value i.fa-clock {
    color: var(--green-500);
}

/* Timeline Styles */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.timeline-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.timeline-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.timeline-dot.completed {
    background-color: var(--green-500);
}

.timeline-dot.current {
    background-color: var(--blue-500);
}

.timeline-dot.pending {
    background-color: var(--gray-300);
}

.timeline-content {
    flex: 1;
}

.timeline-city {
    font-weight: 600;
    color: var(--foreground);
}

.timeline-timestamp {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.timeline-current {
    background-color: var(--blue-100);
    color: var(--blue-800);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Map Styles */
.map-container {
    width: 100%;
    height: 24rem;
    background-color: var(--gray-100);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.map-placeholder {
    color: var(--gray-500);
}

#shipmentMap svg {
    width: 100%;
    height: 100%;
    background-color: var(--blue-50);
    border-radius: var(--radius);
}

/* Demo Codes */
.demo-description {
    color: var(--gray-600);
    margin-bottom: 1rem;
}

.demo-codes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.demo-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.demo-item code {
    background-color: var(--gray-100);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.demo-item code:hover {
    background-color: var(--gray-200);
}

.demo-item .demo-description {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin: 0;
}

/* Login Styles */
.login-container {
    max-width: 28rem;
    margin: 5rem auto 0;
}

.login-icon {
    width: 3rem;
    height: 3rem;
    background-color: var(--blue-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.login-icon i {
    color: var(--blue-600);
    font-size: 1.5rem;
}

.demo-credentials {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: var(--gray-50);
    border-radius: var(--radius);
}

.demo-title {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.demo-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.demo-info p {
    font-size: 0.875rem;
    margin: 0;
}

/* Admin Dashboard */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.dashboard-header h1 {
    font-size: 1.875rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.dashboard-header p {
    color: var(--gray-600);
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    gap: 0.25rem;
    background-color: var(--gray-100);
    padding: 0.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    width: fit-content;
}

.tab-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: calc(var(--radius) - 0.25rem);
    background: transparent;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

.tab-btn:hover {
    color: var(--gray-900);
}

.tab-btn.active {
    background-color: var(--background);
    color: var(--foreground);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.tab-content {
    display: block;
}

.tab-content.hidden {
    display: none;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.stat-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 600;
    color: var(--foreground);
}

.stat-icon {
    width: 2rem;
    height: 2rem;
    color: var(--blue-500);
    font-size: 2rem;
}

.stat-icon.delivered {
    color: var(--green-500);
}

.stat-icon.pending {
    color: var(--yellow-500);
}

/* Shipment List */
.shipment-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.shipment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.shipment-main {
    flex: 1;
}

.shipment-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.shipment-id {
    font-weight: 600;
    color: var(--foreground);
}

.shipment-vehicle {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.shipment-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    font-size: 0.875rem;
}

@media (min-width: 768px) {
    .shipment-details {
        grid-template-columns: repeat(3, 1fr);
    }
}

.shipment-detail {
    min-width: 0;
}

.shipment-detail-label {
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

.shipment-detail-value {
    font-weight: 600;
    color: var(--foreground);
}

.shipment-actions {
    display: flex;
    gap: 0.5rem;
}

.shipment-customer {
    text-align: right;
}

.shipment-customer-label {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

.shipment-customer-name {
    font-weight: 600;
    color: var(--foreground);
}

/* Analytics */
.analytics-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .analytics-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.chart-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chart-bar-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-bar {
    width: 8rem;
    height: 0.5rem;
    background-color: var(--gray-200);
    border-radius: 9999px;
    overflow: hidden;
}

.chart-bar-fill {
    height: 100%;
    border-radius: 9999px;
}

.chart-bar-fill.delivered {
    background-color: var(--green-500);
}

.chart-bar-fill.in-transit {
    background-color: var(--blue-500);
}

.chart-bar-fill.pending {
    background-color: var(--yellow-500);
}

.chart-count {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.routes-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.route-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background-color: var(--gray-50);
    border-radius: var(--radius);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: var(--background);
    border-radius: var(--radius);
    max-width: 42rem;
    max-height: 90vh;
    overflow-y: auto;
    margin: 1rem;
    width: 100%;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--foreground);
}

.modal-close {
    padding: 0.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--gray-500);
    border-radius: 0.25rem;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--gray-700);
}

.modal-body {
    padding: 1.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-content {
        flex-direction: column;
        height: auto;
        padding: 1rem 0;
        gap: 1rem;
    }

    .navigation {
        width: 100%;
        justify-content: center;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .search-form {
        flex-direction: column;
    }

    .form-actions {
        flex-direction: column;
    }

    .shipment-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .shipment-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .details-grid {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s infinite;
}