:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #e0e7ff 0%, #f3e8ff 100%);
    /* Soft Indigo-Purple Gradient */
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
    background-attachment: fixed;
}

/* Glassmorphism Utilities */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

.glass-strong {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

.container {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

header {
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.search-box {
    display: flex;
    gap: 0.5rem;
    background: var(--card-bg);
    padding: 0.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative; /* Relative positioning for button placement */
}

/* Transparent input styling */
.search-box input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    color: var(--text-main);
    width: 100%; /* Full width */
    padding-right: 160px; /* Space for the button */
}

/* Button positioned at the end */
.search-box button {
    position: absolute;
    right: 0.5rem;
    top: 0.5rem;
    bottom: 0.5rem;
    margin: 0;
    height: auto; /* Match top/bottom */
    border-radius: 0.75rem;
    z-index: 10;
}

button {
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--primary);
    color: white;
    border: none;
}

button:hover {
    background-color: var(--primary-hover);
}

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.result-card {
    background: var(--card-bg);
    border-radius: 1.5rem;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: slideUp 0.5s ease-out;
}

.card-header {
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    color: white;
    padding: 1.5rem;
}

.vehicle-id {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.vehicle-id h2 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.vehicle-meta {
    opacity: 0.9;
    font-size: 0.9rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.card-body {
    padding: 1.5rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.info-item label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.info-item p {
    font-weight: 500;
    font-size: 1.1rem;
}

.divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 1.5rem 0;
}

.cost-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
}

.cost-row.total {
    color: var(--text-main);
    font-weight: 700;
    font-size: 1.25rem;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 2px dashed var(--border-color);
}

.card-footer {
    background-color: #f1f5f9;
    padding: 1rem 1.5rem;
    text-align: center;
}

.disclaimer {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.loading-state {
    text-align: center;
    padding: 3rem 0;
    color: var(--text-muted);
}

.loader {
    width: 48px;
    height: 48px;
    border: 5px solid #e2e8f0;
    border-bottom-color: var(--primary);
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    margin-bottom: 1rem;
}

.sub-loading {
    font-size: 0.85rem;
    margin-top: 0.5rem;
    opacity: 0.7;
}

.error-message {
    background-color: #fef2f2;
    border: 1px solid #fee2e2;
    color: var(--danger);
    padding: 1rem;
    border-radius: 0.75rem;
    text-align: center;
    font-size: 0.9rem;
}

.hidden {
    display: none;
}

.spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-bottom-color: transparent;
    border-radius: 50%;
    animation: rotation 1s linear infinite;
}

button.loading .spinner {
    display: block;
}

button.loading .btn-text {
    display: none;
}

footer {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: auto;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .vehicle-id h2 {
        font-size: 1.5rem;
    }
}

/* Navbar Styles */
.main-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.2s;
    font-size: 0.95rem;
}

.nav-link:hover {
    color: var(--primary);
}

.nav-btn {
    text-decoration: none;
    background-color: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
}

.nav-btn:hover {
    background-color: var(--primary-hover);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
    border-left: 1px solid var(--border-color);
    padding-left: 1rem;
}

.username {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

@media (max-width: 480px) {
    .main-nav {
        gap: 1rem;
        flex-direction: column;
    }

    .user-menu {
        border-left: none;
        padding-left: 0;
        flex-direction: column;
        gap: 0.5rem;
    }
}