/**
 * Competitive Store Analyzer - Frontend Styles
 * Styles for the competitor analysis interface
 */

/* Reset and base styles */
.csa-analyzer-form,
.csa-analysis-results {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Form styles */
.csa-analyzer-form {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.csa-form-header {
    text-align: center;
    margin-bottom: 30px;
}

.csa-form-header h2 {
    color: #2c3e50;
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 600;
}

.csa-form-header p {
    color: #7f8c8d;
    margin: 0;
    font-size: 16px;
}

.csa-form-group {
    margin-bottom: 20px;
}

.csa-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

.csa-form-group input[type="text"],
.csa-form-group input[type="email"],
.csa-form-group input[type="url"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.csa-form-group input[type="text"]:focus,
.csa-form-group input[type="email"]:focus,
.csa-form-group input[type="url"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.csa-analyze-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.csa-analyze-btn:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.csa-analyze-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.csa-loading {
    display: none;
    text-align: center;
    margin-top: 20px;
}

.csa-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Results styles */
.csa-results {
    display: none;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-top: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.csa-results-header {
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.csa-results-header h3 {
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-size: 24px;
    font-weight: 600;
}

.csa-overall-score {
    display: flex;
    align-items: center;
    gap: 10px;
}

.csa-score-label {
    font-weight: 500;
    color: #7f8c8d;
}

.csa-score-value {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 18px;
}

.csa-summary {
    background: #f8f9fa;
    border-left: 4px solid #3498db;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 0 6px 6px 0;
}

.csa-summary h4 {
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-size: 20px;
    font-weight: 600;
}

.csa-summary p {
    margin: 0;
    color: #34495e;
    line-height: 1.7;
}

.csa-detailed-analysis {
    margin-bottom: 30px;
}

.csa-analysis-section {
    background: #fff;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
    transition: box-shadow 0.3s ease;
}

.csa-analysis-section:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.csa-analysis-section h5 {
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.csa-section-score {
    background: #ecf0f1;
    color: #2c3e50;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 500;
}

.csa-analysis-section p {
    margin: 0 0 15px 0;
    color: #34495e;
}

.csa-key-findings {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
}

.csa-key-findings strong {
    color: #2c3e50;
    display: block;
    margin-bottom: 10px;
}

.csa-key-findings ul {
    margin: 0;
    padding-left: 20px;
}

.csa-key-findings li {
    margin-bottom: 8px;
    color: #34495e;
}

.csa-recommendations {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.csa-recommendations h4 {
    margin: 0 0 15px 0;
    font-size: 20px;
    font-weight: 600;
}

.csa-recommendations ul {
    margin: 0;
    padding-left: 20px;
}

.csa-recommendations li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.csa-action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.csa-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.csa-btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.csa-btn.csa-show-detailed {
    background: #27ae60;
}

.csa-btn.csa-show-detailed:hover {
    background: #229954;
}

.csa-btn.csa-export-report {
    background: #e74c3c;
}

.csa-btn.csa-export-report:hover {
    background: #c0392b;
}

/* Notification styles */
.csa-error-message,
.csa-success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    z-index: 9999;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none;
}

.csa-error-message {
    background: #e74c3c;
    border-left: 4px solid #c0392b;
}

.csa-success-message {
    background: #27ae60;
    border-left: 4px solid #229954;
}

/* Responsive design */
@media (max-width: 768px) {
    .csa-analyzer-form,
    .csa-results {
        margin: 20px;
        padding: 20px;
    }
    
    .csa-form-header h2 {
        font-size: 24px;
    }
    
    .csa-results-header h3 {
        font-size: 20px;
    }
    
    .csa-action-buttons {
        flex-direction: column;
    }
    
    .csa-btn {
        width: 100%;
        text-align: center;
    }
    
    .csa-error-message,
    .csa-success-message {
        left: 20px;
        right: 20px;
        max-width: none;
    }
}

/* Print styles */
@media print {
    .csa-analyzer-form,
    .csa-action-buttons,
    .csa-loading {
        display: none;
    }
    
    .csa-results {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Accessibility improvements */
.csa-analyze-btn:focus,
.csa-btn:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.csa-form-group input:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .csa-analyzer-form,
    .csa-results {
        border: 2px solid #000;
    }
    
    .csa-analyze-btn {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .csa-analyze-btn,
    .csa-btn,
    .csa-analysis-section {
        transition: none;
    }
    
    .csa-loading::after {
        animation: none;
    }
}
