/* WP Image Optimizer Admin Styles */

.wpio-wrap {
    max-width: 600px;
    margin: 20px 0;
}

.wpio-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.wpio-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #c3c4c7;
}

.wpio-card-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.wpio-card-body {
    padding: 20px;
}

/* Status badges */
.wpio-status-badge {
    display: inline-block;
    padding: 6px 12px;
    margin: 16px 20px 0;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.wpio-status-active {
    background: #d4edda;
    color: #155724;
}

.wpio-status-dev,
.wpio-status-development {
    background: #fff3cd;
    color: #856404;
}

.wpio-status-trial {
    background: #cce5ff;
    color: #004085;
}

.wpio-status-past_due {
    background: #fff3cd;
    color: #856404;
}

.wpio-status-paused {
    background: #e2e3e5;
    color: #383d41;
}

.wpio-status-expired {
    background: #f8d7da;
    color: #721c24;
}

.wpio-status-service_discontinued {
    background: #d1d3e2;
    color: #3a3b45;
}

/* Form elements */
.wpio-form-group {
    margin-bottom: 16px;
}

.wpio-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
}

.wpio-input {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    box-sizing: border-box;
}

.wpio-input:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

/* Checkbox group */
.wpio-checkbox-group {
    margin: 16px 0;
}

.wpio-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
    line-height: 1.5;
}

.wpio-checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
}

.wpio-checkbox-label span {
    color: #50575e;
    font-size: 13px;
}

.wpio-checkbox-label a {
    color: #2271b1;
}

.wpio-terms-note {
    margin: 6px 0 0 24px;
    font-size: 12px;
    color: #646970;
}

/* Domain info */
.wpio-domain-info {
    color: #50575e;
    margin-bottom: 16px;
}

.wpio-domain-info strong,
.wpio-domain-info code {
    color: #1d2327;
}

/* Help text */
.wpio-help-text {
    color: #646970;
    font-size: 13px;
    margin-top: 16px;
}

/* Field hints (inline explanations) */
.wpio-field-hint {
    color: #646970;
    font-size: 12px;
    margin: 4px 0 0;
    font-style: italic;
}

/* Success message */
.wpio-success-msg {
    font-size: 16px;
    color: #155724;
    margin: 0 0 8px;
}

.wpio-note {
    font-size: 13px;
    color: #646970;
    margin: 0 0 20px;
}

/* How it works section */
.wpio-how-it-works {
    background: #f0f6fc;
    border-left: 3px solid #2271b1;
    padding: 12px 16px;
    margin: 12px 0 20px;
    border-radius: 0 4px 4px 0;
}

.wpio-how-title {
    font-weight: 600;
    color: #1d2327;
    margin: 0 0 8px;
    font-size: 13px;
}

.wpio-how-it-works ul {
    margin: 0 0 8px;
    padding-left: 20px;
}

.wpio-how-it-works li {
    font-size: 13px;
    color: #50575e;
    margin-bottom: 4px;
    line-height: 1.5;
}

.wpio-logged-in-note {
    font-size: 12px;
    color: #50575e;
    margin: 10px 0 0;
    padding-top: 8px;
    border-top: 1px solid #d0e3f0;
}

/* Info table */
.wpio-info-table {
    width: 100%;
    margin-bottom: 20px;
    border-collapse: collapse;
}

.wpio-info-table th,
.wpio-info-table td {
    padding: 8px 0;
    text-align: left;
    border-bottom: 1px solid #f0f0f1;
}

.wpio-info-table th {
    width: 100px;
    color: #50575e;
    font-weight: 500;
}

.wpio-info-table code {
    background: #f0f0f1;
    padding: 2px 6px;
    border-radius: 3px;
}

/* Status dot */
.wpio-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #00a32a;
    border-radius: 50%;
    margin-right: 6px;
}

.wpio-status-dot-trial {
    background: #007bff;
}

.wpio-status-dot-past_due {
    background: #ffc107;
}

.wpio-status-dot-paused {
    background: #6c757d;
}

.wpio-status-dot-expired {
    background: #dc3545;
}

.wpio-status-dot-service_discontinued {
    background: #6c757d;
}

/* Warning banners */
.wpio-warning-banner {
    padding: 16px;
    margin-bottom: 20px;
    border-radius: 4px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
}

.wpio-warning-banner p {
    margin: 0 0 12px;
    color: #856404;
}

.wpio-warning-expired {
    background: #f8d7da;
    border-left-color: #dc3545;
}

.wpio-warning-expired p {
    color: #721c24;
}

.wpio-warning-paused {
    background: #fff3cd;
    border-left-color: #ffc107;
}

.wpio-warning-paused p {
    color: #856404;
}

.wpio-warning-service_discontinued {
    background: #d1d3e2;
    border-left-color: #6c757d;
}

.wpio-warning-service_discontinued p {
    color: #3a3b45;
}

/* Re-activation form */
.wpio-reactivate-form {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f1;
}

.wpio-reactivate-form .wpio-form-group {
    margin-bottom: 12px;
}

.wpio-reactivate-form .wpio-input {
    width: 100%;
    max-width: 400px;
}

/* Manage subscription link */
.wpio-manage-link {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f1;
    font-size: 13px;
}

.wpio-manage-link a {
    color: #2271b1;
    text-decoration: none;
}

.wpio-manage-link a:hover {
    text-decoration: underline;
}

/* Messages */
.wpio-message {
    margin-top: 16px;
    padding: 12px;
    border-radius: 4px;
}

.wpio-message.hidden {
    display: none;
}

.wpio-message.wpio-error {
    background: #fcf0f1;
    border-left: 4px solid #d63638;
    color: #8a0f15;
}

.wpio-message.wpio-success {
    background: #edfaef;
    border-left: 4px solid #00a32a;
    color: #0a4b18;
}

/* Loading state */
.wpio-loading {
    opacity: 0.6;
    pointer-events: none;
}

.wpio-loading .button {
    position: relative;
}

.wpio-loading .button::after {
    content: "";
    position: absolute;
    right: -24px;
    top: 50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    border: 2px solid #c3c4c7;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: wpio-spin 0.8s linear infinite;
}

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

/* Advanced section */
.wpio-advanced {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f1;
}

.wpio-advanced summary {
    cursor: pointer;
    color: #646970;
    font-size: 13px;
    user-select: none;
}

.wpio-advanced summary:hover {
    color: #2271b1;
}

.wpio-advanced-content {
    margin-top: 12px;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 4px;
}

.wpio-advanced-desc {
    margin: 0 0 12px;
    color: #646970;
    font-size: 13px;
    line-height: 1.5;
}

#wpio-purge-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Welcome title */
.wpio-welcome-title {
    font-size: 18px;
    margin: 0 0 16px;
    font-weight: 600;
}

/* Pro license link */
.wpio-pro-link {
    margin-top: 20px;
    font-size: 13px;
    color: #646970;
}

.wpio-pro-link a {
    color: #2271b1;
}

.wpio-pro-link.hidden {
    display: none;
}

/* Hidden license form */
.wpio-license-form {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f1;
}

.wpio-license-form.hidden {
    display: none;
}

.wpio-cancel-link {
    margin-left: 12px;
    color: #646970;
    text-decoration: none;
}

.wpio-cancel-link:hover {
    color: #2271b1;
}

/* Free tier badge */
.wpio-status-free {
    background: #e7f5e9;
    color: #1e7e34;
}

/* Upgrade section */
.wpio-upgrade-section {
    margin-top: 24px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e2e4e7;
}

.wpio-upgrade-section h3 {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 600;
}

.wpio-upgrade-desc {
    margin: 0 0 16px;
    color: #50575e;
    font-size: 13px;
    line-height: 1.5;
}

.wpio-get-pro {
    margin-top: 16px;
    font-size: 14px;
    color: #50575e;
}

.wpio-get-pro-link {
    display: inline-block;
    margin-left: 8px;
    padding: 6px 16px;
    background: #2271b1;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background 0.15s ease;
}

.wpio-get-pro-link:hover,
.wpio-get-pro-link:focus {
    background: #135e96;
    color: #fff;
}

/* Stats Section */
.wpio-stats {
    margin-top: 24px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border-radius: 8px;
    border: 1px solid #e2e4e7;
}

.wpio-stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.wpio-stats-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1d2327;
}

.wpio-stats-period {
    font-size: 12px;
    color: #646970;
}

.wpio-stats-loading {
    text-align: center;
    padding: 24px 0;
    color: #646970;
    font-size: 13px;
}

.wpio-stats-error {
    text-align: center;
    padding: 24px 0;
    color: #8a0f15;
    font-size: 13px;
}

.wpio-stats-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.wpio-stat-card {
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 6px;
    padding: 16px;
    text-align: center;
}

.wpio-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #1d2327;
    line-height: 1.2;
}

.wpio-stat-label {
    font-size: 11px;
    color: #646970;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.wpio-stat-sub {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}

/* Free tier usage status */
.wpio-stat-card.wpio-usage-ok .wpio-stat-sub {
    color: #059669;
}

.wpio-stat-card.wpio-usage-warning .wpio-stat-sub {
    color: #d97706;
}

.wpio-stat-card.wpio-usage-exceeded {
    border-color: #dc2626;
}

.wpio-stat-card.wpio-usage-exceeded .wpio-stat-sub {
    color: #dc2626;
    font-weight: 500;
}

.wpio-savings-bar-container {
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 6px;
    padding: 16px;
}

.wpio-savings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.wpio-savings-header span:first-child {
    font-size: 13px;
    font-weight: 500;
    color: #1d2327;
}

.wpio-savings-percent {
    font-size: 20px;
    font-weight: 700;
    color: #00a32a;
}

.wpio-savings-bar {
    height: 12px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.wpio-savings-fill {
    height: 100%;
    background: linear-gradient(90deg, #00a32a 0%, #00d747 100%);
    border-radius: 6px;
    transition: width 0.6s ease;
    width: 0%;
}

.wpio-savings-detail {
    font-size: 12px;
    color: #646970;
    margin-top: 8px;
    text-align: center;
}

/* Responsive stats */
@media (max-width: 500px) {
    .wpio-stats-cards {
        grid-template-columns: 1fr;
    }

    .wpio-stat-value {
        font-size: 20px;
    }
}
