/* Page Speed Tester - Styles */

.pst-container {
    max-width: 700px;
    margin: 30px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.pst-form-wrapper {
    background: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    border: 1px solid #e5e7eb;
}

.pst-title {
    margin: 0 0 8px 0;
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    text-align: center;
}

.pst-subtitle {
    margin: 0 0 30px 0;
    font-size: 15px;
    color: #6b7280;
    text-align: center;
}

.pst-input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}

.pst-url-input {
    flex: 1;
    padding: 14px 18px;
    font-size: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    outline: none;
    transition: all 0.2s;
}

.pst-url-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.pst-test-button {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.pst-test-button:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.pst-test-button:active {
    transform: translateY(0);
}

.pst-test-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.pst-error {
    padding: 12px 16px;
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #dc2626;
    font-size: 14px;
}

.pst-loading {
    text-align: center;
    padding: 60px 40px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    border: 1px solid #e5e7eb;
    margin-top: 20px;
}

.pst-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: pst-spin 0.8s linear infinite;
}

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

.pst-loading p {
    color: #6b7280;
    font-size: 15px;
    margin: 0;
}

.pst-results {
    background: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    border: 1px solid #e5e7eb;
    margin-top: 20px;
}

.pst-results-title {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    text-align: center;
}

.pst-tested-url {
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 35px;
    word-break: break-all;
}

.pst-scores {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    justify-content: center;
    align-items: flex-start;
}

.pst-score-card {
    text-align: center;
    flex: 0 1 auto;
    min-width: 0;
}

.pst-score-label {
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
}

.pst-score-circle {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 15px;
}

.pst-score-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.pst-circle-bg {
    fill: none;
    stroke: #f3f4f6;
    stroke-width: 8;
}

.pst-circle-progress {
    fill: none;
    stroke: #3b82f6;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 339.292;
    stroke-dashoffset: 339.292;
    transition: stroke-dashoffset 1s ease, stroke 0.3s ease;
}

.pst-score-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 36px;
    font-weight: 700;
    color: #1f2937;
}

.pst-score-grade {
    font-size: 20px;
    font-weight: 700;
    padding: 8px 20px;
    border-radius: 25px;
    display: inline-block;
}

/* Color grades */
.pst-grade-a {
    background: #d1fae5;
    color: #065f46;
}

.pst-grade-b {
    background: #dbeafe;
    color: #1e40af;
}

.pst-grade-c {
    background: #fef3c7;
    color: #92400e;
}

.pst-grade-d {
    background: #fed7aa;
    color: #9a3412;
}

.pst-grade-f {
    background: #fee2e2;
    color: #991b1b;
}

/* Progress circle colors */
.pst-progress-a {
    stroke: #10b981;
}

.pst-progress-b {
    stroke: #3b82f6;
}

.pst-progress-c {
    stroke: #f59e0b;
}

.pst-progress-d {
    stroke: #f97316;
}

.pst-progress-f {
    stroke: #ef4444;
}

.pst-test-again {
    display: block;
    margin: 0 auto;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    color: #3b82f6;
    background: #eff6ff;
    border: 2px solid #3b82f6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.pst-test-again:hover {
    background: #3b82f6;
    color: #ffffff;
}

/* Compact Mode */
.pst-compact .pst-form-wrapper {
    padding: 20px;
}

.pst-compact .pst-input-group {
    margin-bottom: 10px;
}

.pst-compact .pst-loading {
    padding: 30px 20px;
}

.pst-compact .pst-loading p {
    font-size: 14px;
}

.pst-compact .pst-results {
    padding: 20px;
}

.pst-compact .pst-results-title {
    font-size: 18px;
    margin-bottom: 8px;
}

.pst-compact .pst-tested-url {
    font-size: 12px;
    margin-bottom: 20px;
}

.pst-compact .pst-scores {
    gap: 15px;
    margin-bottom: 20px;
}

.pst-compact .pst-score-circle {
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
}

.pst-compact .pst-score-value {
    font-size: 24px;
}

.pst-compact .pst-score-label {
    font-size: 11px;
    margin-bottom: 10px;
}

.pst-compact .pst-score-grade {
    font-size: 16px;
    padding: 4px 12px;
}

.pst-compact .pst-test-again {
    padding: 8px 20px;
    font-size: 13px;
}

/* Inline Style - Button overlaps input on the right */
.pst-inline .pst-input-group {
    position: relative;
}

.pst-inline .pst-url-input {
    padding-right: 100px;
}

.pst-inline .pst-test-button {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    padding: 10px 24px;
    margin: 0;
}

/* Stacked Style - Button below input, full width */
.pst-stacked .pst-input-group {
    flex-direction: column;
    gap: 8px;
}

.pst-stacked .pst-test-button {
    width: 100%;
}

/* Responsive */
@media (max-width: 600px) {
    .pst-form-wrapper,
    .pst-results {
        padding: 25px;
    }
    
    .pst-input-group {
        flex-direction: column;
    }
    
    .pst-test-button {
        width: 100%;
    }
    
    /* Inline style adjustments for mobile */
    .pst-inline .pst-url-input {
        padding-right: 90px;
    }
    
    .pst-inline .pst-test-button {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    /* Keep scores in one row even on mobile */
    .pst-scores {
        gap: 15px;
    }
    
    .pst-score-circle {
        width: 100px;
        height: 100px;
    }
    
    .pst-score-value {
        font-size: 28px;
    }
    
    .pst-score-label {
        font-size: 12px;
    }
    
    .pst-score-grade {
        font-size: 16px;
    }
    
    /* Compact mode on mobile */
    .pst-compact .pst-score-circle {
        width: 60px;
        height: 60px;
    }
    
    .pst-compact .pst-score-value {
        font-size: 18px;
    }
    
    .pst-compact .pst-score-label {
        font-size: 10px;
        margin-bottom: 6px;
    }
    
    .pst-compact .pst-score-grade {
        font-size: 14px;
        padding: 3px 10px;
    }
    
    .pst-compact .pst-scores {
        gap: 10px;
    }
}

/* Very small screens */
@media (max-width: 400px) {
    .pst-score-circle {
        width: 80px;
        height: 80px;
    }
    
    .pst-score-value {
        font-size: 22px;
    }
    
    .pst-compact .pst-score-circle {
        width: 50px;
        height: 50px;
    }
    
    .pst-compact .pst-score-value {
        font-size: 16px;
    }
    
    /* Stack inline style on very small screens */
    .pst-inline .pst-input-group {
        flex-direction: column;
        position: static;
    }
    
    .pst-inline .pst-url-input {
        padding-right: 18px;
    }
    
    .pst-inline .pst-test-button {
        position: static;
        transform: none;
        width: 100%;
    }
}

/* Container queries for ultra-tight spaces (like col-md-3) */
@supports (container-type: inline-size) {
    .pst-container {
        container-type: inline-size;
    }
    
    @container (max-width: 400px) {
        .pst-scores {
            gap: 8px;
        }
        
        .pst-score-circle {
            width: 70px;
            height: 70px;
        }
        
        .pst-score-value {
            font-size: 20px;
        }
        
        .pst-score-label {
            font-size: 10px;
        }
        
        .pst-score-grade {
            font-size: 14px;
        }
    }
    
    @container (max-width: 300px) {
        .pst-scores {
            gap: 5px;
        }
        
        .pst-score-circle {
            width: 50px;
            height: 50px;
        }
        
        .pst-score-value {
            font-size: 16px;
        }
        
        .pst-score-label {
            font-size: 9px;
        }
    }
}
