/* CivicVoice AI MP Lookup Styles v3.1 */

.cv-ai-lookup-wrapper {
    --cv-primary: #2563eb;
    --cv-primary-dark: #1d4ed8;
    --cv-secondary: #64748b;
    --cv-success: #10b981;
    --cv-warning: #f59e0b;
    --cv-error: #ef4444;
    --cv-bg: #ffffff;
    --cv-surface: #f8fafc;
    --cv-border: #e2e8f0;
    --cv-text: #1e293b;
    --cv-text-light: #64748b;
    --cv-navy: #1e3a5f;
    --cv-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --cv-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    max-width: 600px;
    margin: 2rem auto;
    color: var(--cv-text);
}

.cv-lookup-container {
    background: var(--cv-bg);
    border-radius: 16px;
    box-shadow: var(--cv-shadow-lg);
    overflow: hidden;
    border: 1px solid var(--cv-border);
}

.cv-lookup-header {
    background: linear-gradient(135deg, var(--cv-primary) 0%, var(--cv-primary-dark) 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.cv-lookup-header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.75rem;
    font-weight: 700;
}

.cv-lookup-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 1rem;
}

/* Search Tabs */
.cv-search-tabs {
    display: flex;
    background: var(--cv-surface);
    border-bottom: 1px solid var(--cv-border);
    padding: 0;
    margin: 0;
}

.cv-tab {
    flex: 1;
    padding: 1rem;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--cv-text-light);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.cv-tab:hover {
    background: rgba(37, 99, 235, 0.05);
    color: var(--cv-primary);
}

.cv-tab.active {
    color: var(--cv-primary);
    background: white;
    box-shadow: inset 0 -2px 0 var(--cv-primary);
}

.cv-tab-icon {
    font-size: 1.2rem;
}

/* Search Panels */
.cv-search-panel {
    display: none;
    padding: 2rem;
    background: var(--cv-surface);
    border-bottom: 1px solid var(--cv-border);
}

.cv-search-panel.active {
    display: block;
}

.cv-input-group {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    position: relative;
}

#cv-postcode-input,
#cv-constituency-input {
    flex: 1;
    padding: 0.875rem 1rem;
    border: 2px solid var(--cv-border);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
    background: white;
}

#cv-postcode-input {
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#cv-postcode-input:focus,
#cv-constituency-input:focus {
    outline: none;
    border-color: var(--cv-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Autocomplete Styles */
.cv-autocomplete-wrapper {
    position: relative;
}

.cv-autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 80px;
    background: white;
    border: 2px solid var(--cv-primary);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: var(--cv-shadow-lg);
}

.cv-autocomplete-list.active {
    display: block;
}

.cv-autocomplete-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--cv-border);
    transition: background 0.2s;
    font-size: 0.95rem;
}

.cv-autocomplete-item:hover,
.cv-autocomplete-item.selected {
    background: #eff6ff;
}

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

.cv-autocomplete-no-results {
    padding: 1rem;
    color: var(--cv-text-light);
    font-style: italic;
    text-align: center;
}

.cv-submit-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: var(--cv-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.cv-submit-btn:hover {
    background: var(--cv-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

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

.cv-btn-icon {
    transition: transform 0.2s;
}

.cv-submit-btn:hover .cv-btn-icon {
    transform: translateX(4px);
}

.cv-input-hint {
    font-size: 0.875rem;
    color: var(--cv-text-light);
    margin-left: 0.25rem;
}

/* Loading State */
.cv-loading {
    display: none;
    padding: 3rem 2rem;
    text-align: center;
    background: var(--cv-surface);
}

.cv-loading-spinner {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
}

.cv-spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top-color: var(--cv-primary);
    border-radius: 50%;
    animation: cv-spin 1.2s linear infinite;
}

.cv-spinner-ring:nth-child(2) {
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    border-top-color: var(--cv-secondary);
    animation-duration: 0.9s;
    animation-direction: reverse;
}

.cv-spinner-ring:nth-child(3) {
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    border-top-color: var(--cv-success);
    animation-duration: 0.6s;
}

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

.cv-loading-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--cv-text);
    margin: 0 0 0.5rem 0;
}

.cv-loading-subtext {
    font-size: 0.875rem;
    color: var(--cv-text-light);
    margin: 0;
}

/* Result Card */
.cv-result {
    display: none;
    animation: cv-fadeIn 0.5s ease-out;
}

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

.cv-result-card {
    background: white;
    margin: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--cv-shadow);
    overflow: hidden;
    border: 1px solid var(--cv-border);
}

.cv-result-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--cv-border);
}

/* Custom Navy Blue MP Icon */
.cv-mp-icon-container {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.cv-mp-icon {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.cv-mp-title {
    flex: 1;
}

.cv-mp-title h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--cv-text);
}

.cv-party-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.cv-result-body {
    padding: 1.5rem;
}

.cv-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--cv-border);
    margin-bottom: 1rem;
}

.cv-label {
    font-weight: 600;
    color: var(--cv-text-light);
    font-size: 0.875rem;
}

.cv-value {
    font-weight: 600;
    color: var(--cv-text);
}

/* Since When Row */
#cv-since-row {
    background: #f0f9ff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    border-bottom: none;
}

#cv-since-row .cv-label {
    color: #0369a1;
}

#cv-since-row .cv-value {
    color: #0c4a6e;
    font-weight: 700;
}

.cv-info-section {
    margin-bottom: 1.5rem;
}

.cv-info-section h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--cv-text-light);
    font-weight: 700;
}

.cv-bio-text, .cv-work-text {
    margin: 0;
    line-height: 1.6;
    color: var(--cv-text);
    font-size: 0.95rem;
}

/* Predecessor Notice */
.cv-predecessor-notice {
    background: #fef3c7;
    border-left: 4px solid var(--cv-warning);
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    border-radius: 6px;
    font-size: 0.9rem;
}

.cv-predecessor-notice p {
    margin: 0;
    color: #92400e;
}

.cv-predecessor-notice strong {
    color: #92400e;
}

.cv-contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.cv-contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.cv-email-btn {
    background: var(--cv-success);
    color: white;
}

.cv-email-btn:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.cv-profile-btn {
    background: var(--cv-primary);
    color: white;
}

.cv-profile-btn:hover {
    background: var(--cv-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.cv-icon {
    font-size: 1.1rem;
}

.cv-social-links {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    justify-content: center;
}

.cv-social-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.2s;
    color: white;
}

.cv-twitter {
    background: #000000;
}

.cv-twitter:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.cv-facebook {
    background: #1877f2;
}

.cv-facebook:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3);
}

.cv-result-footer {
    background: var(--cv-surface);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--cv-border);
}

/* HIDE AI VERIFIED BADGE - no longer claiming verification */
.cv-ai-badge {
    display: none !important;
}

.cv-cache-badge {
    font-size: 0.75rem;
    color: var(--cv-success);
    background: #d1fae5;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    margin-left: 0.5rem;
}

.cv-feedback-btn {
    background: transparent;
    border: 1px solid var(--cv-border);
    color: var(--cv-text-light);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.cv-feedback-btn:hover {
    background: var(--cv-border);
    color: var(--cv-text);
}

/* NEW VERIFICATION BOX STYLES */
.cv-verification-box {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 2px solid var(--cv-primary);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.1);
}

.cv-verification-icon {
    background: var(--cv-primary);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
    font-size: 18px;
}

.cv-verification-content {
    flex: 1;
}

.cv-verification-content h4 {
    margin: 0 0 0.5rem 0;
    color: var(--cv-primary-dark);
    font-size: 1rem;
    font-weight: 700;
}

.cv-verification-content p {
    margin: 0 0 1rem 0;
    color: var(--cv-text);
    font-size: 0.9rem;
    line-height: 1.5;
}

.cv-verify-btn {
    display: inline-flex;
    align-items: center;
    background: var(--cv-primary);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.cv-verify-btn:hover {
    background: var(--cv-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Disclaimer */
.cv-disclaimer {
    margin: 1rem 1.5rem 0.5rem;
    padding: 1rem;
    background: #fef3c7;
    border-left: 4px solid var(--cv-warning);
    border-radius: 6px;
}

.cv-disclaimer p {
    margin: 0;
    font-size: 0.875rem;
    color: #92400e;
}

.cv-disclaimer a {
    color: #92400e;
    text-decoration: underline;
    font-weight: 600;
}

/* Not Your Constituency Section */
.cv-not-constituency {
    margin: 0.5rem 1.5rem 1.5rem;
    padding: 1rem;
    background: #eff6ff;
    border-left: 4px solid var(--cv-primary);
    border-radius: 6px;
    text-align: center;
}

.cv-not-constituency p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--cv-text);
}

.cv-switch-search-btn {
    background: none;
    border: none;
    color: var(--cv-primary);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.cv-switch-search-btn:hover {
    color: var(--cv-primary-dark);
}

/* Error State */
.cv-error {
    display: none;
    padding: 2rem;
    text-align: center;
    background: #fef2f2;
    margin: 1.5rem;
    border-radius: 12px;
    border: 2px solid var(--cv-error);
    animation: cv-shake 0.5s ease-in-out;
}

@keyframes cv-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.cv-error-icon {
    width: 50px;
    height: 50px;
    background: var(--cv-error);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.cv-error-message {
    color: #991b1b;
    font-weight: 600;
    margin-bottom: 1rem;
}

.cv-retry-btn {
    background: var(--cv-error);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.cv-retry-btn:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Responsive */
@media (max-width: 480px) {
    .cv-search-tabs {
        flex-direction: column;
    }
    
    .cv-tab {
        justify-content: flex-start;
        padding: 0.75rem 1rem;
    }
    
    .cv-input-group {
        flex-direction: column;
    }
    
    .cv-submit-btn {
        width: 100%;
        justify-content: center;
    }
    
    .cv-autocomplete-list {
        right: 0;
        top: auto;
        bottom: 100%;
        border-radius: 8px 8px 0 0;
        border-bottom: none;
        border-top: 2px solid var(--cv-primary);
    }
    
    .cv-contact-grid {
        grid-template-columns: 1fr;
    }
    
    .cv-result-header {
        flex-direction: column;
        text-align: center;
    }
    
    .cv-mp-icon-container {
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .cv-result-footer {
        flex-direction: column;
        gap: 1rem;
    }
    
    /* Mobile verification box adjustments */
    .cv-verification-box {
        flex-direction: column;
        text-align: center;
        margin: 1rem;
    }
    
    .cv-verification-icon {
        margin: 0 auto;
    }
}