/*
 * File: style.css
 * Date: May 23, 2026
 * Description: Stylesheet for the Edmonton Property Assessment app.
 * Updated to balance a vibrant, colorful desktop framing with a clean mobile view.
*/

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    /* Clean, high-contrast mobile gradient fallback */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    margin: 0;
}

/* Desktop Enhancement Media Query */
@media (min-width: 992px) {
    body {
        /* Rich, immersive deep royal and midnight indigo background split */
        background: radial-gradient(circle at top right, #3c4baf 0%, #1a1c4b 100%);
        background-attachment: fixed;
    }
    
    .card {
        /* Frosted, floating elevated card aesthetics for wide viewports */
        border-top: 6px solid #667eea;
        position: relative;
        box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.1) !important;
    }

    /* Subtle decorative ambient glow accents beneath the card container */
    .card::before {
        content: "";
        position: absolute;
        top: -10%;
        left: -10%;
        width: 120%;
        height: 120%;
        background: radial-gradient(circle, rgba(102,126,234,0.15) 0%, transparent 70%);
        z-index: -1;
        pointer-events: none;
    }
}

.card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 28px;
    width: 100%;
    max-width: 750px;
}

h1 {
    text-align: center;
    margin: 0 0 4px 0;
    color: #1a252f;
    font-size: 26px;
}

.subtitle {
    text-align: center;
    color: #555555;
    margin-bottom: 28px;
    font-size: 13px;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #111111;
}

input,
button {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border-radius: 8px;
}

input {
    border: 2px solid #b3bcbf;
    color: #111111;
    transition: border-color 0.2s;
    background: white;
}

input:focus {
    outline: none;
    border-color: #667eea;
}

button {
    background: #2c3e50;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

button:hover {
    background: #1a252f;
}

button:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.autocomplete-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.autocomplete-item:hover {
    background: #f0f2f5;
}

.autocomplete-item strong {
    color: #111111;
}

.years-section {
    background: #f1f3f5;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
}

.years-section label.section-label {
    font-weight: 600;
    margin-bottom: 12px;
    color: #111111;
    display: block;
}

.years-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(75px, auto));
    gap: 10px;
    margin-top: 10px;
}

.year-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.year-checkbox input {
    width: auto;
    margin: 0;
}

.year-checkbox label {
    margin: 0;
    font-weight: 600;
    color: #2c3e50;
    cursor: pointer;
}

.select-all {
    margin-top: 12px;
    display: flex;
    gap: 10px;
}

.select-all button {
    width: auto;
    padding: 6px 14px;
    font-size: 12px;
    background: #7f8c8d;
}

.select-all button:first-child {
    background: #2c3e50;
}

h3 {
    text-align: center;
    margin: 20px 0 10px;
    color: #111111;
}

.map-link {
    font-size: 14px;
    margin-left: 12px;
    text-decoration: none;
    background: #e2e8f0;
    padding: 4px 12px;
    border-radius: 20px;
    color: #1a252f;
    font-weight: 500;
    display: inline-block;
}

.map-link:hover {
    background: #cbd5e1;
    text-decoration: none;
}

.zoning-section {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    color: #1e1b4b;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: center;
}

.permit-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-left: 4px solid #475569;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 6px;
}

.permit-card strong {
    color: #0f172a;
}

.property-summary {
    background: #f1f5f9;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 10px;
    border: 1px solid #cbd5e1;
}

.summary-item {
    font-size: 14px;
    color: #0f172a;
}

.summary-item strong {
    color: #4f46e5;
}

.table-container {
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    width: 100%;
    margin-top: 20px;
    display: none;
    border-radius: 8px;
    overflow: hidden;
}

th {
    background: #2c3e50;
    color: white;
    padding: 12px;
    text-align: left;
}

td {
    border: 1px solid #cbd5e1;
    padding: 12px;
}

.year-col {
    background: #f1f5f9;
    font-weight: bold;
    text-align: center;
    width: 80px;
    color: #0f172a;
}

.val {
    font-weight: bold;
    font-size: 16px;
    color: #0f172a;
}

.tax {
    font-size: 14px;
    color: #b45309;
    font-weight: 500;
    margin-top: 6px;
}

.trend {
    font-size: 12px;
    margin-left: 8px;
    font-weight: 600;
}

.positive {
    color: #15803d;
}

.negative {
    color: #b91c1c;
}

.note {
    font-size: 13px;
    color: #334155;
    margin-top: 20px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    display: none;
    border-left: 4px solid #667eea;
}

#error-msg {
    color: #991b1b;
    text-align: center;
    margin-top: 16px;
    padding: 12px;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    font-weight: 500;
    border-radius: 8px;
    display: none;
}

#loading {
    text-align: center;
    color: #4f46e5;
    display: none;
    margin-top: 20px;
    font-weight: 600;
}

#back-btn {
    background: #64748b;
    margin-top: 20px;
    display: none;
}

#back-btn:hover {
    background: #475569;
}

.loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.auto-hint {
    font-size: 12px;
    color: #4f46e5;
    margin-top: 5px;
    padding-left: 4px;
    font-weight: 500;
}

/* Prevent password manager interference */
input::-webkit-credentials-auto-fill-button,
input::-webkit-contacts-auto-fill-button,
input::-webkit-credit-card-auto-fill-button {
    display: none !important;
    visibility: hidden;
    pointer-events: none;
}
