/* Form Styling */
.pagespeed-form-container {
    background: #fff;
    border: 1px solid #c3c4c7;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    padding: 20px;
    margin: 20px 0;
    border-radius: 4px;
}

.pagespeed-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: end;
}

.pagespeed-form-column {
    display: flex;
    flex-direction: column;
}

.pagespeed-form-column label {
    font-weight: 600;
    margin-bottom: 5px;
}

.pagespeed-form-column select {
    width: 100%;
}

/* Results Panel */
.results-panel {
    background: #fff;
    border: 1px solid #c3c4c7;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    margin: 20px 0;
    padding: 20px;
    border-radius: 4px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.device-results {
    text-align: center;
}

.device-results h3 {
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* Score Circle */
.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    border: 4px solid;
    align-content: center;
    flex-wrap: wrap;
    align-items: center;
}

.score-circle.good {
    border-color: #0c6;
    background-color: rgba(0, 204, 102, 0.1);
}

.score-circle.average {
    border-color: #fa3;
    background-color: rgba(255, 170, 51, 0.1);
}

.score-circle.poor {
    border-color: #dc3232;
    background-color: rgba(220, 50, 50, 0.1);
}

.score-circle .score-label {
    font-size: 12px;
    text-transform: uppercase;
    color: #50575e;
}

.score-circle .score-value {
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
}

/* Scores Grid */
.scores-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 0;
}

.score-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #e2e4e7;
    text-align: center;
}

.score-item .score-label {
    display: block;
    font-size: 16px;
    color: #646970;
    margin-bottom: 8px;
}

.score-item .score {
    font-size: 16px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    display: inline-block;
    min-width: 60px;
    text-align: center;
}

/* Score colors with background */
.scores-grid .good {
    background-color: rgba(0, 204, 102, 0.1);
    color: #0c6;
}

.scores-grid .average {
    background-color: rgba(255, 170, 51, 0.1);
    color: #fa3;
}

.scores-grid .poor {
    background-color: rgba(220, 50, 50, 0.1);
    color: #dc3232;
}

.scores-grid .score.no-data {
    background-color: rgba(0, 0, 0, 0.05);
    color: #666;
}

.score-item .value {
    display: block;
    font-size: 16px;
    font-weight: bold;
}

/* Metrics Panel */
.metrics-panel {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
}

.metrics-panel h4 {
    margin: 0 0 15px 0;
    color: #1d2327;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.metrics-grid .good {
    background-color: rgba(0, 204, 102, 0.1);
    color: #0c6;
}

.metrics-grid .average {
    background-color: rgba(255, 170, 51, 0.1);
    color: #fa3;
}

.metrics-grid .poor {
    background-color: rgba(220, 50, 50, 0.1);
    color: #dc3232;
}


.metric-item {
    background: #dfdfdf;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
}

.metric-item .label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 5px;
}

.metric-item .value {
    display: block;
    font-size: 14px;
    color: #50575e;
}

/* Status and Progress */
#test-status {
    margin: 20px 0;
}

.test-progress {
    height: 4px;
    background: #e5e5e5;
    margin-top: 10px;
    border-radius: 2px;
    overflow: hidden;
}

.test-progress::after {
    content: '';
    display: block;
    width: 30%;
    height: 100%;
    background: #2271b1;
    animation: progress 1s infinite linear;
}

@keyframes progress {
    from { transform: translateX(-100%); }
    to { transform: translateX(400%); }
}

.wp-list-table .button.view-details {
    background: #f8f9fa;
    border: 1px solid #c3c4c7;
    color: #50575e;
    padding: 4px 12px;
    font-size: 12px;
    line-height: 1.5;
    border-radius: 3px;
}

.wp-list-table .button.view-details:hover {
    background: #f0f0f1;
    border-color: #8c8f94;
}



/* Enhanced Table Styles */
.wp-list-table {
    background: #fff;
    border: 1px solid #c3c4c7;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    border-spacing: 0;
    border-radius: 4px;
    margin-top: 15px;
}

.wp-list-table thead th {
    background: #f8f9fa;
    border-bottom: 1px solid #c3c4c7;
    padding: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
    text-align: left;
}

.wp-list-table tbody td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f1;
    font-size: 13px;
    color: #50575e;
    vertical-align: middle;
}

.wp-list-table tbody tr:last-child td {
    border-bottom: none;
}

/* Table Score Bubbles */
.wp-list-table td.good,
.wp-list-table td.average,
.wp-list-table td.poor {
    font-weight: 600;
}

.wp-list-table td.good span,
.wp-list-table td.average span,
.wp-list-table td.poor span {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    min-width: 60px;
    text-align: center;
}

.wp-list-table td.good span {
    background-color: rgba(0, 204, 102, 0.1);
    color: #0c6;
}

.wp-list-table td.average span {
    background-color: rgba(255, 170, 51, 0.1);
    color: #fa3;
}

.wp-list-table td.poor span {
    background-color: rgba(220, 50, 50, 0.1);
    color: #dc3232;
}


/* Enhanced Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 20px;
}

.modal-content {
    background: #fff;
    border: 1px solid #c3c4c7;
    box-shadow: 0 5px 15px rgba(0,0,0,.2);
    border-radius: 6px;
    padding: 0;
    max-width: 960px;
    margin: 40px auto;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h2 {
    margin: 0;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e4e7;
    font-size: 16px;
    font-weight: 600;
    background: #f8f9fa;
    border-radius: 6px 6px 0 0;
}

.close-modal {
    position: absolute;
    right: 15px;
    top: 12px;
    color: #646970;
    cursor: pointer;
    font-size: 20px;
}

.close-modal:hover {
    color: #135e96;
}

#test-details-content {
    padding: 20px;
}

/* Test Details Content */
.test-details-grid {
    display: grid;
    gap: 24px;
}

.basic-info {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 4px;
    border: 1px solid #e2e4e7;
}

.basic-info h3,
.scores-section h3,
.metrics-section h3,
.audits-section h3 {
    font-size: 14px;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e4e7;
    color: #1d2327;
}

.basic-info p {
    margin: 8px 0;
    font-size: 13px;
    color: #50575e;
}

/* Audits Section */
.audits-list {
    display: grid;
    gap: 12px;
}

.audit-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #e2e4e7;
}

.audit-item .audit-title {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
    color: #1d2327;
}

.audit-item .audit-score {
    display: inline-block;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    margin-bottom: 6px;
}

.audit-item .audit-description {
    font-size: 12px;
    color: #646970;
    line-height: 1.4;
}

.audit-item.good { border-left: 3px solid #0c6; }
.audit-item.average { border-left: 3px solid #fa3; }
.audit-item.poor { border-left: 3px solid #dc3232; }

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
    text-align: center;
    padding: 40px;
    color: #646970;
    font-size: 14px;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #2271b1;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spinner 0.6s linear infinite;
}

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

/* Scheduled Tests Table Styles */
.status-indicator {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.status-indicator::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-active {
    background-color: rgba(0, 204, 102, 0.1);
}

.status-active::before {
    background-color: #0c6;
}

.status-overdue {
    background-color: rgba(220, 50, 50, 0.1);
}

.status-overdue::before {
    background-color: #dc3232;
}

.status-inactive {
    background-color: rgba(128, 128, 128, 0.1);
}

.status-inactive::before {
    background-color: #666;
}

#pagespeed-scheduled-body .button {
    margin-right: 5px;
}

#pagespeed-scheduled-body .button.run-now {
    background-color: #0c6;
    border-color: #0a3;
    color: #fff;
}

#pagespeed-scheduled-body .button.run-now:hover {
    background-color: #0a3;
    border-color: #082;
}

.no-items {
    text-align: center;
    color: #666;
    padding: 20px !important;
    font-style: italic;
}

.notice.inline {
    margin: 5px 0;
    padding: 5px 10px;
}

.spinner.is-active {
    float: none;
    margin: 0 0 0 5px;
    vertical-align: middle;
}

/* Responsive Adjustments */
@media screen and (max-width: 782px) {
    .pagespeed-form-row,
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .scores-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal-content {
        margin: 20px;
        max-height: 90vh;
    }

    .wp-list-table td {
        padding: 8px;
    }
}

/* Animation */
.results-panel {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Test Details Content */
.test-details-grid {
    display: grid;
    gap: 24px;
}

/* Basic Info Section with Circle Score */
.basic-info {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 24px;
    align-items: start;
    background: #f8f9fa;
    padding: 16px;
    border-radius: 4px;
    border: 1px solid #e2e4e7;
}

.basic-info .score-circle {
    width: 150px;
    height: 150px;
    margin: 0;
}

.basic-info .scores-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.basic-info .meta-info {
    margin-top: 16px;
}

.basic-info .meta-info p {
    margin: 8px 0;
    font-size: 13px;
    color: #50575e;
}

/* Metrics Panel in Modal */
.modal .metrics-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 4px;
    border: 1px solid #e2e4e7;
}

.modal .metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.modal .metric-item {
    position: relative;
    background: white;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
    border: 1px solid #e2e4e7;
}

.modal .metric-item .metric-label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1d2327;
}

.modal .metric-item .metric-value {
    font-size: 16px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    display: inline-block;
}

/* Core Web Vitals Scoring */
.metric-item.good .metric-value {
    background-color: rgba(0, 204, 102, 0.1);
    color: #0c6;
}

.metric-item.average .metric-value {
    background-color: rgba(255, 170, 51, 0.1);
    color: #fa3;
}

.metric-item.poor .metric-value {
    background-color: rgba(220, 50, 50, 0.1);
    color: #dc3232;
}

/* Audit Items with Score Bubbles */
.audit-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 15px;
    align-items: start;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #e2e4e7;
}

.audit-item .audit-content {
    flex: 1;
}

.audit-item .audit-score {
    font-size: 14px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    text-align: center;
    min-width: 60px;
}

.audit-item.good .audit-score {
    background-color: rgba(0, 204, 102, 0.1);
    color: #0c6;
}

.audit-item.average .audit-score {
    background-color: rgba(255, 170, 51, 0.1);
    color: #fa3;
}

.audit-item.poor .audit-score {
    background-color: rgba(220, 50, 50, 0.1);
    color: #dc3232;
}

/* Responsive Adjustments for Modal */
@media screen and (max-width: 782px) {
    .basic-info {
        grid-template-columns: 1fr;
    }

    .basic-info .score-circle {
        margin: 0 auto;
    }

    .modal .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .audit-item {
        grid-template-columns: 1fr;
    }

    .audit-item .audit-score {
        margin-top: 10px;
    }
}


