/* GEO Audit Styles */

/* Page Header */
.geo-page-header {
    text-align: center;
    padding: 1rem 0 2rem;
}

.geo-page-header .back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.geo-page-header .back-link:hover {
    color: var(--primary);
}

.geo-page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: var(--text);
}

.geo-page-header .subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Main Content */
.geo-main {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
}

/* Demo Warning */
.geo-demo-warning {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, rgba(245, 158, 11, 0.08) 100%);
    border: 1px solid rgba(251, 191, 36, 0.4);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: #b45309;
}

.geo-demo-warning .warning-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #f59e0b;
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.geo-error-warning {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.08) 100%);
    border-color: rgba(239, 68, 68, 0.4);
    color: #dc2626;
}

.geo-error-warning .warning-icon {
    background: #ef4444;
}

/* Form Card */
.geo-form-card {
    margin-bottom: 2rem;
}

.geo-form-card h3 {
    margin-bottom: 1.5rem;
}

.geo-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.geo-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
}

.geo-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.geo-form-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.geo-form-group input,
.geo-form-group select,
.geo-form-group textarea {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--text);
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.geo-form-group input:focus,
.geo-form-group select:focus,
.geo-form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.geo-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Submit Button */
.geo-submit {
    margin-top: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.geo-submit .btn-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Results Section */
.geo-results {
    margin-top: 2rem;
}

/* Summary Grid */
.geo-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (max-width: 900px) {
    .geo-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .geo-summary-grid {
        grid-template-columns: 1fr;
    }
}

.geo-summary-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: transform 0.2s, box-shadow 0.2s;
}

.geo-summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.geo-summary-card.opportunity {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.08) 0%, rgba(var(--primary-rgb), 0.02) 100%);
}

.geo-summary-card .summary-icon {
    font-size: 2rem;
}

.geo-summary-card .summary-content {
    display: flex;
    flex-direction: column;
}

.geo-summary-card .summary-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

.geo-summary-card .summary-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Details Card */
.geo-details-card {
    margin-bottom: 2rem;
}

.geo-details-card h3 {
    margin-bottom: 1rem;
}

.geo-table-wrapper {
    overflow-x: auto;
}

.geo-results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.geo-results-table th,
.geo-results-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.geo-results-table th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.geo-results-table tr:hover {
    background: rgba(var(--primary-rgb), 0.03);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.badge-warning {
    background: rgba(251, 191, 36, 0.15);
    color: #f59e0b;
}

.badge-muted {
    background: var(--bg-light);
    color: var(--text-muted);
}

/* Citation Domains */
.citation-domain {
    display: inline-block;
    padding: 0.2rem 0.4rem;
    margin: 0.1rem;
    font-size: 0.75rem;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
}

/* Action Badges */
.action-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
}

.action-badge.opportunity {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.2) 0%, rgba(var(--primary-rgb), 0.1) 100%);
    color: var(--primary);
}

.action-badge.success {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.action-badge.neutral {
    background: var(--bg-light);
    color: var(--text-muted);
}

/* Citation Gap Card */
.geo-gap-card {
    margin-bottom: 2rem;
}

.geo-gap-card h3 {
    margin-bottom: 0.5rem;
}

.geo-gap-intro {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.geo-gap-chart {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.gap-bar-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.gap-domain {
    width: 150px;
    flex-shrink: 0;
    font-size: 0.85rem;
    color: var(--text);
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gap-bar-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 24px;
    background: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
}

.gap-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, rgba(var(--primary-rgb), 0.7) 100%);
    border-radius: 4px;
    min-width: 4px;
    transition: width 0.5s ease;
}

.gap-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    padding-right: 0.5rem;
}

.no-data {
    color: var(--text-muted);
    font-style: italic;
}

/* Recommendations Card */
.geo-recommendations-card {
    margin-bottom: 2rem;
}

.geo-recommendations-card h3 {
    margin-bottom: 1rem;
}

.geo-recommendations {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recommendation-card {
    padding: 1.25rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    border-left: 4px solid var(--border);
}

.recommendation-card.priority-p0 {
    border-left-color: #ef4444;
}

.recommendation-card.priority-p1 {
    border-left-color: #f59e0b;
}

.recommendation-card.priority-p2 {
    border-left-color: #3b82f6;
}

.rec-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.rec-priority {
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 4px;
    background: var(--bg-light);
    color: var(--text);
}

.priority-p0 .rec-priority {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.priority-p1 .rec-priority {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.priority-p2 .rec-priority {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.rec-type {
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 4px;
    background: var(--bg-light);
    color: var(--text-muted);
    text-transform: uppercase;
}

.rec-impact {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.rec-impact.impact-high {
    color: #ef4444;
}

.rec-impact.impact-medium {
    color: #f59e0b;
}

.rec-title {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.rec-description {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Export Section */
.geo-export-section {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--bg-light);
    border-color: var(--primary);
}

/* CTA Section */
.geo-cta-section {
    text-align: center;
    padding: 2.5rem;
    background: linear-gradient(135deg, var(--card) 0%, var(--bg-light) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.geo-cta-section h3 {
    margin: 0 0 0.75rem;
    font-size: 1.5rem;
    color: var(--text);
}

.geo-cta-section p {
    margin: 0 0 1.5rem;
    color: var(--text-muted);
    font-size: 1rem;
}

.btn-cta-large {
    display: inline-block;
    padding: 1rem 2rem;
    background: #ffd700;
    color: #1a1a1a;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    border-radius: var(--radius);
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
}

.btn-cta-large:hover {
    background: #e6c200;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
    .geo-page-header h1 {
        font-size: 1.5rem;
    }

    .geo-page-header .subtitle {
        font-size: 0.95rem;
    }

    .geo-form-row {
        grid-template-columns: 1fr;
    }

    .gap-domain {
        width: 100px;
        font-size: 0.75rem;
    }

    .geo-export-section {
        flex-direction: column;
    }

    .rec-impact {
        margin-left: 0;
        width: 100%;
    }
}

/* Print Styles */
@media print {
    .geo-form-card,
    .geo-cta-section,
    .geo-export-section,
    header,
    .tool-nav {
        display: none !important;
    }

    .geo-results {
        margin-top: 0;
    }

    .result-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
