﻿:root {
    --primary-color: #2563eb;
    --primary-color-light: #e5ebfb;
    --primary-hover: #1d4ed8;
    --secondary-color: #334155;
    --secondary-bg: #e2e8f0;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --light-bg: #f8fafc;
    --surface-color: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --primary-shadow: rgb(29 78 216 / 25%);
    --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.08);
    --shadow-md: 0 4px 12px rgb(15 23 42 / 0.08);
    --shadow-lg: 0 12px 24px rgb(15 23 42 / 0.12);
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1.5rem;
    --max-width-reading: 720px;
}

.generator-page {
    padding: 2rem 0;
}

.generator-intro {
    text-align: center;
    margin-bottom: 3rem;
}

.generator-title {
    font-size: clamp(2.25rem, 4vw, 3rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.1;
}

.generator-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin: 0 auto 1rem;
    max-width: 860px;
}

.generator-meta {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    padding: 0;
    margin: 0;
}

.meta-chip {
    background: var(--surface-color);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    padding: 0.45rem 0.95rem;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.generator-main {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.generator-card {
    padding: 0rem 2rem;
    height: 100%;
}

.generator-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.input-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1rem;
}

.label-title {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.label-helper {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.select-input {
    width: 100%;
    padding: 1rem 1.15rem;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    font-size: 1rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
    background: var(--surface-color);
    box-shadow: inset 0 1px 2px rgb(15 23 42 / 0.04);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23334155' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 3rem;
}

.select-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.select-input:hover {
    border-color: var(--primary-color);
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.generate-btn {
    flex: 1 1 200px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    border: none;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    position: relative;
    overflow: hidden;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px rgb(37 99 235 / 0.25);
}

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

.generate-btn.loading,
.generate-btn:disabled {
    cursor: wait;
    opacity: 0.9;
}

.ghost-btn {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 0.9rem;
    padding: 0.9rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.ghost-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.status-bar {
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    line-height: 1.4;
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.status-bar svg {
    flex-shrink: 0;
}

.status-info {
    background: var(--primary-color-light);
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
}

.results-container {
    border-radius: var(--radius-md);
    padding: 2rem;
    border: 1px solid var(--border-color);
    position: relative;
}

.results-grid {
    display: grid;
    gap: 1.5rem;
}

.metrics-grid,
.units-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.metric-card,
.unit-card {
    background: var(--surface-color);
    border-radius: 1rem;
    padding: 1.25rem 1rem;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.metric-label,
.unit-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.metric-value,
.unit-value {
    font-size: clamp(1.75rem, 2.5vw, 2rem);
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.helper-panel {
    background: var(--surface-color);
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
}

.helper-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.helper-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.8rem;
}

.helper-list li {
    position: relative;
    padding-left: 1.75rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.helper-list li::before {
    content: 'âœ”';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--success-color);
    font-weight: 700;
}

.section-subtitle {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.results-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.results-beta {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
    background: rgb(37 99 235 / 0.1);
    padding: 0.35rem 0.7rem;
    border-radius: 9999px;
}

.address-display {
    background: var(--surface-color);
    border-radius: 1.15rem;
    padding: 1.75rem;
    margin-bottom: 2rem;
    text-align: center;
    border: 1px solid rgb(37 99 235 / 0.2);
    box-shadow: var(--shadow-sm);
}

.address-text {
    font-size: clamp(1.3rem, 2.5vw, 1.6rem);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.4;
    white-space: pre-line;
}

.address-caption {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    opacity: 0.5;
}

.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.copy-button {
    width: 100%;
    background: #f1f5f9;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #405063 !important;
    border: 1px solid #dde3e7;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 0.5rem;
}

.copy-button:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    transform: translateY(-1px);
}

.copy-button.copied {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff !important;
}

.tooltip {
    position: relative;
    display: inline-flex;
}

.tooltip .tooltip-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.08);
    color: var(--text-primary);
    font-weight: 700;
    border: none;
    cursor: help;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 220px;
    background-color: var(--text-primary);
    color: white;
    text-align: left;
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    position: absolute;
    z-index: 10;
    bottom: 135%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.2s ease;
    font-size: 0.875rem;
    line-height: 1.4;
}

.tooltip:hover .tooltiptext,
.tooltip:focus-within .tooltiptext {
    visibility: visible;
    opacity: 1;
}

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

.generate-btn:focus,
.ghost-btn:focus,
.copy-button:focus,
.reset-button:focus,
.select-input:focus {
    outline: 2px solid rgb(37 99 235 / 0.6);
    outline-offset: 3px;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255, 255, 255, 0.6);
    border-top: 3px solid #ffffff;
    border-radius: 9999px;
    animation: spin 1s linear infinite;
}

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

.success-animation {
    animation: successPulse 0.6s ease-in-out;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.feature-item,
.faq-item,
.use-case {
    padding: 1.25rem;
    background: #ffffff;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.feature-item {
    padding: 2.75rem;
}

.faq-item {
    box-shadow: none;
}

.feature-item h4,
.faq-item h4,
.use-case h4 {
    color: var(--primary-color);
    font-weight: 700;
}

.faq-container,
.use-cases {
    background: #f8fafc;
    border-radius: 1rem;
    padding: 1.75rem;
    border: 1px solid #e2e8f0;
}

.seo-section {
    padding: 2rem 0;
}

.step-list {
    counter-reset: steps;
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    display: grid;
    gap: 1rem;
}

.step-list li {
    counter-increment: steps;
    position: relative;
    padding-left: 2.5rem;
    color: var(--text-secondary);
    font-size: 1rem;
}

.step-list li::before {
    content: counter(steps);
    position: absolute;
    left: 0;
    top: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    background: var(--primary-color);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

@media (max-width: 991px) {
    .generator-main {
        padding: 1.5rem;
    }

    .generator-card {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .generator-page {
        padding: 2.5rem 0 3rem;
    }

    .generator-meta {
        gap: 0.5rem;
    }

    .generator-main {
        border-radius: 1.25rem;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .ghost-btn {
        width: 100%;
        justify-content: center;
    }

    .result-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .metrics-grid,
    .units-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}