.csa-widget {
    max-width: 600px;
    margin: 20px auto;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.csa-header {
    background: #2271b1;
    color: #fff;
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    font-size: 18px;
}

.csa-content {
    padding: 20px;
}

.csa-instructions {
    background: #f8f9fa;
    border-left: 4px solid #2271b1;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-style: italic;
    color: #555;
}

.csa-search-form {
    margin-bottom: 20px;
}

.csa-search-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
}

.csa-search-input:focus {
    border-color: #2271b1;
}

.csa-search-btn {
    background: #2271b1;
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

.csa-search-btn:hover {
    background: #1a5a96;
}

.csa-search-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.csa-results {
    margin-top: 20px;
}

.csa-result-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    transition: box-shadow 0.3s ease;
}

.csa-result-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.csa-result-title {
    font-weight: 600;
    color: #2271b1;
    margin-bottom: 8px;
    font-size: 16px;
}

.csa-result-content {
    color: #555;
    line-height: 1.5;
}

.csa-result-content h1,
.csa-result-content h2,
.csa-result-content h3 {
    margin-top: 15px;
    margin-bottom: 10px;
    color: #333;
}

.csa-result-content h1 {
    font-size: 20px;
}

.csa-result-content h2 {
    font-size: 18px;
}

.csa-result-content h3 {
    font-size: 16px;
}

.csa-result-content strong {
    font-weight: 600;
}

.csa-result-content em {
    font-style: italic;
}

.csa-result-content code {
    background: #f1f3f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: "Courier New", monospace;
    font-size: 14px;
}

.csa-expand-btn {
    background: none;
    border: none;
    color: #2271b1;
    cursor: pointer;
    padding: 5px 0;
    margin-top: 10px;
    text-decoration: underline;
    font-size: 14px;
}

.csa-expand-btn:hover {
    color: #1a5a96;
}

.csa-full-content {
    display: none;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.csa-message {
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
    text-align: center;
}

.csa-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.csa-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.csa-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.csa-loading::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2271b1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Responsive design */
@media (max-width: 768px) {
    .csa-widget {
        margin: 10px;
        border-radius: 0;
    }
    
    .csa-header {
        border-radius: 0;
    }
    
    .csa-content {
        padding: 15px;
    }
    
    .csa-search-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

@media (max-width: 480px) {
    .csa-content {
        padding: 10px;
    }
    
    .csa-instructions {
        padding: 10px;
    }
    
    .csa-result-item {
        padding: 10px;
    }
}
