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

:root {
    --primary-color: #4a90e2;
    --primary-dark: #357abd;
    --success-color: #52c41a;
    --warning-color: #faad14;
    --danger-color: #ff4d4f;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --border-color: #e8e8e8;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.12);
    --warm-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--warm-gradient);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-color);
    line-height: 1.7;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    padding: 20px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
    font-weight: 500;
    margin-bottom: 12px;
}

.welcome-text {
    font-size: 1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

main {
    margin-bottom: 40px;
}

.search-card,
.results-card,
.error-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.3s ease;
}

.search-card:hover {
    box-shadow: var(--shadow-hover);
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    font-family: inherit;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 14px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-family: inherit;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.results-card {
    animation: slideIn 0.3s ease;
}

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

.result-header {
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.result-header.protected {
    background: linear-gradient(135deg, #52c41a 0%, #73d13d 100%);
    color: white;
}

.result-header.not-protected {
    background: linear-gradient(135deg, #faad14 0%, #ffc53d 100%);
    color: white;
}

.result-header.unknown {
    background: linear-gradient(135deg, #4a90e2 0%, #6ba3e8 100%);
    color: white;
}

.result-header h2 {
    font-size: 1.8rem;
    margin: 0;
}

.result-body {
    padding: 10px 0;
}

.result-message {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-color);
}

.result-details {
    background: var(--bg-color);
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.detail-item {
    margin-bottom: 12px;
    font-size: 1rem;
}

.detail-item strong {
    color: var(--text-color);
    margin-right: 8px;
}

.detail-explanation {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 0.95rem;
}

.detail-explanation ul {
    margin-top: 10px;
    margin-left: 20px;
}

.detail-explanation li {
    margin-bottom: 6px;
}

.error-card {
    background: #fff3cd;
    border: 2px solid #ffc107;
    color: #856404;
}

.error-card #errorContent {
    font-weight: 600;
}

footer {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.disclaimer,
.resources {
    margin-bottom: 30px;
}

.disclaimer:last-child,
.resources:last-child {
    margin-bottom: 0;
}

footer h3 {
    color: var(--text-color);
    margin-bottom: 12px;
    font-size: 1.2rem;
}

footer p {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.7;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

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

footer ul {
    list-style: none;
    padding-left: 0;
}

footer ul li {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

footer ul li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

/* Trust Indicators */
.trust-indicators {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: 25px;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
}

.trust-icon {
    font-size: 1.2rem;
}

.trust-text {
    white-space: nowrap;
}

/* Help Text */
.help-text {
    display: block;
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
}

/* Info Card */
.info-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
}

.info-card h3 {
    color: var(--text-color);
    margin-bottom: 12px;
    font-size: 1.2rem;
}

.info-card p {
    color: var(--text-light);
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.info-card p:last-child {
    margin-bottom: 0;
}

.info-note {
    background: #e6f7ff;
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--text-color);
}

/* Next Steps */
.next-steps {
    margin-top: 20px;
    padding: 16px;
    background: #f0f9ff;
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.next-steps strong {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
}

.next-steps p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Footer Sections */
.data-source {
    background: #f0f9ff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
}

.data-source h3 {
    color: var(--text-color);
    margin-bottom: 10px;
}

.data-source p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.resources-intro {
    margin-bottom: 12px;
    color: var(--text-light);
    font-size: 0.9rem;
}

.contact-note {
    margin-top: 30px;
    padding: 20px;
    background: #fff7e6;
    border-radius: 8px;
    text-align: center;
    border: 2px dashed #ffd591;
}

.contact-note p {
    color: var(--text-color);
    margin: 0;
    font-size: 0.95rem;
}

/* Address Validation Messages */
.address-validation {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.validation-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 12px 16px;
    border-radius: 8px;
}

.validation-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px 16px;
    border-radius: 8px;
}

.validation-error p {
    margin: 8px 0 0 0;
    font-size: 0.85rem;
}

.validation-suggestions {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 16px;
    border-radius: 8px;
}

.validation-suggestions strong {
    display: block;
    margin-bottom: 12px;
}

.usps-suggestions {
    list-style: none;
    padding: 0;
    margin: 12px 0 0 0;
}

.usps-suggestion {
    background: white;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.usps-suggestion strong {
    flex: 1;
    margin: 0;
    font-size: 0.95rem;
}

.btn-use-address {
    padding: 6px 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.btn-use-address:hover {
    background: var(--primary-dark);
}

/* Address Autocomplete Suggestions */
.address-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    margin-top: 4px;
    z-index: 1000;
}

/* Ensure form-group has relative positioning for absolute dropdown */
.form-group {
    position: relative;
}

.loading-suggestions {
    padding: 12px 16px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
    color: var(--text-light);
    font-size: 0.9rem;
    text-align: center;
    animation: pulse 1.5s ease-in-out infinite;
}

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

.suggestions-list {
    list-style: none;
    padding: 0;
    margin: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 250px;
    overflow-y: auto;
    position: relative;
    width: 100%;
}

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--bg-color);
    transition: background-color 0.2s ease;
    font-size: 0.95rem;
    color: var(--text-color);
}

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

.suggestion-item:hover,
.suggestion-item.selected {
    background-color: var(--bg-color);
    color: var(--primary-color);
}

.suggestion-item:first-child {
    border-radius: 8px 8px 0 0;
}

.suggestion-item:last-child {
    border-radius: 0 0 8px 8px;
}

/* Hide browser autocomplete dropdown when our suggestions are shown */
input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px white inset !important;
}

/* Result Header Updates */
.result-header.protected h2 {
    font-size: 1.6rem;
}

.result-header.not-protected h2 {
    font-size: 1.6rem;
}

.result-header.unknown h2 {
    font-size: 1.6rem;
}

@media (max-width: 600px) {
    header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }

    .welcome-text {
        font-size: 0.9rem;
    }
    
    .trust-indicators {
        flex-direction: column;
        gap: 10px;
    }

    .trust-item {
        justify-content: center;
    }
    
    .search-card,
    .results-card,
    .error-card,
    footer {
        padding: 20px;
    }
    
    .result-header h2 {
        font-size: 1.3rem;
    }

    .info-card {
        padding: 20px;
    }
}

