/**
 * CIVIC REPRESENTATIVE FINDER - STYLES
 * V36.10.0 Phase 1
 */

/* ============================================================================
   LOCATION INPUT
   ============================================================================ */

.rep-finder-location-input {
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem;
}

.location-input-header {
    text-align: center;
    margin-bottom: 2rem;
}

.location-input-header h3 {
    font-size: 1.75rem;
    color: var(--text-primary, #1a1a1a);
    margin-bottom: 0.5rem;
}

.location-input-header p {
    color: var(--text-secondary, #666);
    font-size: 1rem;
}

/* Privacy Disclosure */
.privacy-disclosure {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, #e8f4ff 0%, #d4edff 100%);
    border: 2px solid #3b82f6;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
}

.disclosure-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.disclosure-content {
    font-size: 0.9375rem;
    line-height: 1.5;
    color: #1e40af;
}

.disclosure-content strong {
    color: #1e3a8a;
}

/* Primary Input Section */
.location-input-primary {
    margin-bottom: 2rem;
}

.input-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
}

.label-text {
    font-size: 1rem;
}

.label-required {
    color: #dc2626;
    margin-left: 0.25rem;
}

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

.form-input {
    flex: 1;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input::placeholder {
    color: #9ca3af;
}

.btn-primary {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

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

.btn-icon {
    font-size: 1.25rem;
}

.input-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
    padding: 0.5rem 0;
}

.note-icon {
    font-size: 1rem;
}

/* Optional Full Address Section */
.location-input-optional {
    border-top: 1px solid #e5e7eb;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}

.toggle-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9375rem;
    color: #374151;
}

.toggle-link:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.toggle-icon {
    font-size: 1.25rem;
}

.toggle-text {
    flex: 1;
    text-align: left;
}

.toggle-arrow {
    font-size: 0.875rem;
    transition: transform 0.2s ease;
}

.full-address-section {
    margin-top: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
}

.full-address-disclosure {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.full-address-disclosure p {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.full-address-disclosure ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.full-address-disclosure li {
    padding: 0.25rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.full-address-disclosure li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
}

.form-group {
    margin-bottom: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-select {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-secondary {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #3b82f6;
    background: white;
    border: 2px solid #3b82f6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-secondary:hover {
    background: #eff6ff;
}

/* Loading State */
.lookup-loading {
    text-align: center;
    padding: 2rem;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

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

.lookup-loading p {
    color: #6b7280;
    font-size: 1rem;
}

/* Error State */
.lookup-error {
    background: #fef2f2;
    border: 2px solid #dc2626;
    border-radius: 8px;
    padding: 1rem;
    color: #991b1b;
    margin-top: 1rem;
}

/* ============================================================================
   REPRESENTATIVES VIEW
   ============================================================================ */

.rep-finder-results {
    width: 100%;
}

/* Minimized Location Bar */
.location-bar-minimized {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #bae6fd;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.location-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.location-icon {
    font-size: 1.5rem;
}

.location-text {
    font-weight: 600;
    color: #0c4a6e;
}

.last-update {
    font-size: 0.875rem;
    color: #0369a1;
    margin-left: 0.5rem;
}

.btn-link {
    padding: 0.5rem 1rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #3b82f6;
    background: white;
    border: 1px solid #3b82f6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-link:hover {
    background: #eff6ff;
}

/* Representatives Display */
.representatives-display {
    width: 100%;
}

.loading-message {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
    font-size: 1.125rem;
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
    font-size: 1rem;
}

/* Representative Groups */
.rep-group {
    margin-bottom: 3rem;
}

.rep-group-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rep-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* Representative Card */
.rep-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s ease;
}

.rep-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.rep-card-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.rep-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e5e7eb;
}

.rep-photo-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    border: 3px solid #e5e7eb;
}

.rep-info {
    flex: 1;
}

.rep-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.rep-title {
    font-size: 0.9375rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.rep-party {
    font-size: 0.875rem;
    font-weight: 600;
    color: #3b82f6;
}

.rep-card-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.rep-district {
    font-size: 0.9375rem;
    color: #4b5563;
}

/* Contact Section */
.rep-contact h5 {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    margin-bottom: 0.25rem;
    color: #3b82f6;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 0.9375rem;
}

.contact-link:hover {
    background: #eff6ff;
}

.contact-icon {
    font-size: 1rem;
}

/* V37.17.0: Enhanced Contact Button Styles */

/* Direct contact (phone/email available) - Blue */
.contact-link-direct {
    color: #3b82f6;
    font-weight: 500;
}

.contact-link-direct:hover {
    background: #dbeafe;
    transform: translateX(2px);
}

/* Fallback contact (contact form/page) - Orange */
.contact-link-fallback {
    color: #f59e0b;
    font-style: italic;
}

.contact-link-fallback:hover {
    background: #fef3c7;
    transform: translateX(2px);
}

.contact-link-fallback::after {
    content: " →";
    font-style: normal;
    opacity: 0.6;
}

/* Enhanced features (district office) - Green */
.contact-link-enhanced {
    color: #10b981;
    font-weight: 500;
}

.contact-link-enhanced:hover {
    background: #d1fae5;
    transform: translateX(2px);
}

/* Search fallback (DuckDuckGo) - Purple */
.contact-link-search {
    color: #8b5cf6;
    font-weight: 500;
    border: 1px dashed #c4b5fd;
}

.contact-link-search:hover {
    background: #ede9fe;
    border-color: #8b5cf6;
    transform: translateX(2px);
}

/* Actions */
.rep-actions {
    display: flex;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.btn-small {
    flex: 1;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}

.btn-outline {
    color: #3b82f6;
    background: white;
    border: 1px solid #3b82f6;
}

.btn-outline:hover {
    background: #eff6ff;
}

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

@media (max-width: 768px) {
    .rep-finder-location-input {
        padding: 1rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .btn-primary {
        width: 100%;
        justify-content: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .location-bar-minimized {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .rep-cards {
        grid-template-columns: 1fr;
    }
    
    .rep-actions {
        flex-direction: column;
    }
}

/* ============================================================================
   DARK MODE SUPPORT (Optional)
   ============================================================================ */

@media (prefers-color-scheme: dark) {
    .rep-card {
        background: #1f2937;
        border-color: #374151;
    }
    
    .rep-card:hover {
        border-color: #3b82f6;
    }
    
    .rep-name {
        color: #f9fafb;
    }
    
    .rep-title,
    .rep-district {
        color: #9ca3af;
    }
    
    .form-input,
    .form-select {
        background: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }
    
    .full-address-section {
        background: #1f2937;
    }
    
    .full-address-disclosure {
        background: #111827;
        border-color: #374151;
    }
}
