/**
 * Altomatic Admin CSS
 */


/* Hide "Required fields" message in compatibility section */

.attachment-compat .media-types-required-info {
    display: none !important;
}


/* Make sure our URL fields match WordPress core styling */

.altomatic-url-field.copy-to-clipboard-container {
    display: flex;
    align-items: center;
    margin: 6px 0;
    max-width: 100%;
}

.altomatic-url-field input.large-text {
    min-width: 70%;
    width: calc(100% - 140px);
    margin-right: 8px;
}

.altomatic-url-field .copy-attachment-url {
    flex-shrink: 0;
}


/* Make sure our copy button functions properly */

.copy-attachment-url.altomatic-copy-url {
    margin: 0 8px;
}


/* Status column styling */

.column-optimization .altomatic-status-optimized {
    color: #46b450;
    font-weight: 500;
}

.column-optimization .altomatic-savings {
    display: block;
    color: #555;
    margin-top: 2px;
}

.column-optimization .altomatic-sizes {
    display: block;
    color: #555;
    margin-top: 2px;
    font-size: 12px;
}

.column-optimization .altomatic-format-badge {
    display: inline-block;
    color: white;
    font-size: 11px;
    border-radius: 3px;
    padding: 1px 5px;
    margin-right: 5px;
    margin-top: 4px;
}

.column-optimization .altomatic-format-badge.webp {
    background: #2271b1;
}

.column-optimization .altomatic-format-badge.avif {
    background: #8c65d3;
}

.column-optimization .altomatic-details-link {
    display: block;
    margin-top: 5px;
    font-size: 12px;
}

.column-optimization .altomatic-status-processing {
    color: #f0c33c;
}

.column-optimization .altomatic-status-error {
    color: #dc3232;
}


/* Optimization details modal */

.altomatic-compression-details {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.altomatic-compression-details h3 {
    margin-top: 0;
    margin-bottom: 15px;
}

.altomatic-compression-details table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.altomatic-compression-details th {
    text-align: left;
    border-bottom: 1px solid #ccc;
    padding: 8px 4px;
    font-weight: 600;
}

.altomatic-compression-details td {
    padding: 8px 4px;
    border-bottom: 1px solid #eee;
}

.altomatic-compression-details .size-name {
    font-weight: 600;
}

.altomatic-compression-details .savings {
    color: #46b450;
}

.altomatic-compression-details .alt-formats {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}


/* Sidebar optimization section */

.misc-pub-section.altomatic-optimization {
    border-top: 1px solid #e5e5e5;
    margin-top: 5px;
    padding-top: 10px;
}

.misc-pub-section.altomatic-optimization h4,
.misc-pub-section.altomatic-format-url h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
}

.altomatic-status {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.altomatic-status .dashicons {
    margin-right: 6px;
}

.altomatic-status.optimized .dashicons {
    color: #46b450;
}

.altomatic-status.processing .dashicons {
    color: #ffb900;
}

.altomatic-status.error .dashicons {
    color: #dc3232;
}

.altomatic-status.unoptimized .dashicons {
    color: #72777c;
}

.altomatic-stats {
    margin-left: 24px;
}

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

.misc-pub-section.altomatic-format-url {
    border-top: 1px solid #e5e5e5;
}

.altomatic-size-note {
    font-size: 12px;
    color: #72777c;
    font-weight: normal;
}

.altomatic-url-field {
    position: relative;
    display: flex;
    align-items: center;
}

.altomatic-url-field input[type="text"] {
    width: 100%;
    padding-right: 30px;
}

.altomatic-url-field .copy-button {
    position: absolute;
    right: 5px;
    background: none;
    border: none;
    color: #0073aa;
    cursor: pointer;
    padding: 0;
    margin: 0;
    font-size: 16px;
    line-height: 1;
}

.altomatic-url-field .copy-button:hover {
    color: #00a0d2;
}

.altomatic-url-field .copy-button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}


/* Media modal optimization summary */

.altomatic-optimization-summary {
    padding: 8px 0;
}

.altomatic-optimization-summary .altomatic-status {
    font-size: 13px;
    margin-bottom: 4px;
}

.altomatic-optimization-summary .bytes-saved {
    margin-top: 3px;
    margin-left: 24px;
    color: #666;
    font-size: 12px;
}


/* Media modal attachment details */

.attachment-details .setting.altomatic_optimization .name {
    max-width: none;
    min-width: 30%;
    text-align: left;
    font-weight: 600;
}

.attachment-details .setting.altomatic_optimization .value {
    white-space: normal;
    text-align: left;
}

.attachment-details .setting.altomatic_webp_url .name,
.attachment-details .setting.altomatic_avif_url .name {
    max-width: none;
    min-width: 30%;
    text-align: left;
    margin-top: 5px;
    font-weight: 600;
}


/* Column styles */

.column-optimization {
    width: 180px;
}

.column-optimization .optimization-status {
    display: flex;
    align-items: center;
}

.column-optimization .dashicons {
    margin-right: 5px;
}

.column-optimization .dashicons-yes,
.column-optimization .dashicons-yes-alt {
    color: #46b450;
}

.column-optimization .dashicons-update {
    color: #ffb900;
}

.column-optimization .dashicons-warning,
.column-optimization .dashicons-no {
    color: #dc3232;
}

.column-optimization .optimization-info {
    margin-top: 3px;
    font-size: 12px;
    color: #666;
}

.attachment-details .setting[data-setting="altomatic_optimization"] h2 {
    margin-bottom: 10px;
    font-size: 14px;
    color: #1d2327;
}


/* Make the attachment info fields look nicer */

.attachment-details .setting[data-setting="altomatic_optimization"],
.attachment-details .setting[data-setting="altomatic_webp_url"],
.attachment-details .setting[data-setting="altomatic_avif_url"] {
    border-top: 1px solid #dcdcde;
    margin-top: 8px;
    padding-top: 8px;
}


/* Format badges */

.format-badge {
    display: inline-flex;
    align-items: center;
    background: #f0f0f0;
    padding: 3px 6px;
    border-radius: 3px;
    margin-right: 5px;
    font-size: 11px;
    line-height: 1.4;
    white-space: nowrap;
    color: #333;
}

.format-badge .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    margin-right: 3px;
}

.format-badge.webp {
    background-color: #e7f5ff;
    color: #0078d4;
}

.format-badge.avif {
    background-color: #e7fff5;
    color: #00a278;
}


/* Alt text section */

.altomatic-alt-text {
    margin-top: 10px;
}

.altomatic-alt-text h4 {
    margin: 0 0 8px 0;
}

.altomatic-alt-text .alt-text-preview {
    margin: 0 0 5px 0;
    color: #666;
    font-style: italic;
}

.altomatic-alt-text .alt-text-date {
    margin: 0 0 8px 0;
    font-size: 12px;
    color: #666;
}

.altomatic-alt-text .altomatic-regenerate-alt {
    width: 100%;
    text-align: center;
    margin-top: 5px;
}

.altomatic-alt-text .altomatic-regenerate-alt.loading {
    opacity: 0.7;
    cursor: not-allowed;
}


/* API Status Section */

.altomatic-api-status {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-top: 15px;
    width: fit-content;
    max-width: 100%;
}

.api-connection-status {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.status-icon {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ccc;
    display: inline-block;
    margin-left: 8px;
}

.status-icon.connected {
    background-color: #46b450;
}

.status-icon.error {
    background-color: #dc3232;
}

.status-text {
    color: #555;
    font-size: 13px;
}

.api-credit-info {
    padding: 12px 15px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.5;
}

.credit-usage {
    color: #1e1e1e;
    font-weight: 500;
    margin-bottom: 4px;
}

.credit-count {
    font-weight: 600;
    color: #14b8a6;
}

.credit-period {
    color: #50575e;
}

.credit-tier {
    font-size: 12px;
    font-weight: 600;
    color: #1d2327;
}


/* API Key Section */

.api-key-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.toggle-api-key {
    padding: 2px 8px !important;
    height: auto !important;
}

.toggle-api-key .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
    line-height: 28px;
}


/**
 * Admin styles for Altomatic
 */

:root {
    --altomatic-teal: #14b8a6;
    --altomatic-teal-light: #ccfbf1;
    --altomatic-teal-dark: #0d9488;
    --altomatic-navy: #0f172a;
    --altomatic-navy-light: #1e293b;
    --altomatic-green: #46b450;
    --altomatic-blue: #0073aa;
    /* Legacy aliases */
    --altomatic-peach: var(--altomatic-teal);
    --altomatic-peach-light: var(--altomatic-teal-light);
    --altomatic-peach-dark: var(--altomatic-teal-dark);
}

.wrap.altomatic {
    max-width: none;
    border-radius: 0;
    padding: 0;
    margin: 0 0 0 -20px;
    width: calc(100% + 20px);
}

.altomatic-header {
    background: var(--altomatic-navy);
    border-radius: 0;
    padding: 0;
    margin: 0 0 0 -20px;
    width: calc(100% + 20px);
}

.altomatic-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    gap: 20px;
    max-width: 100%;
    box-shadow: 0px -1px 19px 0px #000;
}

.altomatic-header-left {
    display: flex;
    align-items: center;
}

.altomatic-header-logo {
    height: 30px;
    width: auto;
}

.altomatic-quick-links {
    display: flex;
    gap: 8px;
    align-items: center;
}

.altomatic-header-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    background: var(--altomatic-navy-light);
    border: 1px solid #334155;
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.altomatic-header-link:hover,
.altomatic-header-link:focus {
    background: var(--altomatic-teal);
    border-color: var(--altomatic-teal);
    color: #fff;
}

.altomatic-header-link .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 16px;
}

.altomatic form {
    background: #fff;
    border: none;
    border-radius: 0;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.altomatic h2 {
    margin-top: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
    color: #1e293b;
}

.altomatic h2.title {
    margin-top: 30px;
    padding: 12px 15px;
    background: linear-gradient(to right, var(--altomatic-peach-light), white);
    border-radius: 4px;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}


/* ── Info Tabs ──────────────────────────────────────────────── */

.altomatic-info-tabs {
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 2px;
}

.altomatic-tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e2e8f0;
    padding: 0 24px;
}

.altomatic-tab {
    position: relative;
    background: none;
    border: none;
    padding: 14px 20px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: color 0.15s ease;
    white-space: nowrap;
}

.altomatic-tab:hover {
    color: #1e293b;
}

.altomatic-tab.active {
    color: var(--altomatic-teal);
}

.altomatic-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--altomatic-teal);
}

.altomatic-tab-content {
    padding: 20px 24px;
}

.altomatic-tab-content .tab-pane {
    animation: altomatic-fade-in 0.2s ease;
}

@keyframes altomatic-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}


/* ── Guide Steps Grid ──────────────────────────────────────── */

.altomatic-guide-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.altomatic-guide-step {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.altomatic-guide-step strong {
    display: block;
    margin-bottom: 4px;
    color: #1e293b;
    font-size: 13px;
}

.altomatic-guide-step p {
    margin: 0;
    color: #64748b;
    font-size: 12.5px;
    line-height: 1.5;
}

.altomatic-guide-step a {
    color: var(--altomatic-teal);
    text-decoration: none;
}

.altomatic-guide-step a:hover {
    color: var(--altomatic-teal-dark);
    text-decoration: underline;
}

.altomatic-step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    background: var(--altomatic-navy);
    color: var(--altomatic-teal);
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
}

.altomatic-step-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    color: var(--altomatic-teal);
    font-size: 20px;
}

.altomatic-step-icon.dashicons {
    width: 28px;
    height: 28px;
    line-height: 28px;
}


/* ── Upgrade Bar ───────────────────────────────────────────── */

.altomatic-upgrade-bar {
    background: var(--altomatic-navy);
    padding: 12px 24px;
    margin-bottom: 2px;
}

.altomatic-upgrade-text {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #94a3b8;
    font-size: 13px;
}

.altomatic-upgrade-text .dashicons {
    color: var(--altomatic-teal);
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.altomatic-upgrade-text a {
    color: var(--altomatic-teal);
    text-decoration: none;
    font-weight: 500;
    margin-left: 4px;
}

.altomatic-upgrade-text a:hover {
    color: #fff;
}

.altomatic .form-table th {
    padding: 20px 10px 20px 0;
    width: 200px;
    color: #1e293b;
    font-weight: 600;
    font-size: 13px;
}

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

.altomatic .form-table tr {
    border-bottom: 2px solid #0f172a;
}

.altomatic .form-table tr:last-child {
    border-bottom: none;
}


/* API key field */

#altomatic_api_key {
    font-family: monospace;
    letter-spacing: 1px;
    padding: 8px 12px;
    width: 100%;
    max-width: 400px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#altomatic_api_key:focus {
    border-color: var(--altomatic-peach);
    box-shadow: 0 0 0 1px var(--altomatic-peach);
}


/* Custom button styling */

.altomatic .button-primary {
    background: var(--altomatic-peach);
    border-color: var(--altomatic-peach);
    text-shadow: none;
    padding: 3px 20px;
    font-weight: 500;
}

.altomatic .button-primary:hover,
.altomatic .button-primary:focus {
    background: #0f172a;
    border-color: #0f172a;
}


/* Description text */

.altomatic .description {
    color: #666;
    font-style: italic;
    margin: 5px 0 0;
}


/* Status indicators */

.altomatic-status {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.altomatic-status-success {
    background: #edf7ed;
    color: #1e4620;
    border: 1px solid #c6e6c6;
}

.altomatic-status-warning {
    background: #fff4e5;
    color: #663c00;
    border: 1px solid #ffe4bc;
}

.altomatic-status-error {
    background: #fdecea;
    color: #611a15;
    border: 1px solid #f8c9c4;
}

.altomatic-status-optimized {
    display: inline-block;
    padding: 3px 8px;
    background-color: var(--altomatic-green);
    color: white;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
}

.altomatic-savings {
    font-size: 12px;
    color: #666;
}

.altomatic-webp-status {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 3px;
}

.altomatic-webp-badge {
    display: inline-block;
    padding: 3px 8px;
    background-color: var(--altomatic-blue);
    color: white;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
}

.altomatic-webp-sizes {
    font-size: 11px;
    color: #666;
}


/* Settings fields */

.altomatic-field-wrapper {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #eee;
}

.altomatic-field-wrapper:hover {
    border-color: var(--altomatic-peach);
}

.altomatic-field-wrapper label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #23282d;
}

.altomatic-field-wrapper .description {
    margin-top: 8px;
    color: #666;
    font-style: italic;
}


/* Progress bar */

.altomatic-progress {
    margin: 20px 0;
    background: #f0f0f1;
    border-radius: 10px;
    overflow: hidden;
}

.altomatic-progress .progress-bar {
    height: 20px;
    background: linear-gradient(to right, var(--altomatic-peach-light), var(--altomatic-peach));
    transition: width 0.3s ease;
}

.altomatic-progress .progress-text {
    text-align: center;
    font-size: 12px;
    margin-top: 5px;
    color: #666;
}


/* Stats cards */

.altomatic-stats {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
}

.altomatic-stat-card {
    background: linear-gradient(to bottom right, #fff, #f8f9fa);
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.altomatic-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(20, 184, 166, 0.1);
}

.altomatic-stat-number {
    font-size: 28px;
    font-weight: 600;
    color: var(--altomatic-peach);
    margin: 10px 0;
}

.altomatic-stat-label {
    color: #666;
    font-size: 14px;
}


/* Image Sizes Section */

.altomatic-image-sizes label {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.altomatic-image-sizes label:hover {
    background-color: #f7f7f7;
}

.altomatic-image-sizes input[type="checkbox"] {
    margin-right: 10px;
}


/* Sizes info in media library */

.altomatic-sizes-info {
    margin-top: 5px;
}

.altomatic-toggle-sizes {
    text-decoration: none;
    color: #0073aa;
}

.altomatic-sizes-list {
    list-style: none;
    margin: 8px 0 0 0;
    padding: 8px;
    background-color: #f7f7f7;
    border-radius: 3px;
    font-size: 11px;
}

.altomatic-sizes-list li {
    margin-bottom: 4px;
}

.altomatic-sizes-to-optimize {
    display: block;
    margin-top: 5px;
    font-style: italic;
    color: #666;
}


/* Attachment Detail Modal Styles */

.altomatic-status-details {
    margin-top: 10px;
    background: #f9f9f9;
    padding: 12px;
    border-radius: 4px;
}

.altomatic-date {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
}

.altomatic-webp {
    margin: 10px 0;
    padding: 10px;
    background: #edf7ff;
    border-radius: 4px;
}

.altomatic-webp h4 {
    margin: 0 0 8px 0;
    color: var(--altomatic-blue);
}

.altomatic-webp-sizes-list {
    margin: 0;
    padding: 0 0 0 20px;
    font-size: 12px;
}

.altomatic-webp-attachment {
    margin-top: 10px;
}

.altomatic-actions {
    margin-top: 10px;
}


/* Settings groups */

.altomatic .form-table {
    background-color: transparent;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
}

.altomatic-alt-text button.altomatic-regenerate-alt {
    background-color: #14b8a6;
    color: #fff;
    border-color: #14b8a6;
}

.altomatic-optimize button.altomatic-optimize {
    background-color: #14b8a6;
    color: #fff;
    border-color: #14b8a6;
    width: 100%;
    text-align: center;
    margin-top: 5px;
}

.altomatic-settings-actions .altomatic-button,
.altomatic-bulk-actions .altomatic-button {
    color: #fff;
    border-color: var(--altomatic-peach);
    background-color: var(--altomatic-peach);
}

.altomatic-settings-actions .altomatic-button:hover,
.altomatic-settings-actions .altomatic-button:focus,
.altomatic-bulk-actions .altomatic-button:focus,
.altomatic-bulk-actions .altomatic-button:hover {
    background-color: #0f172a;
    border-color: #0f172a;
    color: #fff;
}

.altomatic-bulk-container {
    max-width: 800px;
    margin: 2em 0;
}

.altomatic-settings-summary {
    background: #fff;
    padding: 2em;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 2em;
}

.altomatic-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2em;
    margin: 1.5em 0;
}

.altomatic-setting h3 {
    margin: 0 0 0.5em 0;
    font-size: 1.1em;
    color: #1d2327;
}

.altomatic-setting p {
    margin: 0;
    color: #50575e;
}

.altomatic-settings-actions {
    margin-top: 1.5em;
    padding-top: 1.5em;
    border-top: 1px solid #f0f0f1;
}

.altomatic-bulk-stats {
    background: #fff;
    padding: 2em;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 2em;
}

.altomatic-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2em;
    margin: 1.5em 0;
}

.altomatic-stat-box h3 {
    margin: 0 0 0.5em 0;
    font-size: 1.1em;
    color: #1d2327;
}

.altomatic-count-container {
    font-size: 1.5em;
    margin: 1em 0;
}

.altomatic-unoptimized-count,
.altomatic-missing-alt-count {
    font-weight: bold;
    font-size: 1.2em;
    color: #14b8a6;
}

.altomatic-bulk-actions {
    margin-bottom: 2em;
}

.altomatic-progress-container {
    background: #fff;
    padding: 1.5em;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin: 2em 0;
}

.altomatic-progress-bar {
    background: #f0f0f1;
    height: 20px;
    border-radius: 10px;
    /* overflow: hidden; */
    margin-bottom: 1em;
}

.altomatic-progress {
    background: #14b8a6;
    height: 100%;
    width: 0;
    transition: width 0.3s ease;
}

.altomatic-progress-stats {
    font-size: 0.9em;
    color: #50575e;
}

.altomatic-status-messages {
    margin-top: 1em;
}

.altomatic-status-message {
    padding: 1em;
    margin-bottom: 0.5em;
    border-radius: 4px;
}

.altomatic-status-success {
    background: #edfaef;
    color: #0a5132;
}

.altomatic-status-error {
    background: #fcf0f1;
    color: #cc1818;
}

.altomatic-status-info {
    background: #f0f6fc;
    color: #2271b1;
}


/* Make modal content wider */

#TB_window {
    width: 900px !important;
    margin-left: -450px !important;
}

#TB_ajaxContent {
    width: 870px !important;
}

.altomatic-compression-details {
    margin: 10px;
    max-width: 100%;
    font-size: 13px;
}

.altomatic-compression-details h3 {
    margin-bottom: 15px;
    font-size: 16px;
}

.altomatic-compression-details table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    white-space: nowrap;
}

.altomatic-compression-details th,
.altomatic-compression-details td {
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.altomatic-compression-details th {
    background-color: #f8f9fa;
    font-weight: 600;
    font-size: 13px;
}


/* Adjust column widths for better spacing */

.altomatic-compression-details .size-column {
    width: 14%;
}

.altomatic-compression-details .original-column {
    width: 16%;
}

.altomatic-compression-details .jpeg-column {
    width: 22%;
}

.altomatic-compression-details .webp-column {
    width: 22%;
}

.altomatic-compression-details .avif-column {
    width: 16%;
}

.altomatic-compression-details .savings-column {
    width: 20%;
}

.altomatic-compression-details .size-name {
    font-weight: 500;
}

.altomatic-compression-details .savings {
    color: #28a745;
}

.altomatic-compression-details tbody tr:hover {
    background-color: #f5f5f5;
}

.altomatic-compression-details tfoot {
    border-top: 2px solid #dee2e6;
}

.altomatic-compression-details tfoot td {
    border-bottom: none;
    font-size: 13px;
}


/* ── Email Code Login Modal ────────────────────────────────── */

.altomatic-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.altomatic-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
}

.altomatic-modal-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    width: 420px;
    max-width: 90vw;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.altomatic-modal-content h2 {
    margin: 0 0 16px;
    padding: 0;
    border: none;
    font-size: 20px;
}

.altomatic-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 0;
}

.altomatic-modal-close:hover {
    color: #333;
}

.altomatic-login-step label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #1d2327;
}

.altomatic-login-step p {
    margin: 0 0 14px;
    color: #50575e;
    font-size: 13px;
    line-height: 1.5;
}

.altomatic-login-step input[type="email"],
.altomatic-login-step input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.altomatic-login-step input:focus {
    border-color: var(--altomatic-peach);
    box-shadow: 0 0 0 1px var(--altomatic-peach);
    outline: none;
}

#altomatic-login-code {
    font-family: monospace;
    font-size: 20px;
    letter-spacing: 6px;
    text-align: center;
}

.altomatic-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.altomatic-modal-actions .button-primary {
    background: var(--altomatic-peach);
    border-color: var(--altomatic-peach-dark);
    text-shadow: none;
}

.altomatic-modal-actions .button-primary:hover,
.altomatic-modal-actions .button-primary:focus {
    background: var(--altomatic-peach-dark);
    border-color: var(--altomatic-peach-dark);
}

.altomatic-modal-actions .button-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.altomatic-login-status {
    margin-top: 14px;
    padding: 0;
    font-size: 13px;
    line-height: 1.5;
    border-radius: 4px;
    min-height: 0;
}

.altomatic-login-status:empty {
    display: none;
}

.altomatic-login-status.success {
    background: #edfaef;
    color: #0a5132;
    padding: 10px 14px;
}

.altomatic-login-status.error {
    background: #fcf0f1;
    color: #cc1818;
    padding: 10px 14px;
}

#altomatic-get-api-key {
    white-space: nowrap;
}
