:root {
    --primary-color: #0056b3;
    /* Traffic Blue */
    --primary-light: #e6f0ff;
    --warning-color: #ff6b00;
    /* Warning Orange */
    --success-color: #28a745;
    --danger-color: #dc3545;
    --text-main: #1a1a1a;
    --text-sub: #666666;
    --bg-page: #f5f7fa;
    --bg-card: #ffffff;
    --radius-lg: 16px;
    --radius-md: 12px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.5;
}

.app-container {
    max-width: 480px;
    /* Mobile optimized width */
    margin: 0 auto;
    min-height: 100vh;
    background-color: var(--bg-page);
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-bottom: 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.icon-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-sub);
    padding: 0.5rem;
    cursor: pointer;
}

/* Views */
.view {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dashboard */
.hero-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2.5rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.hero-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.hero-card p {
    color: var(--text-sub);
    margin-bottom: 2rem;
}

.camera-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 86, 179, 0.3);
    transition: transform 0.2s;
    position: relative;
    z-index: 2;
}

.camera-btn:active {
    transform: scale(0.95);
}

.camera-btn i {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--primary-color);
    opacity: 0.1;
    animation: pulse 2s infinite;
    pointer-events: none;
    margin-top: 32px;
    /* Adjust for button position */
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.4;
    }

    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

/* Analyzing */
.loading-content {
    text-align: center;
    padding: 4rem 1rem;
}

.scanner {
    width: 80px;
    height: 80px;
    border: 4px solid var(--primary-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 2rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Forms & Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-sub);
    margin-bottom: 0.4rem;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.divider {
    height: 1px;
    background: #eee;
    margin: 1.5rem 0;
}

/* Buttons */
.primary-btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 0.5rem;
}

.text-btn {
    width: 100%;
    padding: 0.8rem;
    background: none;
    border: none;
    color: var(--text-sub);
    font-size: 0.9rem;
    cursor: pointer;
}

.danger-btn {
    width: 100%;
    padding: 1rem;
    background: white;
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 2rem;
}

/* Timer View */
.timer-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    border-top: 4px solid var(--primary-color);
}

.status-badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.total-fee {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.currency {
    font-size: 1.5rem;
    vertical-align: top;
    margin-right: 4px;
}

.timer-display {
    color: var(--text-sub);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    font-family: monospace;
}

.progress-info {
    display: flex;
    justify-content: space-around;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: var(--radius-md);
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-item .label {
    font-size: 0.8rem;
    color: var(--text-sub);
}

.info-item .value {
    font-weight: 600;
    color: var(--warning-color);
}

.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.action-card {
    background: var(--bg-card);
    border: none;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    color: var(--text-main);
}

.action-card i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1rem;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 400px;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.modal-actions button {
    margin: 0;
}