/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #003366;
    --secondary-color: #0066cc;
    --warning-color: #ff6600;
    --success-color: #006600;
    --error-color: #cc0000;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-color: #333333;
    --border-color: #cccccc;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 8px rgba(0,0,0,0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

/* Typography */
h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.subtitle {
    font-size: 1rem;
    color: #666;
    margin-bottom: 1.5rem;
}

/* Container */
.disclaimer-container,
.calculator-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Disclaimer Page */
.disclaimer-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
}

.disclaimer-box {
    margin-bottom: 2rem;
}

.warning-section {
    background: #fff3cd;
    border-left: 4px solid var(--warning-color);
    padding: 1rem;
    margin: 1.5rem 0;
}

.warning-section ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin: 1.5rem 0;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 0.25rem;
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
}

.button-section {
    margin-top: 2rem;
}

.help-text {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #666;
}

.resources-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.resources-section ul {
    list-style: none;
    margin-top: 0.5rem;
}

.resources-section li {
    margin: 0.5rem 0;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--secondary-color);
}

.btn-primary:disabled {
    background-color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-primary:focus {
    outline: 3px solid var(--secondary-color);
    outline-offset: 2px;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #5a6268;
}

.btn-secondary:disabled {
    background-color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-secondary:focus {
    outline: 3px solid #5a6268;
    outline-offset: 2px;
}

/* Sections */
.section {
    background: var(--card-bg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.tab-button {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    color: #666;
    transition: all 0.2s;
}

.tab-button:hover {
    color: var(--primary-color);
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

.tab-button:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Input Groups */
.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.input-group input[type="text"],
.input-group input[type="number"],
.input-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}

.input-group input:focus,
.input-group select:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

.input-group input[type="radio"] {
    margin-right: 0.5rem;
    margin-left: 1rem;
}

/* Address Suggestions */
#address-input-group {
    position: relative;
}

.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    width: 100%;
    z-index: 100;
    box-shadow: var(--shadow-lg);
    margin-top: -1px;
}

.suggestion-item {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
}

.suggestion-item:hover,
.suggestion-item[aria-selected="true"] {
    background-color: #f0f0f0;
}

.suggestion-item:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: -2px;
}

/* Results Boxes */
.results-box,
.info-box {
    background: #f9f9f9;
    border-left: 4px solid var(--secondary-color);
    padding: 1.5rem;
    margin: 1rem 0;
    border-radius: 4px;
}

.results-box h3,
.info-box h3 {
    margin-top: 0;
}

/* Appeals section spacing */
.appeals-section h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.appeals-section p {
    margin-bottom: 1rem;
}

.appeals-section ul {
    margin-left: 1.5rem;
    margin-bottom: 1.25rem;
}

.appeals-section li {
    margin-bottom: 0.5rem;
}

.calculation-step {
    margin: 1rem 0;
    padding: 1rem;
    background: white;
    border-radius: 4px;
}

.calculation-formula {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    color: var(--primary-color);
    margin: 0.5rem 0;
}

.final-estimate {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 1rem 0;
    padding: 1rem;
    background: white;
    border-radius: 4px;
    text-align: center;
}

/* Warning Banner */
.warning-banner {
    background: #fff3cd;
    border-left: 4px solid var(--warning-color);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

/* Exemptions Display */
.exemption-warning {
    background: #fff3cd;
    border-left: 4px solid var(--warning-color);
    padding: 1rem;
    margin: 1rem 0;
}

/* Exemption Flags */
.exemption-flags-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.exemption-flag {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    border-left: 4px solid;
    background: #f8f9fa;
}

.exemption-flag.mosquito {
    border-left-color: #17a2b8;
    background: #e7f3f5;
}

.exemption-flag.senior {
    border-left-color: #0066cc;
    background: #e6f2ff;
}

.flag-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.flag-text {
    font-weight: 500;
    color: var(--text-color);
}

.exemption-explanation {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: #666;
}

.exemption-explanation p {
    margin: 0.5rem 0;
}

.exemption-explanation a {
    color: var(--secondary-color);
    text-decoration: none;
}

.exemption-explanation a:hover {
    text-decoration: underline;
}

/* Collapsible Sections */
.collapsible-header {
    width: 100%;
    background: none;
    border: none;
    padding: 1rem;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.25rem;
    color: var(--primary-color);
}

.collapsible-header:hover {
    background: #f0f0f0;
}

.collapsible-header:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

.collapsible-content {
    display: none;
    padding: 0 1rem 1rem 1rem;
}

.collapsible-content.active {
    display: block;
}

.expand-icon {
    transition: transform 0.2s;
}

.collapsible-header[aria-expanded="true"] .expand-icon {
    transform: rotate(180deg);
}

/* Footer */
footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
    text-align: center;
    font-size: 0.875rem;
    color: #666;
}

footer a {
    color: var(--secondary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .disclaimer-container,
    .calculator-container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-button {
        width: 100%;
        text-align: left;
    }
    
    .final-estimate {
        font-size: 1.5rem;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Print Styles */
@media print {
    .btn-primary,
    .tab-button,
    .collapsible-header {
        display: none;
    }
    
    .tab-content,
    .collapsible-content {
        display: block !important;
    }
}
