/* Website Speed Test Plugin Styles */
.speed-test-widget {
    max-width: 1200px;
    margin: 40px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.speed-test-container {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid #e1e5e9;
}

/* Test Input Section */
.test-input-section {
    padding: 50px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
}

.section-header {
    margin-bottom: 40px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.section-title i {
    font-size: 2.2rem;
}

.section-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 400;
}

.input-group {
    max-width: 600px;
    margin: 0 auto;
}

.url-input-container {
    display: flex;
    background: white;
    border-radius: 15px;
    padding: 5px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.input-icon {
    padding: 15px 20px;
    color: #7f8c8d;
    font-size: 1.2rem;
}

.url-input {
    flex: 1;
    border: none;
    padding: 15px 0;
    font-size: 1.1rem;
    color: #2c3e50;
    background: transparent;
    outline: none;
}

.url-input::placeholder {
    color: #bdc3c7;
}

.test-btn {
    background: linear-gradient(135deg, #27ae60, #219a52);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.test-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

.test-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Loading State */
.loading-state {
    padding: 60px 40px;
    text-align: center;
    background: #f8f9fa;
}

.loading-content h3 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 30px;
}

.loading-spinner {
    font-size: 3rem;
    color: #3498db;
    margin-bottom: 30px;
}

.loading-steps {
    max-width: 400px;
    margin: 0 auto;
    text-align: left;
}

.loading-step {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #e1e5e9;
    color: #bdc3c7;
    transition: color 0.3s ease;
}

.loading-step.active {
    color: #3498db;
}

.loading-step i {
    width: 20px;
    text-align: center;
}

.loading-step:last-child {
    border-bottom: none;
}

/* Results Section */
.results-section {
    padding: 40px;
}

.results-header {
    text-align: center;
    margin-bottom: 40px;
}

.results-header h3 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.results-url {
    color: #7f8c8d;
    font-size: 1.1rem;
    word-break: break-all;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.metric-card {
    background: white;
    padding: 30px 25px;
    border-radius: 15px;
    text-align: center;
    border: 2px solid #f1f2f6;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.metric-card.loading-time::before { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.metric-card.page-size::before { background: linear-gradient(135deg, #f39c12, #e67e22); }
.metric-card.performance-score::before { background: linear-gradient(135deg, #27ae60, #219a52); }

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.metric-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2rem;
    color: white;
}

.metric-icon.loading-time { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.metric-icon.page-size { background: linear-gradient(135deg, #f39c12, #e67e22); }
.metric-icon.performance-score { background: linear-gradient(135deg, #27ae60, #219a52); }

.metric-label {
    display: block;
    font-size: 1rem;
    color: #7f8c8d;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.metric-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: #2c3e50;
    line-height: 1;
    margin-bottom: 5px;
}

.metric-unit {
    font-size: 1rem;
    color: #bdc3c7;
    font-weight: 600;
}

/* Chart Section */
.chart-section {
    background: #f8f9fa;
    padding: 40px;
    border-radius: 15px;
    margin-bottom: 40px;
}

.chart-container {
    max-width: 600px;
    margin: 0 auto;
    height: 300px;
}

/* Analysis Section */
.analysis-section {
    margin-bottom: 40px;
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.analysis-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    border: 1px solid #e1e5e9;
}

.analysis-title {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.analysis-title i {
    color: #3498db;
}

/* Breakdown List */
.breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #3498db;
}

.breakdown-name {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #2c3e50;
}

.breakdown-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.breakdown-size {
    font-weight: 700;
    color: #2c3e50;
}

/* Timeline */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.timeline-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.timeline-item:hover {
    background: #e8f4fc;
    transform: translateX(5px);
}

.timeline-event {
    font-weight: 600;
    color: #2c3e50;
}

.timeline-time {
    background: #3498db;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Recommendations */
.recommendations-section {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 40px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.recommendations-title {
    text-align: center;
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
}

.recommendation-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    border-left: 4px solid #3498db;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.recommendation-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.recommendation-card.high { border-left-color: #e74c3c; }
.recommendation-card.medium { border-left-color: #f39c12; }
.recommendation-card.low { border-left-color: #27ae60; }

.recommendation-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.recommendation-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #3498db;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.recommendation-card.high .recommendation-icon { background: #e74c3c; }
.recommendation-card.medium .recommendation-icon { background: #f39c12; }
.recommendation-card.low .recommendation-icon { background: #27ae60; }

.recommendation-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.recommendation-description {
    color: #7f8c8d;
    line-height: 1.6;
    margin: 0;
}

/* Test Again Section */
.test-again-section {
    text-align: center;
}

.test-again-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.test-again-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

/* Error State */
.error-state {
    padding: 60px 40px;
    text-align: center;
    background: #f8f9fa;
}

.error-content h3 {
    font-size: 1.8rem;
    color: #e74c3c;
    margin-bottom: 15px;
}

.error-icon {
    font-size: 4rem;
    color: #e74c3c;
    margin-bottom: 20px;
}

.error-content p {
    font-size: 1.1rem;
    color: #7f8c8d;
    margin-bottom: 30px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.retry-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.retry-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .speed-test-container {
        margin: 20px;
    }
    
    .test-input-section {
        padding: 40px 20px;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .url-input-container {
        flex-direction: column;
        gap: 10px;
        padding: 20px;
    }
    
    .input-icon {
        display: none;
    }
    
    .results-section {
        padding: 30px 20px;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .analysis-grid {
        grid-template-columns: 1fr;
    }
    
    .recommendations-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-section {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1.6rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .metric-value {
        font-size: 2rem;
    }
    
    .analysis-card {
        padding: 20px 15px;
    }
    
    .recommendations-section {
        padding: 30px 20px;
    }
}

/* Performance Score Colors */
.performance-excellent { color: #27ae60 !important; }
.performance-good { color: #f39c12 !important; }
.performance-poor { color: #e74c3c !important; }