/* PageSpeed Tool Styles */

.pagespeed-tool-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.pagespeed-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 35px;
}

.pagespeed-title {
    font-size: 24px;
    font-weight: 600;
    color: #131628;
    margin: 0 0 8px 0;
    text-align: center;
}

.pagespeed-subtitle {
    font-size: 15px;
    color: #666;
    text-align: center;
    margin: 0 0 30px 0;
}

/* Form Styles */
.pagespeed-form {
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    gap: 15px;
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}

.input-wrapper {
    flex: 1;
    position: relative;
    margin-left: 15px;
}

.pagespeed-input {
    width: 100%;
    padding: 15px 20px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.pagespeed-input {
    padding-left: 15px !important;
}

.pagespeed-input:focus {
    border-color: #1356E3;
    box-shadow: 0 0 0 3px rgba(19, 86, 227, 0.1);
}

.pagespeed-submit-btn {
    padding: 15px 35px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    background: #1356E3;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pagespeed-submit-btn:hover:not(:disabled) {
    opacity: 0.9;
}

.pagespeed-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Loading State */
.pagespeed-loading {
    text-align: center;
    padding: 50px 20px;
}

.loading-content {
    display: inline-block;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f0f0f0;
    border-top-color: #1356E3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading-content p {
    font-size: 16px;
    color: #131628;
    margin: 10px 0;
}

.loading-subtext {
    font-size: 14px;
    color: #999;
}

/* Results Section */
.pagespeed-results {
    margin-top: 35px;
    animation: fadeIn 0.5s ease;
}

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

.results-title {
    font-size: 20px;
    font-weight: 600;
    color: #131628;
    margin: 0 0 20px 0;
    text-align: center;
}

/* Strategy Selector */
.strategy-selector {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 30px;
}

.strategy-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #131628;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.strategy-btn:hover {
    background: #e9ecef;
    border-color: #1356E3;
}

.strategy-btn.active {
    background: #1356E3;
    color: #ffffff;
    border-color: #1356E3;
}

.strategy-icon {
    font-size: 16px;
}

/* Scores Container */
.scores-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.score-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    transition: transform 0.2s ease;
}

.score-card:hover {
    transform: translateY(-2px);
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    position: relative;
    background: conic-gradient(from 0deg, var(--score-color) 0%, var(--score-color) var(--score-percent), #e0e0e0 var(--score-percent), #e0e0e0 100%);
}

.score-circle::before {
    content: '';
    position: absolute;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: #ffffff;
}

.score-value {
    position: relative;
    z-index: 1;
    font-size: 32px;
    font-weight: 700;
    color: var(--score-color);
}

.score-card.performance .score-circle {
    --score-color: #ea4335;
}

.score-card.accessibility .score-circle {
    --score-color: #4285f4;
}

.score-card.best-practices .score-circle {
    --score-color: #fbbc04;
}

.score-card.seo .score-circle {
    --score-color: #34a853;
}

.score-card h4 {
    font-size: 12px;
    font-weight: 500;
    color: #131628;
    margin: 0;
}

/* Metrics Container */
.metrics-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
}

.metrics-title {
    font-size: 18px;
    font-weight: 600;
    color: #131628;
    margin: 0 0 20px 0;
}

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

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #ffffff;
    border-radius: 8px;
    border-left: 3px solid #1356E3;
}

.metric-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.metric-value {
    font-size: 15px;
    font-weight: 600;
    color: #131628;
}

/* Opportunities */
.opportunities-container {
    margin-top: 30px;
}

.opportunities-title {
    font-size: 18px;
    font-weight: 600;
    color: #131628;
    margin: 0 0 20px 0;
}

.opportunities-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.opportunity-category {
    margin-bottom: 25px;
}

.category-title {
    font-size: 16px;
    font-weight: 600;
    color: #131628;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.category-title.performance {
    color: #ea4335;
    border-bottom-color: #ea4335;
}

.category-title.accessibility {
    color: #4285f4;
    border-bottom-color: #4285f4;
}

.category-title.best-practices {
    color: #fbbc04;
    border-bottom-color: #fbbc04;
}

.category-title.seo {
    color: #34a853;
    border-bottom-color: #34a853;
}

.category-opportunities {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hidden-opportunities {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.opportunity-item {
    background: #f0f4ff;
    border-left: 3px solid #1356E3;
    border-radius: 8px;
    padding: 15px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.opportunity-info {
    flex: 1;
}

.opportunity-title {
    font-size: 15px;
    font-weight: 600;
    color: #131628;
    margin: 0 0 8px 0;
}

.opportunity-description {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.opportunity-savings {
    font-size: 16px;
    font-weight: 600;
    color: #1356E3;
    margin-left: 20px;
}

.show-more-btn {
    margin-top: 15px;
    padding: 0;
    font-size: 14px;
    font-weight: 500;
    color: #1356E3;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.show-more-btn:hover {
    text-decoration: underline;
    color: #131628;
}

.show-more-btn.expanded {
    color: #1356E3;
}

.show-more-btn .btn-icon {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.hidden-opportunities {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Improvement Estimate */
.improvement-estimate {
    margin-top: 40px;
    padding: 35px;
    background: #131628;
    border-radius: 12px;
    border-top: none;
    animation: fadeIn 0.5s ease;
}

.improvement-estimate h3,
.improvement-estimate .estimate-title {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff !important;
    margin: 0 0 30px 0;
    text-align: center;
}

.estimate-content {
    max-width: 800px;
    margin: 0 auto;
}

.estimate-card {
    background: #131628;
    border-radius: 8px;
    padding: 30px;
    color: #ffffff;
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

.estimate-icon {
    font-size: 40px;
    line-height: 1;
}

.estimate-text {
    flex: 1;
}

.improvement-estimate h4,
.estimate-text h4,
#estimateTitle {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: #ffffff !important;
}

.estimate-text p {
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 25px 0;
    opacity: 0.9;
}

.estimate-scores {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.estimate-score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.estimate-score-item:last-child {
    border-bottom: none;
}

.estimate-label {
    font-size: 16px;
    opacity: 0.9;
}

.estimate-value {
    font-size: 20px;
    font-weight: 700;
}

.score-breakdown {
    font-size: 12px;
    font-weight: 400;
    opacity: 0.8;
    margin-left: 8px;
}

.estimate-value.current {
    color: #ffffff;
}

.estimate-value.expected {
    color: #1356E3;
}

.estimate-value.improvement {
    color: #1356E3;
}

.estimate-difficulty {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.difficulty-label {
    font-size: 16px;
    opacity: 0.9;
}

.difficulty-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
}

/* Error Message */
.pagespeed-error {
    margin-top: 30px;
    padding: 18px;
    background: #fff5f5;
    border-left: 3px solid #e53e3e;
    border-radius: 8px;
    animation: fadeIn 0.3s ease;
}

.error-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.error-icon {
    font-size: 20px;
}

.error-content p {
    margin: 0;
    color: #c53030;
    font-weight: 500;
    font-size: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    .pagespeed-container {
        padding: 25px 20px;
    }
    
    .pagespeed-title {
        font-size: 20px;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .pagespeed-submit-btn {
        width: 100%;
        justify-content: center;
    }
    
    .scores-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .estimate-card {
        flex-direction: column;
        text-align: center;
    }
    
    .estimate-scores {
        align-items: center;
    }
}

/* Contact Section */
.pagespeed-contact-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.estimate-card .pagespeed-contact-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.contact-title {
    font-size: 11px;
    font-weight: 500;
    color: #ffffff;
    margin: 0 0 15px 0;
    opacity: 0.9;
}

.contact-subtitle {
    font-size: 12px;
    color: #666;
    margin: 0 0 20px 0;
}

.contact-form {
    max-width: 100%;
    margin: 0 auto;
}

.contact-name-group {
    margin-bottom: 12px;
}

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

/* Styling for pagespeed-input i estimate-card */
.estimate-card .input-wrapper {
    margin-left: 0;
}

.estimate-card .pagespeed-input {
    padding: 12px 15px;
    font-size: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.estimate-card .pagespeed-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.estimate-card .pagespeed-input:focus {
    border-color: #1356E3;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(19, 86, 227, 0.2);
}

.contact-submit-btn {
    padding: 12px 25px;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    background: #1356E3;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.estimate-card .contact-submit-btn {
    background: #1356E3;
}

.contact-submit-btn:hover:not(:disabled) {
    opacity: 0.9;
}

.contact-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.contact-message {
    padding: 10px 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    margin-top: 10px;
    animation: fadeIn 0.3s ease;
}

.contact-message.success {
    background: rgba(40, 167, 69, 0.2);
    border-left: 3px solid #28a745;
    color: #ffffff;
}

.estimate-card .contact-message.success {
    background: rgba(40, 167, 69, 0.2);
    color: #ffffff;
}

.contact-message.error {
    background: rgba(229, 62, 62, 0.2);
    border-left: 3px solid #e53e3e;
    color: #ffffff;
}

.estimate-card .contact-message.error {
    background: rgba(229, 62, 62, 0.2);
    color: #ffffff;
}

.contact-message .message-icon {
    font-size: 18px;
    font-weight: bold;
}

.contact-message p {
    margin: 0;
    font-weight: 500;
}

/* Responsive Contact Form */
@media (max-width: 768px) {
    .contact-input-group {
        flex-direction: column;
    }
    
    .contact-submit-btn {
        width: 100%;
        justify-content: center;
    }
    
    .input-wrapper {
        margin-left: 0;
    }
    
    .estimate-card .input-wrapper {
        margin-left: 0;
    }
}


