/* =============================================================================
   Alyosser Order Tracking — Stylesheet
   ============================================================================= */

:root {
    --primary: #1a56db;
    --primary-dark: #1544b5;
    --primary-light: #e8effd;
    --success: #16a34a;
    --success-light: #dcfce7;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --error: #dc2626;
    --error-light: #fee2e2;
    --text: #1f2937;
    --text-muted: #6b7280;
    --bg: #f9fafb;
    --card-bg: #ffffff;
    --border: #e5e7eb;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-img {
    height: 32px;
    width: auto;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.5px;
}

.nav-back {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-back:hover {
    color: var(--primary);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 40px 20px;
}

.tracker-container {
    width: 100%;
    max-width: 560px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}

.page-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 32px;
}

/* Search Form */
.search-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.search-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--card-bg);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-btn {
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: var(--primary);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s;
}

.search-btn:hover {
    background: var(--primary-dark);
}

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

/* Result Area */
.result-area {
    min-height: 0;
}

/* Order Card */
.order-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    animation: fadeIn 0.3s ease;
}

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

.order-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.order-number {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.order-number strong {
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
}

.order-status {
    font-size: 22px;
    font-weight: 700;
    margin: 12px 0 4px;
}

.order-message {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 16px;
}

.order-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 48px;
    text-align: right;
}

/* Exception styling */
.order-card.is-exception .order-status {
    color: var(--warning);
}

.order-card.is-exception .progress-fill {
    background: var(--warning);
}

.order-card.is-terminal .order-status {
    color: var(--success);
}

.order-card.is-terminal .progress-fill {
    background: var(--success);
}

/* Timeline */
.timeline-section {
    padding: 20px 24px;
}

.timeline-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.timeline-list {
    list-style: none;
    position: relative;
}

.timeline-list::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-left: 36px;
    padding-bottom: 20px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: 6px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--card-bg);
    z-index: 1;
}

.timeline-item.completed .timeline-dot {
    background: var(--success);
    border-color: var(--success);
}

.timeline-item.current .timeline-dot {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.timeline-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.timeline-item.upcoming .timeline-label {
    color: var(--text-muted);
    font-weight: 500;
}

.timeline-time {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Not Found */
.not-found {
    text-align: center;
    padding: 40px 20px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.not-found-icon {
    font-size: 40px;
    margin-bottom: 16px;
}

.not-found-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.not-found-message {
    color: var(--text-muted);
    font-size: 15px;
}

/* Error */
.error-box {
    text-align: center;
    padding: 24px;
    background: var(--error-light);
    border: 1px solid var(--error);
    border-radius: var(--radius);
    color: var(--error);
}

/* Loading */
.loading {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
}

.loading-spinner {
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mobile */
@media (max-width: 600px) {
    .nav-container {
        padding: 10px 16px;
    }

    .main-content {
        padding: 24px 16px;
    }

    .page-title {
        font-size: 24px;
    }

    .order-header,
    .timeline-section {
        padding: 16px;
    }

    .order-status {
        font-size: 20px;
    }

    .search-btn {
        width: 100%;
    }
}
