/* =====================================================
   AUDIT DE COMPTE RÉSEAUX SOCIAUX - Styles CSS
   SOS Storytelling
   ===================================================== */

/* ==================== MODAL OVERLAY ==================== */
.audit-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
    padding: 20px;
}

.audit-modal-content {
    background: white;
    border-radius: 20px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: auditSlideIn 0.3s ease;
}

@keyframes auditSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.audit-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

.audit-modal-close:hover {
    background: #e5e7eb;
    transform: scale(1.1);
}

/* ==================== FORM CONTAINER ==================== */
.audit-form-container {
    padding: 3rem;
    text-align: center;
}

.audit-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.audit-form-container h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1a1a2e;
}

.audit-subtitle {
    color: #666;
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* Input */
.audit-input-group {
    text-align: left;
    margin-bottom: 1.5rem;
}

.audit-input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.audit-input-group input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.audit-input-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Platform badges */
.audit-platform-selector {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.audit-platform-badge {
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-size: 0.9rem;
    background: #f3f4f6;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.audit-platform-badge:hover {
    background: #e5e7eb;
}

.audit-platform-badge.active {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border-color: #3b82f6;
}

/* Submit button */
.audit-submit-btn {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.audit-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

.audit-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Spinner */
.audit-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: auditSpin 1s linear infinite;
}

@keyframes auditSpin {
    to { transform: rotate(360deg); }
}

/* Note */
.audit-note {
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: #888;
}

/* Error */
.audit-error-message {
    background: #fee2e2;
    color: #dc2626;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-align: left;
}

/* ==================== PROGRESS SCREEN ==================== */
.audit-progress-container {
    padding: 3rem;
    text-align: center;
}

.audit-progress-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: auditSpin 2s linear infinite;
}

.audit-progress-container h2 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: #1a1a2e;
}

.audit-progress-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.audit-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 12px;
    transition: all 0.3s;
    opacity: 0.5;
}

.audit-step.active {
    opacity: 1;
    background: #eff6ff;
    border-left: 3px solid #3b82f6;
}

.audit-step.completed {
    opacity: 1;
    background: #ecfdf5;
    border-left: 3px solid #10b981;
}

.audit-step.completed .step-icon::after {
    content: '✓';
    position: absolute;
    right: -5px;
    bottom: -5px;
    font-size: 0.7rem;
    background: #10b981;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-icon {
    font-size: 1.5rem;
    position: relative;
}

.step-text {
    font-size: 0.95rem;
    color: #374151;
}

/* Thinking dots */
.audit-thinking {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.thinking-dot {
    width: 10px;
    height: 10px;
    background: #3b82f6;
    border-radius: 50%;
    animation: auditBounce 1.4s infinite ease-in-out both;
}

.thinking-dot:nth-child(1) { animation-delay: -0.32s; }
.thinking-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes auditBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.audit-wait-text {
    color: #666;
    font-style: italic;
}

/* ==================== RESULT SCREEN ==================== */
.audit-result-container {
    padding: 2rem;
}

/* Score card */
.audit-score-card {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    color: white;
    margin-bottom: 1.5rem;
}

.audit-score-circle {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.25rem;
}

.audit-score-number {
    font-size: 4rem;
    font-weight: 700;
}

.audit-score-max {
    font-size: 1.5rem;
    opacity: 0.7;
}

.audit-score-label {
    margin-top: 0.5rem;
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Sections */
.audit-section {
    background: #f9fafb;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.audit-section h3 {
    margin-bottom: 1rem;
    font-size: 1.15rem;
    color: #1a1a2e;
}

.audit-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.audit-section li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5e7eb;
    color: #374151;
    font-size: 0.95rem;
}

.audit-section li:last-child {
    border-bottom: none;
}

.audit-section.positive {
    background: #ecfdf5;
}

.audit-section.improvements {
    background: #fffbeb;
}

/* Strategy */
.strategy-summary {
    color: #374151;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.audit-schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.audit-schedule-day {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.day-name {
    display: block;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 0.25rem;
}

.day-type {
    display: block;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.day-description {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

/* Posts list */
.audit-posts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.audit-post-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.audit-post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.audit-post-type {
    background: #dbeafe;
    color: #1d4ed8;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.audit-post-day {
    color: #888;
    font-size: 0.85rem;
}

.audit-post-hook {
    font-style: italic;
    color: #374151;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.audit-post-actions {
    display: flex;
    gap: 0.5rem;
}

/* Buttons */
.btn-audit-secondary {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-audit-secondary:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.btn-audit-primary {
    padding: 0.5rem 1rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-audit-primary:hover {
    background: #2563eb;
}

/* CTA final */
.audit-cta {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e5e7eb;
}

.btn-audit-generate-all {
    padding: 1.25rem 2.5rem;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.15rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-audit-generate-all:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.audit-cta-note {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: #888;
}

.btn-audit-close {
    display: block;
    width: 100%;
    padding: 1rem;
    background: transparent;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    margin-top: 1.5rem;
    transition: all 0.2s;
}

.btn-audit-close:hover {
    background: #f3f4f6;
}

/* ==================== PREVIEW MODAL ==================== */
.audit-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    padding: 20px;
}

.audit-preview-content {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    padding: 2rem;
}

.audit-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.audit-preview-body {
    margin-bottom: 1.5rem;
}

.audit-preview-hook {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 1rem;
}

.audit-preview-content-text {
    color: #374151;
    line-height: 1.6;
    white-space: pre-wrap;
    background: #f9fafb;
    padding: 1rem;
    border-radius: 10px;
    font-size: 0.95rem;
}

.audit-preview-cta {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #ecfdf5;
    border-radius: 8px;
    color: #059669;
}

.audit-preview-hashtags {
    margin-top: 1rem;
    color: #3b82f6;
    font-size: 0.9rem;
}

.audit-preview-actions {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.audit-preview-actions button {
    flex: 1;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 640px) {
    .audit-modal-content {
        border-radius: 16px 16px 0 0;
        max-height: 95vh;
    }

    .audit-form-container,
    .audit-progress-container,
    .audit-result-container {
        padding: 1.5rem;
    }

    .audit-icon,
    .audit-progress-icon {
        font-size: 3rem;
    }

    .audit-form-container h2,
    .audit-progress-container h2 {
        font-size: 1.4rem;
    }

    .audit-platform-selector {
        flex-direction: column;
    }

    .audit-platform-badge {
        width: 100%;
        text-align: center;
    }

    .audit-schedule-grid {
        grid-template-columns: 1fr;
    }

    .audit-post-actions {
        flex-direction: column;
    }

    .audit-post-actions button {
        width: 100%;
    }

    .audit-preview-actions {
        flex-direction: column;
    }
}

/* ==================== URL AUDIT INPUT ==================== */

.audit-url-input-group {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.audit-url-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
    min-width: 0;
}

.audit-url-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.audit-url-fetch-btn {
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.audit-url-fetch-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.audit-url-fetch-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.audit-url-divider {
    display: flex;
    align-items: center;
    margin: 20px 0 5px;
    gap: 12px;
}

.audit-url-divider::before,
.audit-url-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

.audit-url-divider span {
    font-size: 0.8em;
    color: #999;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Method toggle for Posts tab */
.audit-input-method-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.audit-method-btn {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    background: #f8fafc;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s;
    font-family: inherit;
}

.audit-method-btn:hover {
    border-color: #c0c0c0;
    background: #f0f0f0;
}

.audit-method-btn.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    color: #4338ca;
    font-weight: 600;
}

/* Small loading spinner for URL fetch buttons */
.loading-spinner-small {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mobile responsive for URL input */
@media (max-width: 600px) {
    .audit-url-input-group {
        flex-direction: column;
    }

    .audit-url-fetch-btn {
        justify-content: center;
    }

    .audit-input-method-toggle {
        flex-direction: column;
    }
}
