/* ==========================================================================
   TEST PAGE STYLES
   Page d'administration pour les outils de test et développement
   ========================================================================== */

/* Container principal */
.test-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
.test-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    gap: 1rem;
}

.test-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-gray-900);
    margin: 0 0 0.5rem 0;
}

.test-subtitle {
    color: var(--color-gray-500);
    font-size: 1rem;
    margin: 0;
}

.test-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.test-badge--small {
    padding: 0.25rem 0.75rem;
    font-size: 0.7rem;
    background: var(--color-primary);
}

.test-badge--gray {
    background: var(--color-gray-200);
    color: var(--color-gray-600);
}

/* Override settings card header for test page */
.test-container .settings-card__header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Card icons */
.test-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.test-card-icon--blue {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #2563eb;
}

.test-card-icon--green {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #16a34a;
}

.test-card-icon--purple {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    color: #7c3aed;
}

.test-card-icon--orange {
    background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
    color: #ea580c;
}

/* Upload zone */
.test-upload-zone {
    border: 2px dashed var(--color-gray-300);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--color-gray-50);
}

.test-upload-zone:hover,
.test-upload-zone--active {
    border-color: var(--color-primary);
    background: #eff6ff;
}

.test-upload-zone--active {
    transform: scale(1.01);
}

.test-upload-zone__icon {
    color: var(--color-gray-400);
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.test-upload-zone:hover .test-upload-zone__icon {
    color: var(--color-primary);
}

.test-upload-zone__title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-gray-700);
    margin: 0 0 0.5rem 0;
}

.test-upload-zone__text {
    color: var(--color-gray-500);
    margin: 0 0 1.5rem 0;
}

.test-upload-zone__input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.test-upload-zone__info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--color-gray-500);
}

/* Progress bar */
.test-progress {
    padding: 2rem;
    text-align: center;
}

.test-progress__bar {
    height: 6px;
    background: var(--color-gray-200);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.test-progress__fill {
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, var(--color-primary), #3b82f6);
    border-radius: 3px;
    animation: progress-animation 1.5s ease-in-out infinite;
}

@keyframes progress-animation {
    0% { width: 0%; margin-left: 0%; }
    50% { width: 50%; margin-left: 25%; }
    100% { width: 0%; margin-left: 100%; }
}

.test-progress__text {
    color: var(--color-gray-600);
    font-size: 0.875rem;
    margin: 0;
}

/* Alerts */
.test-alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.test-alert--error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.test-alert--success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Results section */
.test-results-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-gray-200);
}

.test-results-file {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--color-primary);
}

.test-results-file div {
    display: flex;
    flex-direction: column;
}

.test-results-file strong {
    color: var(--color-gray-900);
    font-weight: 600;
}

.test-results-file span {
    color: var(--color-gray-500);
    font-size: 0.875rem;
}

.test-results-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.test-stat-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid var(--color-gray-200);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.test-stat-value {
    display: block;
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.test-stat-label {
    font-size: 0.875rem;
    color: var(--color-gray-600);
}

.test-results-content h4,
.test-results-images h4 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-gray-700);
    margin: 0 0 1rem 0;
}

.test-code-block {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 12px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.8rem;
    line-height: 1.7;
    overflow-x: auto;
    max-height: 400px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.test-results-images {
    margin-top: 2rem;
}

.test-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.test-image-card {
    background: white;
    border: 1px solid var(--color-gray-200);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.test-image-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.test-image-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    background: var(--color-gray-100);
}

.test-image-card span {
    display: block;
    padding: 0.75rem;
    font-size: 0.75rem;
    color: var(--color-gray-500);
    text-align: center;
    border-top: 1px solid var(--color-gray-100);
}

/* Email cards */
.test-email-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.test-email-card {
    background: white;
    border: 2px solid var(--color-gray-200);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.test-email-card:hover:not(.test-email-card--disabled) {
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(12, 129, 228, 0.15);
}

.test-email-card--disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.test-email-card__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
}

.test-email-card--disabled .test-email-card__icon {
    background: var(--color-gray-100);
    color: var(--color-gray-400);
}

.test-email-card__title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-gray-900);
    margin: 0 0 0.5rem 0;
}

.test-email-card__desc {
    color: var(--color-gray-500);
    font-size: 0.875rem;
    margin: 0 0 1rem 0;
    line-height: 1.5;
}

/* Info box */
.test-info-box {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 1rem 1.25rem;
}

.test-info-box svg {
    flex-shrink: 0;
    color: var(--color-primary);
    margin-top: 2px;
}

.test-info-box strong {
    display: block;
    color: var(--color-gray-900);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.test-info-box p {
    color: var(--color-gray-600);
    font-size: 0.875rem;
    margin: 0;
}

/* Layouts preview */
.test-layouts-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.test-layout-item {
    text-align: center;
}

.test-layout-thumb {
    aspect-ratio: 16/9;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    overflow: hidden;
    border: 2px solid var(--color-gray-200);
    transition: all 0.3s ease;
}

.test-layout-item:hover .test-layout-thumb {
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

.test-layout-thumb--title {
    background: linear-gradient(135deg, var(--color-primary) 0%, #3b82f6 100%);
    color: white;
}

.test-layout-thumb--section {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
}

.test-layout-thumb--content {
    background: white;
    padding: 0.75rem;
}

.test-layout-lines {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.test-layout-lines span {
    height: 6px;
    background: var(--color-gray-200);
    border-radius: 3px;
}

.test-layout-lines span:nth-child(1) { width: 80%; }
.test-layout-lines span:nth-child(2) { width: 100%; }
.test-layout-lines span:nth-child(3) { width: 60%; }

.test-layout-thumb--list {
    background: white;
    padding: 0.75rem;
}

.test-layout-bullets {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.test-layout-bullets span {
    height: 6px;
    background: var(--color-gray-200);
    border-radius: 3px;
    position: relative;
    margin-left: 12px;
}

.test-layout-bullets span::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 0;
    width: 6px;
    height: 6px;
    background: var(--color-primary);
    border-radius: 50%;
}

.test-layout-thumb--stats {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.test-layout-stats {
    display: flex;
    gap: 0.75rem;
}

.test-layout-stats span {
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 700;
    color: #16a34a;
}

.test-layout-thumb--image {
    background: white;
}

.test-layout-img-placeholder {
    width: 40%;
    height: 60%;
    background: var(--color-gray-100);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-gray-400);
}

.test-layout-name {
    font-size: 0.75rem;
    color: var(--color-gray-600);
    font-family: 'JetBrains Mono', monospace;
}

/* Download section */
.test-download-section {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
}

.test-download-text {
    color: var(--color-gray-600);
    margin: 0 0 1.5rem 0;
}

.test-download-text strong {
    color: var(--color-primary);
}

/* Workflow steps */
.test-workflow-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.test-workflow-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--color-gray-50);
    border-radius: 12px;
    border: 1px solid var(--color-gray-200);
    transition: all 0.3s ease;
}

.test-workflow-step:hover {
    background: white;
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(12, 129, 228, 0.1);
}

.test-workflow-step__number {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--color-primary) 0%, #3b82f6 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    flex-shrink: 0;
}

.test-workflow-step__content h4 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-gray-900);
    margin: 0 0 0.25rem 0;
}

.test-workflow-step__content p {
    color: var(--color-gray-500);
    font-size: 0.875rem;
    margin: 0;
}

/* CTA Section */
.test-cta-section {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #faf5ff 0%, #ede9fe 100%);
    border-radius: 16px;
}

/* Button variants */
.btn--full {
    width: 100%;
}

.btn--gradient {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    color: white;
    border: none;
}

.btn--gradient:hover {
    background: linear-gradient(135deg, #6d28d9 0%, #9333ea 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .test-container {
        padding: 1rem;
    }

    .test-header {
        flex-direction: column;
    }

    .test-title {
        font-size: 1.5rem;
    }

    .test-email-cards {
        grid-template-columns: 1fr;
    }

    .test-layouts-preview {
        grid-template-columns: repeat(3, 1fr);
    }

    .test-workflow-steps {
        gap: 0.75rem;
    }
}
