* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 300;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.content {
    padding: 40px;
}

.location-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    border: 2px solid #e9ecef;
}

.section-title {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.location-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    align-items: end;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    box-sizing: border-box;
}

.input-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.button-row {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 20px;
}

.btn {
    flex: 1;
    max-width: 200px;
    padding: 15px 25px;
    border: none;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-location {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    display: inline-block; /* Show by default instead of hidden */
    position: relative;
}

.btn-location:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
}

.btn-location.disabled {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-location.disabled:hover {
    transform: none;
    box-shadow: none;
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

/* Tooltip for location button */
.btn-location[title] {
    position: relative;
}

.btn-location[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

.btn-scan {
    background: linear-gradient(135deg, #11998e, #38ef7d);
    color: white;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.2);
}

.loading {
    display: none;
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.results-section {
    margin-top: 30px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.results-section.show {
    opacity: 1;
    transform: translateY(0);
}

.tax-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.tax-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    border-left: 5px solid #3498db;
    transition: all 0.3s ease;
}

.tax-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.12);
}

.tax-card.special {
    border-left-color: #e74c3c;
}

.tax-card.county {
    border-left-color: #f39c12;
}

.tax-card.local {
    border-left-color: #9b59b6;
}

.tax-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.tax-rate {
    font-size: 1.8rem;
    font-weight: 700;
    color: #27ae60;
    margin-bottom: 15px;
}

.tax-description {
    color: #7f8c8d;
    margin-bottom: 10px;
    line-height: 1.4;
}

.tax-applies-to {
    background: #ecf0f1;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #34495e;
}

.export-section {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    text-align: center;
}

.export-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.btn-export {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 160px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-json {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    color: white;
}

.btn-json:hover {
    background: linear-gradient(135deg, #0984e3, #74b9ff);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(116, 185, 255, 0.3);
}

.btn-csv {
    background: linear-gradient(135deg, #00b894, #00a085);
    color: white;
}

.btn-csv:hover {
    background: linear-gradient(135deg, #00a085, #00b894);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 184, 148, 0.3);
}

.btn-export .icon {
    font-size: 18px;
    margin-left: auto;
}

.status-message {
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-weight: 500;
}

.status-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Searchable input styling */
.select-wrapper {
    position: relative;
}

.searchable-input {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
    cursor: pointer;
}

.searchable-input:hover {
    border-color: #3498db;
}

.searchable-input:focus {
    cursor: text;
}

@media (max-width: 768px) {
    .location-inputs {
        grid-template-columns: 1fr;
    }

    .button-row {
        flex-direction: column;
    }

    .btn {
        max-width: none;
    }

    .header h1 {
        font-size: 2rem;
    }

    .content {
        padding: 20px;
    }

    .export-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-export {
        width: 100%;
        max-width: 300px;
    }
}

/* Data Management Section */
.data-management-section {
    margin-top: 40px;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 15px;
    border: 2px solid #e9ecef;
}

.data-info-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    border-left: 5px solid #17a2b8;
}

.data-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f3f4;
}

.data-info-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.3rem;
}

.freshness-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    background: #f8f9fa;
    font-size: 0.9rem;
    font-weight: 600;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #6c757d;
    animation: pulse 2s infinite;
}

.freshness-indicator.fresh .status-dot {
    background: #28a745;
}

.freshness-indicator.stale .status-dot {
    background: #ffc107;
}

.freshness-indicator.outdated .status-dot {
    background: #dc3545;
}

.freshness-indicator.fresh {
    background: #d4edda;
    color: #155724;
}

.freshness-indicator.stale {
    background: #fff3cd;
    color: #856404;
}

.freshness-indicator.outdated {
    background: #f8d7da;
    color: #721c24;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.data-info-content {
    margin-bottom: 25px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f1f3f4;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .label {
    font-weight: 600;
    color: #495057;
    font-size: 0.95rem;
}

.info-row .value {
    color: #2c3e50;
    font-weight: 500;
    font-size: 0.95rem;
}

.data-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-refresh {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-refresh:hover {
    background: linear-gradient(135deg, #138496, #17a2b8);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(23, 162, 184, 0.3);
}

.btn-refresh:active {
    transform: translateY(0);
}

.btn-history {
    background: linear-gradient(135deg, #6f42c1, #5a32a3);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-history:hover {
    background: linear-gradient(135deg, #5a32a3, #6f42c1);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(111, 66, 193, 0.3);
}

/* Update History Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f3f4;
}

.modal-header h2 {
    margin: 0;
    color: #2c3e50;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #000;
}

.update-history-list {
    list-style: none;
    padding: 0;
}

.update-history-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 4px solid #17a2b8;
}

.update-history-item.success {
    border-left-color: #28a745;
}

.update-history-item.failed {
    border-left-color: #dc3545;
}

.update-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.update-item-title {
    font-weight: 600;
    color: #2c3e50;
}

.update-item-date {
    font-size: 0.85rem;
    color: #6c757d;
}

.update-item-details {
    font-size: 0.9rem;
    color: #495057;
}

@media (max-width: 768px) {
    .data-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-refresh,
    .btn-history {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 20px;
    }
    
    .data-info-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* Comprehensive Tax Results Styles */
.tax-results {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.location-header h3 {
    color: #2c3e50;
    margin: 0 0 20px 0;
    font-size: 1.4em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.location-header i {
    color: #e74c3c;
}

.total-rate {
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.rate-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.rate-number {
    font-size: 3.5em;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.rate-label {
    font-size: 1.1em;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.rate-breakdown {
    margin-bottom: 24px;
}

.rate-breakdown h4 {
    color: #2c3e50;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 4px solid;
    background: #f8f9fa;
}

.breakdown-item.state {
    border-left-color: #3498db;
    background: linear-gradient(90deg, rgba(52, 152, 219, 0.1) 0%, rgba(52, 152, 219, 0.05) 100%);
}

.breakdown-item.county {
    border-left-color: #e74c3c;
    background: linear-gradient(90deg, rgba(231, 76, 60, 0.1) 0%, rgba(231, 76, 60, 0.05) 100%);
}

.breakdown-item.city {
    border-left-color: #f39c12;
    background: linear-gradient(90deg, rgba(243, 156, 18, 0.1) 0%, rgba(243, 156, 18, 0.05) 100%);
}

.breakdown-item.special {
    border-left-color: #9b59b6;
    background: linear-gradient(90deg, rgba(155, 89, 182, 0.1) 0%, rgba(155, 89, 182, 0.05) 100%);
}

.breakdown-item.transit {
    border-left-color: #1abc9c;
    background: linear-gradient(90deg, rgba(26, 188, 156, 0.1) 0%, rgba(26, 188, 156, 0.05) 100%);
}

.breakdown-label {
    font-weight: 500;
    color: #2c3e50;
}

.breakdown-rate {
    font-weight: bold;
    font-size: 1.1em;
    color: #2c3e50;
}

.detailed-breakdown {
    margin-bottom: 24px;
}

.detailed-breakdown h4 {
    color: #2c3e50;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.authorities-list {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

.authority-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e9ecef;
}

.authority-item:last-child {
    border-bottom: none;
}

.authority-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.authority-name {
    font-weight: 500;
    color: #2c3e50;
}

.authority-type {
    font-size: 0.85em;
    color: #6c757d;
    text-transform: capitalize;
}

.authority-rate {
    font-weight: bold;
    color: #495057;
    font-size: 1.1em;
}

.data-source {
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid #e9ecef;
    color: #6c757d;
}

.data-source i {
    margin-right: 6px;
}

/* Loading state for comprehensive results */
.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.loading i {
    font-size: 1.5em;
    margin-right: 8px;
}

/* Responsive design for comprehensive results */
@media (max-width: 768px) {
    .tax-results {
        padding: 16px;
        margin-top: 16px;
    }
    
    .rate-number {
        font-size: 2.5em;
    }
    
    .breakdown-grid {
        grid-template-columns: 1fr;
    }
    
    .authority-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .authority-rate {
        align-self: flex-end;
    }
} 