/**
 * STW ADA Compliance Checker — Styles
 *
 * @package SpeedToWin
 * @version 1.0.0
 */

/* ============================================================
   RESET & VARIABLES
   ============================================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --stw-red:       #C41E3A;
    --stw-dark-red:  #8B0000;
    --stw-black:     #1A1A1A;
    --stw-dark:      #2C2C2C;
    --stw-grey:      #555555;
    --stw-light:     #F4F4F6;
    --stw-white:     #FFFFFF;
    --stw-green:     #27AE60;
    --stw-orange:    #E67E22;
    --stw-yellow:    #F1C40F;
    --stw-blue:      #2980B9;
    --stw-radius:    8px;
    --stw-shadow:    0 2px 12px rgba(0,0,0,0.08);
    --stw-shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --stw-font:      -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --stw-mono:      'SF Mono', 'Cascadia Code', 'Consolas', 'Courier New', monospace;
}

body {
    font-family: var(--stw-font);
    background: var(--stw-light);
    color: var(--stw-black);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============================================================
   HEADER
   ============================================================ */
.stw-header {
    background: var(--stw-black);
    color: var(--stw-white);
    padding: 20px 0;
    border-bottom: 4px solid var(--stw-red);
}

.stw-header__inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.stw-header__title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.stw-header__title span {
    color: var(--stw-red);
}

.stw-header__badge {
    font-size: 12px;
    font-weight: 600;
    background: var(--stw-red);
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ============================================================
   MAIN CONTAINER
   ============================================================ */
.stw-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px 60px;
}

/* ============================================================
   URL INPUT FORM
   ============================================================ */
.stw-form {
    background: var(--stw-white);
    border-radius: var(--stw-radius);
    box-shadow: var(--stw-shadow-lg);
    padding: 32px;
    margin-bottom: 32px;
}

.stw-form__label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--stw-grey);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stw-form__row {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.stw-form__input {
    flex: 1;
    font-family: var(--stw-mono);
    font-size: 16px;
    padding: 14px 18px;
    border: 2px solid #DDD;
    border-radius: var(--stw-radius);
    outline: none;
    transition: border-color 0.2s;
    background: var(--stw-light);
    color: var(--stw-black);
}

.stw-form__input:focus {
    border-color: var(--stw-red);
    background: var(--stw-white);
}

.stw-form__input::placeholder {
    color: #AAA;
}

.stw-form__btn {
    font-family: var(--stw-font);
    font-size: 16px;
    font-weight: 800;
    padding: 14px 32px;
    background: var(--stw-red);
    color: var(--stw-white);
    border: none;
    border-radius: var(--stw-radius);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
}

.stw-form__btn:hover {
    background: var(--stw-dark-red);
}

.stw-form__btn:active {
    transform: scale(0.98);
}

.stw-form__btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ============================================================
   SPINNER / PROGRESS
   ============================================================ */
.stw-progress {
    display: none;
    text-align: center;
    padding: 60px 20px;
    background: var(--stw-white);
    border-radius: var(--stw-radius);
    box-shadow: var(--stw-shadow);
    margin-bottom: 32px;
}

.stw-progress.active {
    display: block;
}

.stw-spinner {
    display: inline-block;
    width: 56px;
    height: 56px;
    border: 5px solid #E0E0E0;
    border-top-color: var(--stw-red);
    border-radius: 50%;
    animation: stw-spin 0.8s linear infinite;
    margin-bottom: 20px;
}

@keyframes stw-spin {
    to { transform: rotate(360deg); }
}

.stw-progress__text {
    font-size: 16px;
    font-weight: 600;
    color: var(--stw-grey);
}

.stw-progress__step {
    font-size: 13px;
    color: #999;
    margin-top: 8px;
}

/* ============================================================
   ERROR
   ============================================================ */
.stw-error {
    display: none;
    background: #FDF0F0;
    border: 2px solid #E74C3C;
    border-radius: var(--stw-radius);
    padding: 20px 24px;
    margin-bottom: 24px;
    color: #C0392B;
    font-weight: 600;
}

.stw-error.active {
    display: block;
}

/* ============================================================
   RESULTS
   ============================================================ */
.stw-results {
    display: none;
}

.stw-results.active {
    display: block;
}

/* Score Card */
.stw-score {
    background: var(--stw-white);
    border-radius: var(--stw-radius);
    box-shadow: var(--stw-shadow-lg);
    padding: 32px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
}

.stw-score__circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 6px solid;
}

.stw-score__number {
    font-size: 36px;
    font-weight: 900;
    line-height: 1;
}

.stw-score__grade {
    font-size: 14px;
    font-weight: 700;
    margin-top: 2px;
}

.stw-score--green  .stw-score__circle { border-color: var(--stw-green); color: var(--stw-green); background: #F0FFF4; }
.stw-score--yellow .stw-score__circle { border-color: var(--stw-yellow); color: #B7950B; background: #FFFEF0; }
.stw-score--orange .stw-score__circle { border-color: var(--stw-orange); color: var(--stw-orange); background: #FFF8F0; }
.stw-score--red    .stw-score__circle { border-color: var(--stw-red); color: var(--stw-red); background: #FFF0F0; }

.stw-score__details {
    flex: 1;
}

.stw-score__title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 12px;
}

.stw-score__counts {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stw-score__count {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
}

.stw-score__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.stw-score__dot--critical { background: var(--stw-red); }
.stw-score__dot--serious  { background: var(--stw-orange); }
.stw-score__dot--moderate { background: var(--stw-yellow); }
.stw-score__dot--minor    { background: #999; }

.stw-score__meta {
    font-size: 12px;
    color: #999;
    margin-top: 12px;
}

/* Action Buttons */
.stw-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.stw-actions__btn {
    font-family: var(--stw-font);
    font-size: 14px;
    font-weight: 700;
    padding: 12px 24px;
    border: 2px solid var(--stw-red);
    border-radius: var(--stw-radius);
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stw-actions__btn--primary {
    background: var(--stw-red);
    color: var(--stw-white);
}

.stw-actions__btn--primary:hover {
    background: var(--stw-dark-red);
    border-color: var(--stw-dark-red);
}

.stw-actions__btn--secondary {
    background: var(--stw-white);
    color: var(--stw-red);
}

.stw-actions__btn--secondary:hover {
    background: var(--stw-red);
    color: var(--stw-white);
}

.stw-actions__btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Filter Tabs */
.stw-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stw-filter {
    font-family: var(--stw-font);
    font-size: 13px;
    font-weight: 700;
    padding: 8px 16px;
    border: 2px solid #DDD;
    border-radius: 20px;
    background: var(--stw-white);
    cursor: pointer;
    transition: all 0.2s;
    color: var(--stw-grey);
}

.stw-filter:hover {
    border-color: var(--stw-red);
    color: var(--stw-red);
}

.stw-filter.active {
    background: var(--stw-red);
    border-color: var(--stw-red);
    color: var(--stw-white);
}

/* Issue Cards */
.stw-issues {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stw-issue {
    background: var(--stw-white);
    border-radius: var(--stw-radius);
    box-shadow: var(--stw-shadow);
    padding: 20px 24px;
    border-left: 5px solid;
    transition: box-shadow 0.2s;
}

.stw-issue:hover {
    box-shadow: var(--stw-shadow-lg);
}

.stw-issue--critical { border-left-color: var(--stw-red); }
.stw-issue--serious  { border-left-color: var(--stw-orange); }
.stw-issue--moderate { border-left-color: var(--stw-yellow); }
.stw-issue--minor    { border-left-color: #BBB; }

.stw-issue__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.stw-issue__badge {
    font-size: 11px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--stw-white);
    flex-shrink: 0;
}

.stw-issue__badge--critical { background: var(--stw-red); }
.stw-issue__badge--serious  { background: var(--stw-orange); }
.stw-issue__badge--moderate { background: #D4A017; }
.stw-issue__badge--minor    { background: #999; }

.stw-issue__wcag {
    font-size: 12px;
    font-weight: 700;
    color: var(--stw-grey);
    font-family: var(--stw-mono);
}

.stw-issue__rule {
    font-size: 12px;
    color: #999;
    font-family: var(--stw-mono);
}

.stw-issue__message {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--stw-black);
    line-height: 1.5;
}

.stw-issue__snippet {
    font-family: var(--stw-mono);
    font-size: 12px;
    background: var(--stw-light);
    border: 1px solid #E0E0E0;
    border-radius: 4px;
    padding: 10px 14px;
    margin-bottom: 10px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--stw-dark);
    max-height: 120px;
    overflow-y: auto;
}

.stw-issue__fix {
    font-size: 13px;
    color: var(--stw-blue);
    font-weight: 600;
    padding: 8px 12px;
    background: #F0F7FF;
    border-radius: 4px;
    line-height: 1.5;
}

.stw-issue__fix::before {
    content: "\2192  Fix: ";
    font-weight: 800;
}

/* No issues */
.stw-no-issues {
    text-align: center;
    padding: 40px;
    background: var(--stw-white);
    border-radius: var(--stw-radius);
    box-shadow: var(--stw-shadow);
}

.stw-no-issues__icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.stw-no-issues__text {
    font-size: 18px;
    font-weight: 700;
    color: var(--stw-green);
}

/* ============================================================
   FOOTER
   ============================================================ */
.stw-footer {
    text-align: center;
    padding: 24px;
    font-size: 12px;
    color: #999;
}

.stw-footer a {
    color: var(--stw-red);
    text-decoration: none;
    font-weight: 700;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
    .stw-form__row {
        flex-direction: column;
    }

    .stw-form__btn {
        width: 100%;
        text-align: center;
    }

    .stw-score {
        flex-direction: column;
        text-align: center;
    }

    .stw-score__counts {
        justify-content: center;
    }

    .stw-header__inner {
        flex-direction: column;
        text-align: center;
    }

    .stw-actions {
        flex-direction: column;
    }

    .stw-actions__btn {
        width: 100%;
        text-align: center;
    }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
    .stw-header,
    .stw-form,
    .stw-actions,
    .stw-filters,
    .stw-footer,
    .stw-progress {
        display: none !important;
    }

    .stw-results {
        display: block !important;
    }

    .stw-issue {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .stw-spinner {
        animation: none;
        border-top-color: var(--stw-red);
        opacity: 0.6;
    }
}
