/* ===== Advanced Website Speed Analyzer Styles ===== */

.wsa-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 15px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: #1e1e2f;
}

/* ===== HEADER ===== */
.wsa-header {
    text-align: center;
    padding: 30px 0 20px;
}

.wsa-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: #1e1e2f;
}

.wsa-title i {
    color: #6c5ce7;
}

.wsa-subtitle {
    font-size: 1.05rem;
    color: #6b7280;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== FORM ===== */
.wsa-form-container {
    max-width: 700px;
    margin: 0 auto 20px;
}

.wsa-input-group {
    display: flex;
    gap: 10px;
    background: #fff;
    border-radius: 60px;
    padding: 4px 4px 4px 24px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
    border: 2px solid #e2e8f0;
    transition: all 0.3s;
}

.wsa-input-group:focus-within {
    border-color: #6c5ce7;
    box-shadow: 0 4px 24px rgba(108,92,231,0.12);
}

.wsa-input {
    flex: 1;
    border: none !important;
    outline: none;
    padding: 16px 0;
    font-size: 1rem;
    background: transparent;
    color: #1e1e2f;
}

.wsa-input::placeholder {
    color: #a0aec0;
}

.wsa-btn-primary {
    background: #6c5ce7;
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 12px 32px;
    border-radius: 60px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    font-size: 0.95rem;
}

.wsa-btn-primary:hover {
    background: #5a4bd1;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(108,92,231,0.3);
}

.wsa-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.wsa-error {
    color: #d63031;
    padding: 12px 20px;
    margin-top: 12px;
    background: #fde8e8;
    border-radius: 12px;
    display: none;
    font-weight: 500;
}

/* ===== LOADING ===== */
.wsa-loader {
    text-align: center;
    padding: 60px 20px;
}

.wsa-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #e2e8f0;
    border-top-color: #6c5ce7;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

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

.wsa-loading-text {
    font-size: 1.1rem;
    color: #6b7280;
    font-weight: 500;
}

.wsa-progress-bar {
    max-width: 400px;
    margin: 15px auto 0;
    height: 6px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.wsa-progress-bar #wsa-progress {
    height: 100%;
    background: linear-gradient(90deg, #6c5ce7, #a29bfe);
    border-radius: 4px;
    transition: width 0.5s;
    width: 0%;
}

/* ===== RESULTS ===== */
.wsa-results-container {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
    padding: 35px;
    border: 1px solid #e2e8f0;
    animation: fadeUp 0.6s ease;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== RESULTS HEADER ===== */
.wsa-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 25px;
}

.wsa-results-url {
    font-size: 0.95rem;
    color: #6b7280;
    font-weight: 500;
}

.wsa-results-url i {
    color: #6c5ce7;
    margin-right: 8px;
}

.wsa-results-url span {
    color: #1e1e2f;
    font-weight: 600;
}

.wsa-results-date {
    font-size: 0.85rem;
    color: #6b7280;
}

.wsa-results-date i {
    margin-right: 6px;
}

/* ===== SCORE SECTION ===== */
.wsa-score-section {
    padding: 10px 0 30px;
}

.wsa-score-wrapper {
    display: flex;
    align-items: center;
    gap: 50px;
    flex-wrap: wrap;
    justify-content: center;
}

.wsa-score-circle {
    position: relative;
    width: 150px;
    height: 150px;
    flex-shrink: 0;
}

.wsa-score-svg {
    transform: rotate(-90deg);
}

.wsa-score-svg circle {
    transition: stroke-dashoffset 1s ease;
}

.wsa-score-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.wsa-score-number {
    display: block;
    font-size: 2.8rem;
    font-weight: 800;
    color: #1e1e2f;
    line-height: 1;
}

.wsa-score-label {
    font-size: 0.7rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wsa-score-details {
    flex: 1;
    min-width: 200px;
}

.wsa-score-grade {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.wsa-score-grade.excellent { color: #00b894; }
.wsa-score-grade.good { color: #fdcb6e; }
.wsa-score-grade.average { color: #e17055; }
.wsa-score-grade.poor { color: #d63031; }

.wsa-score-metrics {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: #6b7280;
}

.wsa-score-metric i {
    margin-right: 4px;
}

.wsa-score-metric strong {
    color: #1e1e2f;
}

.wsa-score-recommendation {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: #f8faff;
    border-radius: 12px;
    font-size: 0.9rem;
    color: #1e1e2f;
    border-left: 4px solid #6c5ce7;
}

.wsa-score-recommendation i {
    color: #fdcb6e;
    font-size: 1.2rem;
}

/* ===== CORE WEB VITALS ===== */
.wsa-cwv-section {
    margin-bottom: 30px;
}

.wsa-cwv-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wsa-cwv-section h3 i {
    color: #6c5ce7;
}

.wsa-cwv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.wsa-cwv-card {
    background: #f8faff;
    padding: 18px 20px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s;
}

.wsa-cwv-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.wsa-cwv-icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.wsa-cwv-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wsa-cwv-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e1e2f;
    margin: 4px 0;
}

.wsa-cwv-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 8px;
}

.wsa-cwv-status.good { background: #d4edda; color: #155724; }
.wsa-cwv-status.needs-improvement { background: #fff3cd; color: #856404; }
.wsa-cwv-status.poor { background: #f8d7da; color: #721c24; }

.wsa-cwv-bar {
    height: 4px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.wsa-cwv-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease;
}

.wsa-cwv-bar-fill.good { background: #00b894; }
.wsa-cwv-bar-fill.needs-improvement { background: #fdcb6e; }
.wsa-cwv-bar-fill.poor { background: #d63031; }

/* ===== METRICS SECTION ===== */
.wsa-metrics-section {
    margin-bottom: 30px;
}

.wsa-metrics-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wsa-metrics-section h3 i {
    color: #6c5ce7;
}

.wsa-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.wsa-metric-card {
    background: #f8faff;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    text-align: center;
    transition: all 0.3s;
}

.wsa-metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.wsa-metric-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e1e2f;
}

.wsa-metric-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 4px;
}

.wsa-metric-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 600;
    margin-top: 6px;
}

.wsa-metric-status.good { background: #d4edda; color: #155724; }
.wsa-metric-status.warning { background: #fff3cd; color: #856404; }
.wsa-metric-status.bad { background: #f8d7da; color: #721c24; }

/* ===== CHARTS ===== */
.wsa-charts-section {
    margin-bottom: 30px;
}

.wsa-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.wsa-chart-card {
    background: #f8faff;
    padding: 20px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
}

.wsa-chart-card h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #1e1e2f;
}

/* ===== RECOMMENDATIONS ===== */
.wsa-recommendations-section {
    margin-bottom: 30px;
}

.wsa-recommendations-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wsa-recommendations-section h3 i {
    color: #6c5ce7;
}

.wsa-recommendation {
    padding: 16px 20px;
    margin-bottom: 12px;
    border-radius: 14px;
    border-left: 4px solid #6c5ce7;
    background: #f8faff;
    transition: all 0.3s;
}

.wsa-recommendation:hover {
    background: #f0f3ff;
}

.wsa-recommendation.priority-high { border-left-color: #d63031; }
.wsa-recommendation.priority-medium { border-left-color: #fdcb6e; }
.wsa-recommendation.priority-low { border-left-color: #00b894; }

.wsa-recommendation h4 {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 600;
}

.wsa-recommendation p {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 4px 0 8px;
}

.wsa-recommendation .wsa-rec-meta {
    font-size: 0.75rem;
    color: #6b7280;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.wsa-recommendation .wsa-rec-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.wsa-recommendation .wsa-rec-meta .priority-high-label { color: #d63031; font-weight: 600; }
.wsa-recommendation .wsa-rec-meta .priority-medium-label { color: #fdcb6e; font-weight: 600; }
.wsa-recommendation .wsa-rec-meta .priority-low-label { color: #00b894; font-weight: 600; }

/* ===== DETAILS ===== */
.wsa-details-section {
    margin-bottom: 25px;
}

.wsa-details-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wsa-details-section h3 i {
    color: #6c5ce7;
}

.wsa-details-table-wrapper {
    background: #f8faff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.wsa-details-table-wrapper table {
    width: 100%;
    border-collapse: collapse;
}

.wsa-details-table-wrapper th {
    background: #eef2f7;
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 0.85rem;
    color: #1e1e2f;
}

.wsa-details-table-wrapper td {
    padding: 10px 16px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.85rem;
}

.wsa-details-table-wrapper tr:last-child td {
    border-bottom: none;
}

.wsa-details-table-wrapper tr:hover td {
    background: #f0f3ff;
}

.wsa-details-table-wrapper .wsa-detail-label {
    font-weight: 500;
    color: #1e1e2f;
}

.wsa-details-table-wrapper .wsa-detail-value {
    color: #6b7280;
}

/* ===== ACTIONS ===== */
.wsa-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
    justify-content: center;
}

.wsa-btn-outline {
    background: transparent;
    border: 1.5px solid #e2e8f0;
    padding: 10px 20px;
    border-radius: 60px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #1e1e2f;
    font-weight: 500;
}

.wsa-btn-outline:hover {
    border-color: #6c5ce7;
    color: #6c5ce7;
    background: rgba(108,92,231,0.04);
}

.wsa-actions .wsa-btn-primary {
    padding: 10px 24px;
    font-size: 0.9rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .wsa-charts-row {
        grid-template-columns: 1fr;
    }
    
    .wsa-score-wrapper {
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .wsa-title {
        font-size: 1.6rem;
    }
    
    .wsa-input-group {
        flex-direction: column;
        padding: 16px;
        border-radius: 16px;
    }
    
    .wsa-btn-primary {
        width: 100%;
        justify-content: center;
        padding: 14px;
    }
    
    .wsa-results-container {
        padding: 20px;
    }
    
    .wsa-score-wrapper {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    .wsa-score-details {
        text-align: center;
        width: 100%;
    }
    
    .wsa-score-metrics {
        justify-content: center;
    }
    
    .wsa-cwv-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .wsa-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .wsa-results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .wsa-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .wsa-actions button {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .wsa-cwv-grid {
        grid-template-columns: 1fr;
    }
    
    .wsa-metrics-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .wsa-metric-card {
        padding: 12px;
    }
    
    .wsa-metric-value {
        font-size: 1rem;
    }
    
    .wsa-score-circle {
        width: 120px;
        height: 120px;
    }
    
    .wsa-score-number {
        font-size: 2.2rem;
    }
}