/**
 * CX Maturity Audit Styles
 * Version: 1.1
 * Upload to: /wp-content/themes/kleo-child/cx-maturity-audit/css/audit-styles.css
 * 
 * Changelog v1.1:
 * - Fixed button positioning: changed justify-content from space-between to flex-end
 *   so all buttons (Begin Audit, Q1 Next, etc.) align to the right consistently
 */

/* Container */
.audit-main-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
}

/* Header */
.audit-header {
    text-align: center;
    margin-bottom: 40px;
}

.audit-title {
    font-size: 36px;
    font-weight: 700;
    color: #023d1f;
    margin-bottom: 10px;
}

.audit-subtitle {
    font-size: 18px;
    color: #666;
    max-width: 700px;
    margin: 0 auto;
}

/* Cards */
.audit-card {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.required {
    color: #d9534f;
}

.form-group select,
.form-group input[type="text"] {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.3s;
}

.form-group select:focus,
.form-group input[type="text"]:focus {
    outline: none;
    border-color: #023d1f;
}

/* Buttons */
.audit-btn {
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: none;
}

.audit-btn-primary {
    background: #023d1f;
    color: #fff;
}

.audit-btn-primary:hover {
    background: #014d27;
}

.audit-btn-secondary {
    background: #6c757d;
    color: #fff;
}

.audit-btn-secondary:hover {
    background: #5a6268;
}

.audit-btn-success {
    background: #28a745;
    color: #fff;
}

.audit-btn-success:hover {
    background: #218838;
}

.audit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Progress Bar */
.audit-progress-container {
    margin-bottom: 30px;
}

.progress-bar-wrapper {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar {
    height: 100%;
    background: #023d1f;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

/* Question Card */
.audit-question-card {
    min-height: 400px;
}

.question-pillar {
    display: inline-block;
    background: #023d1f;
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.question-number {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 600;
}

.question-text {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin-bottom: 30px;
    line-height: 1.4;
}

/* Answers */
.answers-container {
    margin-bottom: 30px;
}

.answer-option {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: flex-start;
}

.answer-option:hover {
    border-color: #023d1f;
    background: #f0f9f4;
}

.answer-option.selected {
    border-color: #023d1f;
    background: #e6f4ed;
}

.answer-option input[type="radio"] {
    margin-right: 12px;
    margin-top: 3px;
    cursor: pointer;
}

.answer-option label {
    cursor: pointer;
    flex: 1;
    font-size: 15px;
    line-height: 1.5;
    color: #333;
    font-weight: normal;
    margin: 0;
}

/* Question Navigation */
.question-nav {
    display: flex;
    gap: 12px;
    justify-content: flex-end;  /* Changed from space-between - buttons now always align right */
    margin-top: 30px;
}

/* Results */
.results-container {
    max-width: 900px;
}

.score-card-main {
    text-align: center;
    background: linear-gradient(135deg, #023d1f 0%, #014d27 100%);
    color: #fff;
}

.score-card-main h2 {
    color: #fff;
    margin-bottom: 20px;
}

.score-display {
    margin: 30px 0;
}

.score-number {
    font-size: 72px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 10px;
}

.score-number::after {
    content: '%';
    font-size: 48px;
}

.score-label {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 10px;
}

.score-stage {
    font-size: 24px;
    font-weight: 600;
    background: rgba(255,255,255,0.2);
    padding: 10px 20px;
    border-radius: 4px;
    display: inline-block;
}

/* Risk Warnings */
.risk-warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
    padding: 15px 20px;
    margin-top: 20px;
    border-radius: 4px;
}

.risk-warning strong {
    display: block;
    margin-bottom: 5px;
    font-size: 16px;
}

/* Spider Chart */
#spider-chart {
    max-width: 600px;
    margin: 20px auto;
}

/* Scores Table */
.scores-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.scores-table th,
.scores-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.scores-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.scores-table td {
    color: #666;
}

.score-positive {
    color: #28a745;
    font-weight: 600;
}

.score-negative {
    color: #dc3545;
    font-weight: 600;
}

.benchmark-note {
    font-size: 13px;
    color: #666;
    font-style: italic;
    margin-top: 10px;
}

/* Roadmap */
.roadmap-card h3 {
    color: #023d1f;
    margin-bottom: 20px;
}

.roadmap-intro {
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-style: italic;
    color: #666;
}

.roadmap-priority {
    background: #fff;
    border-left: 4px solid #023d1f;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.roadmap-priority h4 {
    color: #023d1f;
    margin-bottom: 10px;
    font-size: 18px;
}

.roadmap-priority p {
    color: #666;
    line-height: 1.6;
    margin: 0;
}

/* Results Actions */
.results-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Loading Overlay */
.audit-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: #fff;
}

.loading-spinner {
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid #fff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

/* Responsive */
@media (max-width: 768px) {
    .audit-main-container {
        padding: 15px;
    }

    .audit-title {
        font-size: 28px;
    }

    .audit-subtitle {
        font-size: 16px;
    }

    .audit-card {
        padding: 20px;
    }

    .question-text {
        font-size: 18px;
    }

    .score-number {
        font-size: 56px;
    }

    .question-nav {
        flex-direction: column;
    }

    .question-nav button {
        width: 100%;
    }
}

/* Print Styles */
@media print {
    .audit-header,
    .question-nav,
    .results-actions,
    .audit-loading {
        display: none !important;
    }

    .audit-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .score-card-main {
        background: #023d1f !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
