/* Design System */
:root {
    /* Core Colors */
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --text: #f8fafc;
    --text-secondary: #94a3b8;
    --border: var(--surface-light);
    
    /* Status Colors */
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    
    /* Effects */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 20px rgba(0, 0, 0, 0.15);
    --transition: 200ms ease;
}

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

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
/* Dark Mode Styles */
.dark {
    --background: #0f172a;
    --surface: #1e293b;
    --text: #f8fafc;
}
/* NAVBAR STYLING */
.navbar {
    background: var(--surface);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between; /* Keeps logo on left, toggle on right */
    align-items: center;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    width: 28px;
    height: 28px;
    color: var(--text);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 200ms ease-in-out;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .nav-content {
        padding: 0 1rem;
    }

    .logo-text {
        font-size: 1.25rem;
    }

    .theme-toggle {
        padding: 0.3rem;
    }
}
/* 📦 Stats Grid */
.stats-grid {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    padding: 1rem;
    margin-bottom: 1rem;
    max-width: 1000px;
    margin: 0 auto;
}

/* 🔹 Individual Stat Card */
.stat-card {
    background: var(--surface);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    min-width: 140px;
    flex: 1;
    border: 1px solid var(--border);
    transition: all 0.2s ease-in-out;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* 🔢 Stat Content */
.stat-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

/* 📌 Label */
.stat-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* 🔢 Value */
.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

/* 📱 Mobile Optimizations */
@media (max-width: 768px) {
    .stats-grid {
        flex-direction: column;
        gap: 0.8rem;
        align-items: center;
    }

    .stat-card {
        width: 100%;
        text-align: left;
        padding: 1rem;
    }

    .stat-content {
        flex-direction: row;
        justify-content: space-between;
    }
}


/* Quick Add Section */
.quick-add-section {
    max-width: 900px;
    margin: 6rem auto 4rem;
    padding: 0 2rem;
    text-align: center;
}

.quick-add-section h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    -webkit-background-clip: text;
    color: transparent;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.subtitle {
    font-size: 1.125rem;
    color: #94a3b8;
    margin-bottom: 3rem;
}

/* Form Container */
.quick-add-form {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(16px);
    box-shadow: 
        0 4px 24px rgba(0, 0, 0, 0.2),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Input Group Layout */.input-group {
    display: flex;
    align-items: center; /* Ensures all inputs and buttons align properly */
    gap: 1rem;
    max-width: 900px;
    margin: 0 auto;
}

/* Tracking Input */
.tracking-input-wrapper {
    flex: 2;
    position: relative;
}

.tracking-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
    color: #fff;
    transition: all 0.2s ease;
}

.tracking-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.tracking-input::placeholder {
    color: #64748b;
}

/* Auto-detect Carrier Animation */
.auto-detect-carrier {
    position: absolute;
    left: 0;
    bottom: -2rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #94a3b8;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.auto-detect-carrier.active {
    opacity: 1;
    transform: translateY(0);
}

.detection-dots {
    display: flex;
    gap: 4px;
}

.detection-dots span {
    width: 4px;
    height: 4px;
    background: currentColor;
    border-radius: 50%;
    animation: pulse 1.4s infinite;
    opacity: 0.6;
}

.detection-dots span:nth-child(2) { animation-delay: 0.2s; }
.detection-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.2); opacity: 1; }
}

/* Carrier Select */
.carrier-select-wrapper {
    flex: 1;
    position: relative;
}

#carrierSelect {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem 3rem 1rem 1.25rem;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    appearance: none;
    transition: all 0.2s ease;
}

#carrierSelect:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.carrier-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    width: 20px;
    height: 20px;
    opacity: 0.6;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

/* Track Button */
.track-button {
    padding: 1rem 2rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    min-width: 160px;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
    flex-shrink: 0; /* Prevents button from resizing */
}

.track-button:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px rgba(37, 99, 235, 0.3);
}

.button-text {
    position: relative;
    z-index: 1;
}

.button-loader {
    position: absolute;
    inset: 0;
    background: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.track-button.loading .button-text {
    opacity: 0;
}

.track-button.loading .button-loader {
    opacity: 1;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .quick-add-section {
        padding: 0 1rem;
        margin: 4rem auto 3rem;
    }

    .quick-add-form {
        padding: 1.5rem;
    }

    .input-group {
        flex-direction: column;
        gap: 1rem;
    }

    .tracking-input-wrapper,
    .carrier-select-wrapper,
    .track-button {
        width: 100%;
    }

    .auto-detect-carrier {
        bottom: -1.5rem;
    }
}
/* Paste Animation */
@keyframes pasteSuccess {
    0% { transform: scale(1); }
    50% { 
        transform: scale(1.02);
        border-color: var(--success);
    }
    100% { transform: scale(1); }
}

.tracking-input.paste-success {
    animation: pasteSuccess 0.4s ease;
}

/* Carrier Auto-detection */
.auto-detect-carrier {
    position: absolute;
    top: 100%;
    left: 0;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    opacity: 0;
    transform: translateY(-10px);
    transition: all var(--transition);
}

.auto-detect-carrier.active {
    opacity: 1;
    transform: translateY(4px);
}

.detection-dots span {
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    margin: 0 2px;
    animation: dotPulse 1s infinite;
}

.detection-dots span:nth-child(2) { animation-delay: 0.2s; }
.detection-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
    0%, 100% { transform: translateY(0); opacity: 0.3; }
    50% { transform: translateY(-4px); opacity: 1; }
}

/* Enhanced Carrier Select */
.carrier-select-wrapper {
    position: relative;
    flex: 1;
}

select {
    width: 100%;
    padding: 1rem 3rem 1rem 1.5rem;
    font-size: 1.125rem;
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    appearance: none;
    cursor: pointer;
    transition: all var(--transition);
}

.carrier-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition);
}

/* Enhanced Track Button */
.track-button {
    position: relative;
    padding: 1rem 2rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    min-width: 160px;
    overflow: hidden;
}

.track-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.button-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: opacity var(--transition);
}

.button-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: inherit;
    opacity: 0;
    transition: opacity var(--transition);
}

.track-button.loading .button-text { opacity: 0; }
.track-button.loading .button-loader { opacity: 1; }

.search-bar {
    position: relative;
    flex: 1;
    min-width: 300px;
}

.search-bar input {
    width: 100%;
    padding: 0.85rem 1.2rem 0.85rem 2.8rem; /* Extra padding for search icon */
    font-size: 1rem;
    border-radius: 8px;
    background: var(--surface-light);
    color: var(--text);
    border: 1px solid var(--border);
}

.search-bar svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none; /* Prevents accidental clicks */
}

/* 📦 Package Grid Layout Fix */
.package-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.2rem; /* More breathing room */
    margin-top: 1rem;
}

/* 📦 Individual Package Styling */
.package-card {
    background: var(--surface-light);
    border-radius: 10px;
    padding: 1.2rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    border: 1px solid var(--border);
}

/* 🎨 Improve Hover Effects */
.package-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.2);
}

/* 🔹 Status Label Fix */
.status-label {
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    display: inline-block;
    font-size: 0.9rem;
}

.status-label[data-status="in-transit"] {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.status-label[data-status="out-for-delivery"] {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.status-label[data-status="tracking-created"] {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}
/* 📌 Tutorial Overlay - Dim Background */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2); /* Lighter blur */
    backdrop-filter: blur(.3px);
    z-index: 998;
    transition: opacity 0.3s ease-in-out;
}
.tutorial-tooltip {
    position: absolute;
    background: var(--surface);
    color: var(--text);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    font-size: 0.9rem;
    text-align: center;
    max-width: 260px;
    z-index: 1001;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    border: 1px solid var(--border);
}

/* ✅ Show Tooltip */
.tutorial-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

/* 🎯 Navigation Buttons - Better Layout */
.tutorial-buttons {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 5rem;
}

/* 🔵 Next Button */
.tutorial-button {
    background: var(--primary);
    color: white;
    padding: 0.7rem 1.4rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s ease-in-out, transform 0.1s ease-in-out;
    box-shadow: var(--shadow-sm);
}

.tutorial-button:hover {
    background: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* ❌ Skip Button */
.tutorial-skip {
    background: var(--error);
    color: white;
    padding: 0.7rem 1.4rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease-in-out, transform 0.1s ease-in-out;
    box-shadow: var(--shadow-sm);
}

.tutorial-skip:hover {
    background: #dc2626;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* 🟦 Mobile Optimizations */
@media (max-width: 768px) {
    .tutorial-tooltip {
        font-size: 0.9rem;
        max-width: 260px;
    }

    .tutorial-buttons {
        flex-direction: row;
        gap: 0.5rem;
    }

    .tutorial-button, .tutorial-skip {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
        border-radius: 8px;
    }
}



/* Notification System */
.notification-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 1000;
}

.notification {
    background: var(--surface);
    color: var(--text);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease-out;
    border-left: 4px solid var(--primary);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .input-group {
        flex-direction: column;
        gap: 1rem;
    }

    .tracking-input-wrapper,
    .carrier-select-wrapper,
    .track-button {
        width: 100%;
    }

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

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

    .notification-container {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
}.no-packages-message {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: 1.5rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}.dark {
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --text: #f8fafc;
    --text-secondary: #94a3b8;
    --border: var(--surface-light);
}

.dark input, .dark select {
    background: var(--surface-light);
    border: 1px solid var(--border);
    color: var(--text);
}

.dark .search-bar input {
    background: var(--surface-light);
    color: var(--text);
}

.dark .package-card {
    background: var(--surface);
    border: 1px solid var(--border);



}
/* 📌 UX Class Project Popup */
.project-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--surface);
    color: var(--text);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    max-width: 90%;
    width: 400px;
    text-align: center;
    z-index: 1002;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.project-popup h2 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.project-popup p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.popup-close {
    background: var(--primary);
    color: white;
    padding: 0.7rem 1.2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease-in-out;
    box-shadow: var(--shadow-sm);
}

.popup-close:hover {
    background: var(--primary-light);
    box-shadow: var(--shadow-md);
}

/* 🎯 Exit Animation */
.fade-out {
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

/* 📱 Mobile Optimization */
@media (max-width: 480px) {
    .project-popup {
        width: 90%;
        padding: 1.2rem;
    }
}

/* 🔹 Fix Search Bar Styling */
.search-bar {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.search-bar input {
    width: 100%;
    padding: 0.85rem 1.2rem 0.85rem 2.8rem;
    font-size: 1rem;
    border-radius: 8px;
    background: var(--surface-light);
    color: var(--text);
    border: 1px solid var(--border);
    transition: border 0.2s ease-in-out;
}

.search-bar input:focus {
    border-color: var(--primary-light);
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.search-bar svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

/* 🔹 Fix Stats Grid Alignment */
.stats-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.2rem;
    padding: 1rem;
    margin-bottom: 1rem;
    max-width: 1000px;
    margin: 0 auto;
}

/* 🔹 Ensure Input Fields Look Consistent */
input, select {
    padding: 0.8rem;
    font-size: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    transition: border 0.2s ease-in-out;
}

input:focus, select:focus {
    border-color: var(--primary-light);
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* 🔹 Fix First-Time User Popup */
.project-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--surface);
    color: var(--text);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    max-width: 90%;
    width: 400px;
    text-align: center;
    z-index: 1002;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.project-popup h2 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.project-popup p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.popup-close {
    background: var(--primary);
    color: white;
    padding: 0.7rem 1.2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease-in-out;
    box-shadow: var(--shadow-sm);
}

.popup-close:hover {
    background: var(--primary-light);
    box-shadow: var(--shadow-md);
}

