/* Canadian MLA Finder Styles */
.cmlaf-container {
    max-width: 600px;
    margin: 20px 0;
    font-family: inherit;
    line-height: 1.6;
}

.cmlaf-form-wrapper {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.cmlaf-title {
    margin: 0 0 20px 0;
    font-size: 1.5em;
    color: #333;
    text-align: center;
}

.cmlaf-form {
    margin-bottom: 20px;
}

.cmlaf-input-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: stretch;
}

.cmlaf-input {
    flex: 1;
    min-width: 200px;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.cmlaf-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.cmlaf-input:invalid {
    border-color: #d63638;
}

.cmlaf-submit-btn {
    padding: 12px 20px;
    background-color: #0073aa;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

.cmlaf-submit-btn:hover:not(:disabled) {
    background-color: #005a87;
}

.cmlaf-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cmlaf-loading {
    display: flex;
    align-items: center;
    gap: 5px;
}

.cmlaf-results {
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #ffffff;
    margin-top: 20px;
}

.cmlaf-results.error {
    background-color: #fef7f7;
    border-color: #d63638;
    color: #d63638;
    padding: 15px;
    text-align: center;
}

.cmlaf-results.success {
    border-color: #00a32a;
}

.cmlaf-location-info {
    background: #f0f6fc;
    border-bottom: 1px solid #ddd;
    padding: 15px;
}

.cmlaf-location-info h4 {
    margin: 0 0 5px 0;
    color: #0073aa;
    font-size: 1.1em;
}

.cmlaf-location-details {
    color: #666;
    font-size: 0.9em;
}

.cmlaf-representatives {
    padding: 0;
}

.cmlaf-representative {
    border-bottom: 1px solid #eee;
    padding: 20px;
}

.cmlaf-representative:last-child {
    border-bottom: none;
}

.cmlaf-rep-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
}

.cmlaf-rep-photo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ddd;
}

.cmlaf-rep-photo-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ddd;
    font-size: 24px;
    color: #666;
}

.cmlaf-rep-basic-info h5 {
    margin: 0 0 5px 0;
    font-size: 1.2em;
    color: #333;
}

.cmlaf-rep-title {
    color: #666;
    font-weight: 500;
    margin-bottom: 5px;
}

.cmlaf-rep-district {
    color: #0073aa;
    font-weight: 600;
}

.cmlaf-rep-party {
    background: #e7f3ff;
    color: #0073aa;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 500;
    display: inline-block;
    margin-top: 5px;
}

.cmlaf-rep-details {
    margin-top: 15px;
}

.cmlaf-rep-contact {
    background: #f8f9fa;
    border-radius: 4px;
    padding: 15px;
    margin-top: 10px;
}

.cmlaf-rep-contact h6 {
    margin: 0 0 10px 0;
    font-size: 1em;
    color: #333;
}

.cmlaf-contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.cmlaf-contact-item {
    font-size: 0.9em;
}

.cmlaf-contact-item strong {
    display: block;
    color: #666;
    font-weight: 500;
    margin-bottom: 2px;
}

.cmlaf-contact-link {
    color: #0073aa;
    text-decoration: none;
}

.cmlaf-contact-link:hover {
    text-decoration: underline;
}

.cmlaf-boundaries {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.cmlaf-boundaries h6 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1em;
}

.cmlaf-boundary-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cmlaf-boundary-item {
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

.cmlaf-boundary-item:last-child {
    border-bottom: none;
}

.cmlaf-boundary-name {
    font-weight: 600;
    color: #333;
}

.cmlaf-boundary-type {
    color: #666;
    font-size: 0.9em;
}

.cmlaf-no-results {
    text-align: center;
    padding: 30px;
    color: #666;
}

.cmlaf-no-results svg {
    width: 48px;
    height: 48px;
    color: #ccc;
    margin-bottom: 15px;
}

.cmlaf-api-info {
    margin-top: 20px;
    padding: 10px;
    background: #f0f6fc;
    border-radius: 4px;
    font-size: 0.85em;
    color: #666;
    text-align: center;
}

.cmlaf-api-info a {
    color: #0073aa;
    text-decoration: none;
}

.cmlaf-api-info a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cmlaf-container {
        margin: 10px 0;
    }
    
    .cmlaf-form-wrapper {
        padding: 15px;
    }
    
    .cmlaf-input-group {
        flex-direction: column;
    }
    
    .cmlaf-input {
        min-width: 100%;
    }
    
    .cmlaf-rep-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .cmlaf-contact-info {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .cmlaf-representative {
        padding: 15px;
    }
    
    .cmlaf-rep-photo,
    .cmlaf-rep-photo-placeholder {
        width: 50px;
        height: 50px;
    }
    
    .cmlaf-rep-basic-info h5 {
        font-size: 1.1em;
    }
}

/* Animation for loading state */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.cmlaf-loading svg {
    animation: spin 1s linear infinite;
}

/* Focus states for accessibility */
.cmlaf-submit-btn:focus,
.cmlaf-input:focus {
    outline: 2px solid #005a87;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .cmlaf-form {
        display: none;
    }
    
    .cmlaf-submit-btn {
        display: none;
    }
    
    .cmlaf-results {
        border: none;
        box-shadow: none;
    }
}
