/* ============================================================================
   NAPCHKR - Business Listing Consistency Checker
   Modern, Bold Design (Matching WEBCHKR)
   WCAG AA Compliant Colors
   ============================================================================ */

:root {
    /* Brand Colors - Bold Red & Black */
    --primary-red: #DC2626;        /* WCAG AA compliant on white */
    --primary-red-dark: #B91C1C;
    --primary-red-light: #EF4444;
    --primary-black: #1A1A1A;
    --primary-white: #FFFFFF;
    
    /* Grays - adjusted for WCAG AA */
    --gray-50: #F8F9FA;
    --gray-100: #F1F3F5;
    --gray-200: #E9ECEF;
    --gray-300: #DEE2E6;
    --gray-400: #9CA3AF;           /* Darkened for better contrast */
    --gray-500: #6B7280;           /* Darkened for better contrast */
    --gray-600: #4B5563;           /* Darkened for better contrast */
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    
    /* Status Colors - WCAG AA compliant */
    --success: #059669;            /* Darker green for contrast */
    --success-bg: #D1FAE5;
    --success-text: #065F46;       /* 7.5:1 on success-bg */
    --warning: #D97706;            /* Darker amber */
    --warning-bg: #FEF3C7;
    --warning-text: #92400E;       /* 5.7:1 on warning-bg */
    --error: #DC2626;
    --error-bg: #FEE2E2;
    --error-text: #991B1B;         /* 6.5:1 on error-bg */
    --info: #2563EB;               /* Darker blue */
    --info-bg: #DBEAFE;
    --info-text: #1E40AF;          /* 5.9:1 on info-bg */
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Typography */
    --font-main: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body {
    font-family: var(--font-main);
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    color: var(--gray-900);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================================================
   HERO / HEADER
   ============================================================================ */

.hero {
    text-align: center;
    padding: 64px 0 48px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.logo h1 {
    font-size: 56px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--primary-black);
    margin: 0;
}

.logo svg {
    animation: pinBounce 8s ease-in-out infinite;
}

@keyframes pinBounce {
    /* Red phase - gentle float */
    0% { transform: translateY(0); }
    4% { transform: translateY(-8px); }
    8% { transform: translateY(0); }
    
    /* Start float before switching to orange */
    30% { transform: translateY(0); }
    34% { transform: translateY(-8px); }
    /* Color changes here at 35% while elevated */
    38% { transform: translateY(0); }
    
    /* Start float before switching to green */
    63% { transform: translateY(0); }
    67% { transform: translateY(-8px); }
    /* Color changes here at 68% while elevated */
    71% { transform: translateY(0); }
    
    100% { transform: translateY(0); }
}

/* Color animation - changes happen mid-float */
.logo svg rect {
    animation: colorProgress 8s step-end infinite;
}

@keyframes colorProgress {
    0% {
        fill: #E63946; /* Red */
    }
    35% {
        fill: #F59E0B; /* Orange - switches while logo is up */
    }
    68% {
        fill: #10B981; /* Green - switches while logo is up */
    }
    100% {
        fill: #E63946; /* Back to red */
    }
}

.tagline {
    font-size: 24px;
    color: var(--gray-700);
    margin-bottom: 32px;
    font-weight: 400;
}

.tagline strong {
    color: var(--primary-red);
    font-weight: 600;
}

.features-grid {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 24px;
}

.feature-pill {
    background: var(--primary-white);
    border: 2px solid var(--gray-200);
    border-radius: 24px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    box-shadow: var(--shadow-sm);
}

/* ============================================================================
   INPUT SECTION
   ============================================================================ */

.input-section {
    background: var(--primary-white);
    border-radius: 16px;
    padding: 48px;
    margin: 48px 0;
    box-shadow: var(--shadow-xl);
    border: 3px solid var(--primary-black);
}

.input-group {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.input-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.input-wrapper {
    position: relative;
    flex: 1;
}

.input-wrapper.half {
    flex: 1;
}

.input-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
}

#companyName,
#websiteUrl,
#location {
    width: 100%;
    padding: 18px 20px 18px 52px;
    font-size: 18px;
    font-family: var(--font-main);
    border: 3px solid var(--gray-300);
    border-radius: 12px;
    background: var(--gray-50);
    transition: all 0.2s ease;
    font-weight: 500;
}

#companyName:focus,
#websiteUrl:focus,
#location:focus {
    outline: none;
    border-color: var(--primary-red);
    background: var(--primary-white);
    box-shadow: 0 0 0 4px rgba(230, 57, 70, 0.1);
}

#companyName::placeholder,
#websiteUrl::placeholder,
#location::placeholder {
    color: var(--gray-400);
}

.check-button {
    width: 100%;
    padding: 18px 40px;
    font-size: 18px;
    font-weight: 600;
    font-family: var(--font-main);
    background: var(--primary-red);
    color: var(--primary-white);
    border: 3px solid var(--primary-black);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    box-shadow: var(--shadow-lg);
}

.check-button:hover {
    background: var(--primary-red-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.check-button:active {
    transform: translateY(0);
}

.check-button:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    transform: none;
}

.button-text,
.button-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.spinner {
    animation: spin 1s linear infinite;
}

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

.input-hint {
    text-align: center;
    font-size: 14px;
    color: var(--gray-600);
    margin-top: 16px;
    line-height: 1.4;
}

/* ============================================================================
   ERROR MESSAGE
   ============================================================================ */

.error-message {
    background: var(--error-bg);
    border: 3px solid var(--error);
    border-radius: 12px;
    padding: 24px 32px;
    text-align: center;
    color: #991B1B;
    font-weight: 500;
    margin-bottom: 32px;
}

/* ============================================================================
   RESULTS SECTION
   ============================================================================ */

.results-section {
    margin: 48px 0;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding: 24px 32px;
    background: var(--primary-white);
    border-radius: 12px;
    border: 3px solid var(--primary-black);
    box-shadow: var(--shadow-lg);
    flex-wrap: wrap;
    gap: 16px;
}

.results-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-black);
    word-break: break-word;
}

.domain-highlight {
    color: var(--primary-red);
}

.results-meta {
    display: flex;
    gap: 16px;
    align-items: center;
}

.check-count {
    background: var(--gray-100);
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    color: var(--gray-700);
}

.check-count span:first-child {
    color: var(--primary-red);
    font-size: 20px;
}

.mismatch-count {
    background: var(--warning-bg);
    border: 2px solid var(--warning);
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    color: #92400E;
}

/* Status Banner */
#statusBanner {
    margin-bottom: 32px;
    padding: 20px 24px;
    border-radius: 12px;
    border: 3px solid;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-md);
}

#statusBanner.success {
    background: var(--success-bg);
    border-color: var(--success);
    color: #065F46;
}

#statusBanner.warning {
    background: var(--warning-bg);
    border-color: var(--warning);
    color: #92400E;
}

#statusBanner.error {
    background: var(--error-bg);
    border-color: var(--error);
    color: #991B1B;
}

/* Search Info Display */
.search-info {
    background: var(--info-bg);
    border: 2px solid var(--info);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 24px;
    font-size: 14px;
    color: #1E40AF;
}

/* NAP Note */
.nap-note {
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 24px;
    font-size: 13px;
    color: var(--gray-700);
    line-height: 1.5;
}

.nap-note a {
    color: var(--primary-red);
    text-decoration: none;
}

.nap-note a:hover {
    text-decoration: underline;
}

/* ============================================================================
   RESULT CATEGORIES
   ============================================================================ */

.result-category {
    background: var(--primary-white);
    border-radius: 16px;
    border: 3px solid var(--primary-black);
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: var(--shadow-lg);
}

.category-title {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    font-size: 18px;
    font-weight: 600;
}

.category-icon {
    font-size: 24px;
}

.category-count {
    margin-left: auto;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-500);
}

/* ============================================================================
   RESULTS TABLE
   ============================================================================ */

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

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.results-table th {
    background: var(--gray-100);
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

.results-table td {
    padding: 16px;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: top;
}

.results-table tbody tr:hover {
    background: var(--gray-50);
}

.results-table tbody tr.mismatch-row {
    background: var(--warning-bg);
}

.results-table tbody tr.mismatch-row:hover {
    background: #FDE68A;
}

.address-cell {
    max-width: 280px;
    word-wrap: break-word;
}

/* Source Cell */
.source-cell {
    min-width: 160px;
}

.debug-row {
    margin-top: 4px;
}

/* Name Cell with Website */
.name-cell {
    min-width: 120px;
}

.name-website {
    margin-top: 4px;
    font-size: 12px;
}

.name-website a {
    color: var(--gray-600);
    text-decoration: none;
}

.name-website a:hover {
    color: var(--primary-red);
    text-decoration: underline;
}

.name-website.match a {
    color: var(--success);
}

.name-website.mismatch a {
    color: #B45309;
    font-weight: 600;
}

/* Source Links */
.source-link {
    color: var(--primary-red);
    text-decoration: none;
    transition: color 0.2s ease;
}

.source-link:hover {
    color: var(--primary-red-dark);
    text-decoration: underline;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge.success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success);
}

.status-badge.mismatch {
    background: #FFFBEB;
    color: #92400E;
    border: 2px solid #D97706;
}

.status-badge.not-found {
    background: var(--gray-100);
    color: var(--gray-600);
    border: 1px solid var(--gray-300);
}

/* Rating Display */
.rating {
    color: #B45309;  /* Darker amber for WCAG AA (4.5:1 on white) */
    font-weight: 600;
    white-space: nowrap;
}

.review-count {
    color: var(--gray-600);
    font-weight: 400;
    font-size: 12px;
}

/* Website Links */
.website-link {
    color: var(--gray-700);
    text-decoration: none;
    font-size: 13px;
    word-break: break-all;
}

.website-link:hover {
    color: var(--primary-red);
    text-decoration: underline;
}

.website-link.website-match {
    color: var(--success);
}

.website-link.website-mismatch {
    color: var(--warning);
    font-weight: 600;
}

/* Not Found State */
.not-found {
    color: var(--gray-400);
}

/* Debug Toggle */
.debug-toggle {
    font-size: 11px;
    color: var(--gray-500);
    cursor: pointer;
    margin-left: 8px;
    font-weight: 400;
}

.debug-toggle:hover {
    color: var(--primary-red);
}

.debug-info {
    display: none;
    background: var(--gray-100);
    padding: 12px;
    margin-top: 8px;
    border-radius: 8px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 11px;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 200px;
    overflow-y: auto;
}

.debug-info.show {
    display: block;
}

/* ============================================================================
   ACTION BUTTONS
   ============================================================================ */

.action-buttons {
    display: flex;
    gap: 16px;
    margin-top: 48px;
    justify-content: center;
}

.primary-button,
.secondary-button {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font-main);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 3px solid var(--primary-black);
}

.primary-button {
    background: var(--primary-red);
    color: var(--primary-white);
}

.primary-button:hover {
    background: var(--primary-red-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.secondary-button {
    background: var(--primary-white);
    color: var(--primary-black);
}

.secondary-button:hover {
    background: var(--gray-100);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ============================================================================
   FOOTER
   ============================================================================ */

footer {
    margin-top: 96px;
    padding: 48px 0;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-logo svg {
    flex-shrink: 0;
}

.footer-logo span {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-black);
}

.footer-disclaimer {
    font-size: 14px;
    color: var(--gray-600);
    line-height: 1.5;
    margin: 0;
}

.footer-links {
    font-size: 14px;
    color: var(--gray-600);
    margin: 0;
}

.footer-links a {
    color: var(--gray-700);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--primary-red);
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 768px) {
    .logo h1 {
        font-size: 42px;
    }
    
    .tagline {
        font-size: 18px;
    }
    
    .input-section {
        padding: 32px 24px;
    }
    
    .input-group,
    .input-row {
        flex-direction: column;
    }
    
    #companyName,
    #websiteUrl,
    #location {
        font-size: 16px;
    }
    
    .check-button {
        width: 100%;
        justify-content: center;
        font-size: 16px;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 20px;
    }
    
    .results-header h2 {
        font-size: 22px;
    }
    
    .results-table {
        font-size: 13px;
    }
    
    .results-table th,
    .results-table td {
        padding: 12px 10px;
    }
    
    .action-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .primary-button,
    .secondary-button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 36px;
    }
    
    .tagline {
        font-size: 16px;
    }
    
    .feature-pill {
        font-size: 12px;
        padding: 6px 16px;
    }
    
    .input-section {
        padding: 24px 16px;
    }
    
    .category-icon {
        font-size: 20px;
    }
    
    .category-count {
        font-size: 12px;
    }
    
    /* Hide less important columns on mobile */
    .results-table th:nth-child(3),
    .results-table td:nth-child(3) {
        display: none;
    }
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
    body {
        background: white;
    }
    
    .hero,
    .input-section,
    .action-buttons,
    footer,
    .debug-toggle,
    .debug-info {
        display: none;
    }
    
    .result-category {
        break-inside: avoid;
        page-break-inside: avoid;
        border: 1px solid #ccc;
    }
    
    .results-header {
        border: 1px solid #ccc;
    }
}
