/* Global Styles */
:root {
    --primary-color: #00349E;
    /* Bamko Blue */
    --primary-hover: #1c52b0;
    --bg-gradient-start: #f0f4fd;
    --bg-gradient-end: #dce7fa;
    --text-main: #1a1a1a;
    --text-secondary: #5f6368;
    --card-bg: rgba(255, 255, 255, 0.95);
    --shadow-color: rgba(46, 109, 220, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Lexend", sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #F8FAFC;
    background-image:
        radial-gradient(at 0% 0%, rgba(46, 109, 220, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(255, 100, 100, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(46, 109, 220, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
    position: relative;
}

/* Background Animation Removed for cleaner look */
.background-animation {
    display: none;
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Container */
.container {
    width: 100%;
    padding: 20px;
    z-index: 1;
}

/* Login Card */
.login-card {
    background: #ffffff;
    padding: 3rem 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    text-align: center;
    border: 1px solid #e2e8f0;
    max-width: 450px;
    margin: 0 auto;
}

.login-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Logo */
.logo {
    max-width: 180px;
    height: auto;
    margin-bottom: 2rem;
    display: inline-block;
}

/* Typography */
h1 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.75rem;
    letter-spacing: -0.5px;
}

p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 2.5rem;
}

p strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* Error Card */
.error-card {
    background-color: #fef2f2;
    color: #dc2626;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    font-size: 0.95rem;
    border: 1px solid #fee2e2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.error-card::before {
    content: '!';
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 20px;
    height: 20px;
    background: #dc2626;
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 12px;
}

/* Google Button Container */
.g_id_signin {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    margin-bottom: 1rem;
    min-height: 50px;
    /* Prevent layout shift */
}

/* Responsive */
@media (max-width: 480px) {
    .login-card {
        padding: 2.5rem 1.5rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    .logo {
        max-width: 150px;
    }
}

/* =========================================
   Dashboard / Calculator Styles
   ========================================= */

/* Header */
.header-actions {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.btn-logout {
    color: #dc2626;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    transition: background 0.2s;
}

.btn-logout:hover {
    background: #fef2f2;
}

/* Main Layout adjustments */
body:has(.form-grid) .container {
    max-width: 900px !important;
    /* Wider container for calculator */
}

.container h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: #1a1a1a;
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
}

.input-group input,
.input-group select {
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: "Lexend", sans-serif;
    font-size: 14px;
    transition: all 0.2s;
    background: white;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 109, 220, 0.1);
}

.input-group input:disabled {
    background: #f8fafc;
    color: #94a3b8;
}

/* Button */
.btn-calculate {
    display: block;
    width: 100%;
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-size: 17px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-top: 2rem;
    font-family: "Lexend", sans-serif;
}

.btn-calculate:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(46, 109, 220, 0.3);
}

/* Result Card */
.result-card, .card {
    background: #ffffff;
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.result-card h3,
.result-card h4 {
    color: var(--text-main);
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 0.5rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-box {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Table */
.items-table-wrapper {
    overflow-x: auto;
}

.items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.items-table th {
    text-align: left;
    padding: 1rem;
    background: #f1f5f9;
    color: var(--text-secondary);
    font-weight: 600;
}

.items-table td {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    color: var(--text-main);
}

/* Tom Select Overrides (if used) */
.ts-control {
    border-radius: 8px !important;
    padding: 0.75rem !important;
    border-color: #e2e8f0 !important;
}
.logo-text {
    text-align: center;
    margin-bottom: 20px;
}
.logo-text svg{ 
    height: 40px;
    width: auto;
}
/* Responsive adjustment for Dashboard */
@media (max-width: 768px) {
    .header-actions {
        position: static;
        margin-bottom: 1rem;
        justify-content: space-between;
    }

    body:has(.form-grid) {
        align-items: flex-start;
        padding-top: 2rem;
        height: auto;
    }
}