:root {
    --bg-color: #f0f7ff;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --accent-color: #1a73e8; /* Paotang Blue */
    --accent-glow: rgba(26, 115, 232, 0.4);
    --user-color: #0284c7; /* Darker blue for user */
    --gov-color: #ea580c; /* Darker orange for better contrast */
    --card-bg: rgba(255, 255, 255, 0.9);
    --card-border: rgba(255, 255, 255, 1);
    --header-gradient: linear-gradient(135deg, #0ea5e9, #1d4ed8);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Prompt', sans-serif;
}

body {
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, rgba(14, 165, 233, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(29, 78, 216, 0.1) 0px, transparent 50%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 0.5rem;
    overflow-x: hidden;
}

.app-container {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

header {
    text-align: center;
    animation: fadeInDown 0.4s ease-out;
    background: var(--header-gradient);
    padding: 1rem;
    border-radius: 1.25rem;
    color: white;
    box-shadow: 0 4px 15px rgba(29, 78, 216, 0.15);
}

header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
}

header p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    font-weight: 300;
}

/* Tabs */
.tabs-container {
    display: flex;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    border-radius: 0.75rem;
    padding: 0.2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.4rem 0.2rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn.active {
    background: white;
    color: var(--accent-color);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 4px 15px 0 rgba(0, 0, 0, 0.05);
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.input-section label {
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-align: center;
    font-weight: 600;
}

.input-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 0.75rem;
    padding: 0.5rem;
    border: 2px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-glow);
}

.input-section.user-glow .input-wrapper:focus-within {
    border-color: var(--user-color);
    box-shadow: 0 0 10px rgba(2, 132, 199, 0.3);
}

.input-section.quota-glow .input-wrapper:focus-within {
    border-color: var(--gov-color);
    box-shadow: 0 0 10px rgba(234, 88, 12, 0.3);
}

.currency-symbol {
    font-size: 2rem;
    color: var(--text-secondary);
    margin-right: 0.5rem;
}

input[type="number"] {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 2.5rem;
    font-weight: 700;
    width: 100%;
    text-align: center;
    outline: none;
    padding: 0;
}

input[type="number"]::placeholder {
    color: #cbd5e1;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.results-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.result-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
}

.result-card.primary-glow {
    border-color: rgba(26, 115, 232, 0.2);
    background: #f8fafc;
    box-shadow: 0 4px 15px 0 rgba(26, 115, 232, 0.08);
}

.card-icon {
    font-size: 2rem;
    background: #f1f5f9;
    width: 48px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 0.75rem;
    flex-shrink: 0;
}

.primary-glow .card-icon {
    background: #e0f2fe;
}

.card-content {
    flex-grow: 1;
}

.card-content h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: -0.1rem;
}

.amount-wrapper {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
}

.amount {
    font-size: 1.6rem;
    font-weight: 700;
}

.gov-pays .amount {
    color: var(--gov-color);
}

.user-pays .amount, .total-price .amount {
    color: var(--user-color);
}

.unit {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.cap-warning {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    color: var(--gov-color);
    font-size: 0.8rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
    background: rgba(234, 88, 12, 0.05);
    border: 1px solid rgba(234, 88, 12, 0.15);
    margin-top: 0.75rem;
    animation: fadeIn 0.3s ease-out;
}

.cap-warning.visible {
    display: flex;
}

/* Footer Info Section */
.app-footer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.footer-info {
    text-align: center;
    padding: 0.75rem 1rem;
}

.footer-info h4 {
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    background: #f1f5f9;
    border-radius: 0.5rem;
    padding: 0.4rem 0.2rem;
    align-items: center;
    justify-content: center;
}

.info-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin-bottom: 0.1rem;
}

.info-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-color);
}

.footer-note {
    font-size: 0.65rem;
    color: var(--gov-color);
    margin-top: 0.75rem;
    text-align: center;
}

.footer-credits {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.8;
    margin-bottom: 1rem;
}

.footer-credits p {
    margin: 0.15rem 0;
}

.privacy-note {
    font-size: 0.6rem;
    margin-top: 0.5rem !important;
    color: var(--text-secondary);
    opacity: 0.6;
}

.howto-link {
    display: inline-block;
    margin-bottom: 0.8rem;
    font-size: 0.8rem;
    color: var(--accent-color);
    text-decoration: underline;
    cursor: pointer;
    font-weight: 600;
}
.howto-link:hover {
    color: var(--user-color);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 400px;
    border-radius: 1.25rem;
    padding: 1.5rem;
    position: relative;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    color: var(--text-primary);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
}

.modal-content h3 {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.howto-section {
    margin-bottom: 1rem;
}

.howto-section h4 {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.howto-section ol {
    margin-left: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.howto-section li {
    margin-bottom: 0.2rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pop-anim {
    animation: pop 0.3s ease-out;
}
