/* Speedy Go Admin Toggle Switch Styles */
/**
 * CNC WebP Converter Admin Styles
 */
/* Base Styles */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap');

.speedygo-admin,
.speedygo-admin p {
    font-size: 16px;
}

h1.speedygo-title {
    font-size: 30px;
    font-weight: 600;
}

.speedygo-admin,
.swal2-container {
    font-family: "Poppins", sans-serif;
}

/* Two-column layout for plugin admin pages (main + sidebar) */
.speedygo-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.speedygo-layout__main {
    flex: 1 1 auto;
    min-width: 0;
}

.speedygo-layout__sidebar {
    flex: 0 0 320px;
    position: sticky;
    top: 32px; /* WP admin bar height */
    align-self: flex-start;
    max-height: calc(100vh - 48px);
    overflow: auto;
}

@media (max-width: 1100px) {
    .speedygo-layout {
        flex-direction: column;
    }
    .speedygo-layout__sidebar {
        flex-basis: auto;
        width: 100%;
        position: static;
        top: auto;
        max-height: none;
        overflow: visible;
    }
}

.speedygo-upgrade-card {
    background: linear-gradient(135deg, #6167f8 0%, #9463f7 100%);
    color: #fff;
    border: none !important;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 10px 20px rgba(97, 103, 248, 0.2);
    overflow: hidden;
    position: relative;
    z-index: 1;
    display: none;
}

.speedygo-upgrade-card::before {
    content: "";
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    z-index: -1;
}

.speedygo-upgrade-title {
    margin: 0 0 8px !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #fff !important;
    line-height: 1.2;
}

.speedygo-upgrade-subtitle {
    margin: 0 0 20px !important;
    font-size: 15px !important;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9) !important;
}

.speedygo-upgrade-list {
    margin: 0 0 24px 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.speedygo-upgrade-list li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    display: flex;
    align-items: center;
}

.speedygo-upgrade-list li svg {
    position: absolute;
    left: 0;
    width: 20px;
    height: 20px;
    opacity: 0.9;
}

.speedygo-upgrade-cta {
    display: block;
    text-align: center;
    background: #fff !important;
    color: #6167f8 !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 14px 20px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    height: auto !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
}

.speedygo-upgrade-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2) !important;
    background: #f8f8f8 !important;
}

.speedygo-upgrade-footnote {
    margin: 12px 0 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
}

.wrap .cnc-webp-info-box,
.card {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    padding: 24px;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.wrap .cnc-webp-info-box {
    margin-top: 20px;
}

.card {
    margin: 20px 0;
}

/* Tab Navigation */
.nav-tab-wrapper {
    border-bottom: 1px solid #ccc;
    margin: 0;
    padding: 9px 0 0;
    line-height: inherit;
}

.nav-tab {
    color: #516885;
    font-size: 14px;
    line-height: 24px;
    font-weight: 600;
    padding: 15px;
    margin-right: 5px;
    text-decoration: none;
    border-radius: 3px 3px 0 0;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    background: transparent;
}

.nav-tab-active,
.nav-tab-active:hover {
    border-bottom: 1px solid #fff;
    background: #fff;
    color: #000;
    position: relative;
    margin-bottom: -1px;
}

/* Range Slider */
.cnc-webp-range {
    width: 300px;
    vertical-align: middle;
}

.cnc-webp-range-value {
    display: inline-block;
    width: 50px;
    text-align: center;
    margin-left: 10px;
    font-weight: bold;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    height: 20px;
    background-color: #f1f1f1;
    border-radius: 3px;
    margin: 10px 0;
}

.progress-bar {
    height: 100%;
    background-color: #0073aa;
    border-radius: 3px;
    width: 100%;
    transition: width 0.3s ease;
}

/* Results Containers */
#scan-results,
#conversion-progress,
#conversion-complete,
#remove-results {
    margin-top: 20px;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 3px;
}

.results-summary,
.complete-summary,
.remove-summary,
.progress-status {
    margin-bottom: 15px;
}

/* Controls */
.scan-controls,
.remove-controls {
    margin: 20px 0;
}

/* Folder Selection */
#folder-select {
    margin: 10px 0 10px 25px;
}

#folder-dropdown {
    min-width: 250px;
}

/* System Info Table */
.cnc-webp-info-box table {
    border-collapse: collapse;
    width: 100%;
}

.cnc-webp-info-box th {
    text-align: left;
    width: 30%;
}

.cnc-webp-info-box th,
.cnc-webp-info-box td {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
}

/* Data Table */
.cnc-webp-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

.cnc-webp-table th {
    background: #007cba;
    color: #fff;
    text-align: left;
    padding: 10px;
    position: sticky;
    top: 0;
    z-index: 2;
}

.cnc-webp-table td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

.cnc-webp-table tr:nth-child(even) {
    background: #f9f9f9;
}

/* Pagination */
.cnc-pagination {
    margin-top: 10px;
    text-align: center;
}

.cnc-pagination a,
.cnc-pagination span {
    display: inline-block;
    padding: 5px 10px;
    margin: 2px;
    border: 1px solid #ddd;
    text-decoration: none;
    background: #f8f8f8;
}

.cnc-pagination .current {
    background: #007cba;
    color: #fff;
    font-weight: bold;
}

.cnc-pagination a:hover {
    background: #007cba;
    color: #fff;
    cursor: pointer;
}

/* Tab Content */
.cnc-tab-content {
    display: none;
    padding: 24px;
    background: #fff;
    animation: speedygoFadeIn 0.4s ease-out;
}

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

.cnc-tab-content.active {
    display: block;
}

/* Purge Button Polish */
.speedygo-purge-header-btn {
    margin: 0 0 20px !important;
    background: #f0f0f1 !important;
    border-color: #6167f8 !important;
    color: #6167f8 !important;
    font-weight: 600 !important;
    padding: 5px 15px !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
    height: auto !important;
    line-height: 1.5 !important;
}

.speedygo-purge-header-btn:hover {
    background: #6167f8 !important;
    color: #fff !important;
}

/* Admin Page Specific */
.toplevel_page_cnc-image-optimization div#wpcontent {
    background: #eff1ff;
}

/* Custom Tab Styles */
.speedygo-admin .nav-tab {
    margin: 0 20px 0 0;
    border: none;
    border-radius: 5px 5px 0 0;
}

.speedygo-admin h2.nav-tab-wrapper {
    border-bottom: none;
}

.speedygo-admin .nav-tab:hover,
.speedygo-admin .nav-tab.nav-tab-active,
.speedygo-admin .nav-tab:focus,
.speedygo-admin .nav-tab:focus-within {
    color: #6167f8;
}

.speedygo-admin .nav-tab:focus,
.speedygo-admin .nav-tab:focus-within,
.speedygo-admin .nav-tab:focus-visible {
    outline: 1px dashed #6167f8;
    outline-offset: 1px;
    box-shadow: none;
    background: #fff;
}

/* Button Styles */
.speedygo-admin .button-primary {
    background: #6167f8;
    font-size: 15px;
    padding: 15px 30px;
    line-height: 1;
    font-weight: 500;
}

.speedygo-admin .small-text {
    display: block;
    font-size: 12px;
    font-weight: 400;
    line-height: 1;
}

/* Icon Styles */
span.cnc-icon {
    height: 27px;
}

span.cnc-icon svg {
    height: 27px;
    width: 27px;
}

span.cnc-tab_info p {
    margin: 0;
    font-size: 15px;
}

.cnc-image-optimization_page_cnc-webp-bulk .swal2-popup {
    font-family: 'Poppins';
}

/* Responsive */
@media screen and (max-width: 782px) {
    .cnc-webp-range {
        width: 70%;
    }

    #folder-dropdown {
        width: 100%;
    }
}

/* Progress Circle and Stats Container */
.cnc-progress-container {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

/* Progress Circle */
.cnc-progress-circle {
    position: relative;
    width: 100px;
    height: 100px;
}

.cnc-progress-circle svg path:first-child {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 4;
}

.cnc-progress-circle svg path:last-child {
    fill: none;
    stroke: #4CAF50;
    stroke-width: 4;
    stroke-linecap: round;
}

.cnc-progress-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    font-weight: bold;
}

/* Stats Section */
.cnc-stats {
    flex-grow: 1;
}

.cnc-stats p {
    margin: 5px 0;
}

/* Time Estimation */
.cnc-time-estimation {
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.cnc-time-remaining {
    color: #6167f8;
    margin: 0;
}

.cnc-next-run {
    color: #6167f8;
    margin: 5px 0 0 0;
}

.cnc-execution-time {
    color: #666;
    margin: 5px 0 0 0;
    font-size: 12px;
    font-style: italic;
}

/* Stop Button */
.cnc-stop-button {
    background-color: #dc3545 !important;
    color: white !important;
    border-color: #dc3545 !important;
    margin-bottom: 10px;
}

/* Progress Bar Container */
.cnc-conversion-progress {
    margin-top: 20px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cnc-progress-bar {
    background-color: #f0f0f0;
    border-radius: 8px;
    padding: 3px;
    margin: 15px 0;
}

.cnc-progress-bar-fill {
    background-color: #4CAF50;
    height: 24px;
    border-radius: 6px;
    transition: width 0.3s ease-in-out;
    position: relative;
}

.cnc-progress-text {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
}

.cnc-progress-status {
    text-align: center;
    font-size: 15px;
    margin-top: 10px;
}

.cnc-batch-status {
    text-align: center;
    color: #666;
    margin-top: 5px;
    font-size: 13px;
}

/* Admin Bar Progress Styles */
.cnc-admin-bar-progress {
    position: relative;
    width: 100px;
    height: 16px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin: 0 10px;
}

.cnc-admin-bar-progress-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #6167f8;
    transition: width 0.3s ease;
}

.cnc-admin-bar-text {
    position: relative;
    z-index: 1;
    color: #fff;
    font-size: 11px;
    line-height: 16px;
    padding: 0 5px;
    white-space: nowrap;
}

/* Dashboard Widget Progress Styles */
.cnc-dashboard-progress-bar-wrap {
    width: 100%;
    height: 20px;
    background: #f0f0f1;
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0;
}

.cnc-dashboard-progress-bar {
    height: 100%;
    background: #6167f8;
    transition: width 0.3s ease;
}

.cnc-dashboard-stats {
    margin-top: 10px;
}

.cnc-dashboard-stats p {
    margin: 5px 0;
}

/* Dashboard Widget Styles */
#cnc-webp-dashboard-widget {
    background: #fff;
}

#cnc-webp-dashboard-widget .inside {
    margin: 0;
    padding: 0;
}

.cnc-dashboard-widget-header {
    padding: 12px 12px;
    border-bottom: 1px solid #e5e5e5;
    background: #f8f9fa;
}

.cnc-dashboard-widget-header h3 {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    color: #1d2327;
}

.cnc-dashboard-widget-content {
    padding: 16px;
}

.cnc-dashboard-chart-container {
    position: relative;
    width: 100%;
    height: 220px !important;
    margin: 0 auto 20px;
    max-width: 220px;
    overflow: hidden;
}

.cnc-chart-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1;
}

.cnc-chart-center-text .percentage {
    font-size: 24px;
    font-weight: 600;
    color: #6167f8;
    line-height: 1;
}

.cnc-chart-center-text .label {
    font-size: 12px;
    color: #50575e;
    margin-top: 4px;
}

.cnc-dashboard-stats {
    margin-top: 20px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 4px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.stat-item:not(:last-child) {
    border-bottom: 1px solid #e5e5e5;
}

.stat-label {
    color: #50575e;
    font-weight: 500;
}

.stat-value {
    color: #6167f8;
    font-weight: 600;
}

.cnc-dashboard-widget-footer {
    padding: 12px;
    border-top: 1px solid #e5e5e5;
    background: #f8f9fa;
    text-align: center;
}

.no-conversion-message {
    text-align: center;
    padding: 40px 20px;
    color: #50575e;
}

.no-conversion-message p {
    margin: 0;
    font-size: 14px;
}

/* Fix chart container overflow issues */
#dashboard-widgets .postbox.closed .cnc-dashboard-chart-container {
    display: none;
}

/* Ensure chart is visible in the widget */
#cnc-dashboard-chart {
    position: relative;
    z-index: 0;
    width: 100% !important;
    height: 220px !important;
    max-height: 220px !important;
    display: block !important;
    box-sizing: border-box !important;
}

.speedygo-admin .switch-toggle {
    display: none;
}

.speedygo-admin .switch-toggle+label {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    background-color: #ccc;
    border-radius: 24px;
    cursor: pointer;
    transition: background-color 0.3s;
    vertical-align: middle;
}

.speedygo-admin .switch-toggle+label:before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
}

.speedygo-admin .switch-toggle:checked+label {
    background-color: #66bb6a;
}

.speedygo-admin .switch-toggle:checked+label:before {
    transform: translateX(26px);
}

.cnc-progress-circle-container {
    margin-bottom: 0 !important;
}

div#speedygo-tabs {
    padding: 15px;
    background: #fff;
}

.cnc-section-title {
    margin: 30px 0 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ccc;
    font-size: 1.3em;
    color: #23282d;
}

.form-table {
    margin-top: 0;
}

.form-table th {
    width: 200px;
}

.form-table td {
    padding: 15px 10px;
}

.form-table .description {
    margin-top: 5px;
    color: #666;
}

.select2-container {
    width: 70% !important;
}

.select2-container .select2-search--inline .select2-search__field,
.select2-container span {
    font-family: 'Poppins';
}



.dots-spinner {
    width: 3.6rem;
    height: 3.4rem;
    position: relative;
    animation: spin 2s linear infinite;
}

.dots-spinner>span {
    display: block;
    --size: 1.2rem;
    height: var(--size);
    width: var(--size);
    background-color: #9463F7;
    border-radius: 50%;
    position: absolute;
    animation: pulse 3s ease-out infinite var(--delay),
        colorChange 4s linear infinite;
}

.dot-1 {
    top: 0;
    left: calc(50% - (var(--size) / 2));
    --delay: 2s;
}

.dot-2 {
    bottom: 0;
    left: 0;
    --delay: 1s;
}

.dot-3 {
    bottom: 0;
    right: 0;
    --delay: 0s;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes colorChange {
    0% {
        background-color: #9463F7;
    }

    33.33% {
        background-color: #A8C9F7;
    }

    66.66% {
        background-color: #5E64F0;
    }

    100% {
        background-color: #9463F7;
    }
}

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

/* PageSpeed admin loader styles (moved from inline in admin page) */
#speedygo-pagespeed-loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    text-align: center;
}

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

.speedygo-loading-text {
    margin-top: 10px;
    font-size: 16px;
    color: #333;
}

#speedygo-pagespeed-key-warning {
    color: #a00;
    display: none;
    margin-left: 10px;
}

/* Error text shown under score cells */
.speedygo-error-text {
    color: #a00;
    display: block;
}

.speedygo-error-body {
    color: #666;
    display: block;
    margin-top: 4px;
}

.speedygo-section-title {
    margin-top: 1.5rem;
}

.speedygo-admin input[type=color],
.speedygo-admin input[type=date],
.speedygo-admin input[type=datetime-local],
.speedygo-admin input[type=datetime],
.speedygo-admin input[type=email],
.speedygo-admin input[type=month],
.speedygo-admin input[type=number],
.speedygo-admin input[type=password],
.speedygo-admin input[type=search],
.speedygo-admin input[type=tel],
.speedygo-admin input[type=text],
.speedygo-admin input[type=time],
.speedygo-admin input[type=url],
.speedygo-admin input[type=week],
.speedygo-admin select,
.speedygo-admin textarea {
    padding: 5px 10px !important;
    width: 450px;
}

.speedygo-logos {
    display: flex;
    justify-content: center;
    gap: 30px;
    align-items: center;
    overflow: hidden;
    margin: 60px 0;
}

.speedygo-connection-screen .speedygo-connection-inner {
    display: flex;
    flex-direction: column;
    padding: 25px;
    background: #fff;
    border-radius: 10px;
    margin: 0 auto;
    align-items: center;
}

.speedygo-connection-screen {
    height: 85vh;
    max-width: 650px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
}

.manual-connect {
    color: #5E64F0;
    text-decoration: underline;
    cursor: pointer;
}

.speedygo_api_form input{
    width: 100%;
    display: block;
}

.font-green {
    color: #007d00;
}

.toplevel_page_speedy-go-connection .wp-menu-image img {
    width: 20px !important;
    height: 20px !important;
    object-fit: contain;
    padding-top: 6px !important;
}

.speedygo-connection-status {
    width: 100%;
    text-align: center;
}

.speedygo-connection-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.speedygo-connection-buttons a,.speedygo-connection-buttons form {
    flex: 1;
}
/* WebP Pro Page Styles */
.speedygo-webp-pro-container {
    text-align: center;
}

.speedygo-webp-banner img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.speedygo-webp-cta h2 {
    font-size: 28px;
    margin-bottom: 15px;
    font-weight: 600;
}

.speedygo-webp-cta p {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.mtb-2 {
    margin-top: 1rem !important;
    margin-bottom: 1rem !important;
}
