/* PDF Compressor - Tool Specific Styles */

:root {
    --theme-accent: #ff004d;
    --theme-accent-glow: rgba(255, 0, 77, 0.35);
    --theme-accent-dim: rgba(255, 0, 77, 0.12);
    --max-width: 820px;

    --footer-theme: var(--theme-accent);
}

.nav-brand .brand-badge {
    border-color: rgba(255, 0, 77, 0.25);
}

.tool-icon-wrapper {
    border-color: rgba(255, 0, 77, 0.25);
}

.btn-primary {
    color: #ffffff;
}

.tool-panel {
    background: rgba(17, 21, 28, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}

.upload-dropzone {
    border: 1.5px dashed rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 20px 20px 38px;
    text-align: center;
    background: rgba(255, 255, 255, 0.015);
    transition: border-color 0.2s, background-color 0.2s;
    cursor: pointer;
    position: relative;
}

.upload-dropzone:hover {
    border-color: rgba(255, 0, 77, 0.4);
    background: rgba(255, 0, 77, 0.03);
}

/* Dropzone Top Bar: Recommendation + Gear */
.dropzone-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 18px;
}

.recommendation-bar {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.74rem;
    color: var(--theme-text-muted);
    background: transparent;
    border: none;
    font-family: var(--theme-font-body);
    letter-spacing: 0.2px;
    transition: color 0.2s ease;
}

.recommendation-bar .rec-icon {
    color: var(--theme-accent);
    opacity: 0.85;
    flex-shrink: 0;
}

.recommendation-bar.detected {
    color: #34d399;
}

.recommendation-bar.detected .rec-icon {
    color: #34d399;
    opacity: 1;
}

.security-badge-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    align-items: center;
}

.security-pill.iframe-pill {
    background: rgba(0, 240, 255, 0.08);
    border-color: rgba(0, 240, 255, 0.3);
    color: #00f0ff;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.security-pill.iframe-pill:hover {
    background: rgba(0, 240, 255, 0.16);
    border-color: rgba(0, 240, 255, 0.6);
    transform: translateY(-1px);
}

#mainContainerCard {
    position: relative;
}

.gear-btn {
    background: transparent;
    border: none;
    color: var(--theme-text-muted);
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.gear-btn:hover {
    color: var(--theme-text);
    background: rgba(255, 255, 255, 0.06);
}

/* Subtle Smart Detection Progress */
.detection-progress-box {
    margin: 0 auto 18px;
    max-width: 360px;
    width: 100%;
    text-align: left;
}

.detection-progress-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    color: var(--theme-text-muted);
    margin-bottom: 5px;
}

.detection-progress-val {
    font-weight: 600;
    color: var(--theme-accent);
}

.detection-progress-track {
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

.detection-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--theme-accent);
    border-radius: 999px;
    transition: width 0.12s ease-out;
}

.upload-icon-ring {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    color: var(--theme-accent);
}

/* Uploaded File Banner & Offload Button */
.uploaded-file-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 16px;
    transition: border-color 0.2s ease;
}

.uploaded-file-banner:hover {
    border-color: rgba(255, 255, 255, 0.14);
}

.uploaded-file-details {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.uploaded-file-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 0, 77, 0.1);
    border: 1px solid rgba(255, 0, 77, 0.25);
    color: var(--theme-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.uploaded-file-info {
    min-width: 0;
    flex: 1;
}

.uploaded-file-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.uploaded-file-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--theme-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.uploaded-file-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    color: var(--theme-text-muted);
    margin-top: 2px;
}

.uploaded-file-sep {
    opacity: 0.4;
}

.btn-remove-file {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--theme-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.btn-remove-file:hover {
    background: rgba(255, 0, 77, 0.15);
    border-color: rgba(255, 0, 77, 0.5);
    color: #ff3366;
    box-shadow: 0 0 10px rgba(255, 0, 77, 0.25);
    transform: scale(1.05);
}

.btn-remove-file:active {
    transform: scale(0.95);
}

/* Engine Switcher */
.engine-switch-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.engine-switch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.engine-gear-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--theme-text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.engine-gear-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 0, 77, 0.45);
    box-shadow: 0 0 10px rgba(255, 0, 77, 0.2);
}

.engine-switch-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    color: var(--theme-text-muted);
}

.engine-toggle-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

@media (max-width: 680px) {
    .engine-toggle-grid {
        grid-template-columns: 1fr;
    }
}

.engine-tab-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 10px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: var(--theme-text-muted);
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: var(--theme-font-body);
}

.engine-tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.14);
    color: var(--theme-text);
}

.engine-tab-btn.active {
    background: rgba(255, 0, 77, 0.1);
    border-color: rgba(255, 0, 77, 0.45);
    color: #ffffff;
    box-shadow: 0 0 14px rgba(255, 0, 77, 0.14);
}

.engine-tab-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.engine-tab-title-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.engine-tab-title-row svg {
    flex-shrink: 0;
}

.engine-tab-name {
    white-space: nowrap;
}

.engine-rec-tag {
    font-size: 0.58rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 3px;
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.35);
    letter-spacing: 0.4px;
    white-space: nowrap;
    text-transform: uppercase;
    line-height: 1.1;
    display: inline-block;
}

.engine-hint-text {
    font-size: 0.73rem;
    color: var(--theme-text-muted);
    margin: 10px 0 0;
    line-height: 1.4;
}

/* Compression Level Radio Grid */
.radio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}

.radio-card {
    cursor: pointer;
    position: relative;
}

.radio-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.radio-card .card-content {
    display: flex;
    flex-direction: column;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    transition: all 0.2s ease;
    height: 100%;
    box-sizing: border-box;
}

.radio-card .card-content strong {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    margin-bottom: 4px;
    color: var(--theme-text);
}

.radio-card .card-content small {
    font-size: 0.74rem;
    color: var(--theme-text-muted);
    line-height: 1.35;
}

.radio-card:hover .card-content {
    background: rgba(255, 255, 255, 0.035);
    border-color: rgba(255, 255, 255, 0.14);
}

.radio-card input:checked + .card-content {
    border-color: rgba(255, 0, 77, 0.45);
    background: rgba(255, 0, 77, 0.06);
    box-shadow: 0 0 16px rgba(255, 0, 77, 0.12);
}

.radio-card input:checked + .card-content strong {
    color: var(--theme-accent);
}

/* Custom Controls Box */
.custom-specs-box {
    background: transparent;
    border: none;
    padding: 10px 0 4px;
    margin-bottom: 16px;
}

.custom-specs-title {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--theme-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
}

.slider-row {
    display: flex;
    gap: 16px;
    margin-bottom: 10px;
}

.slider-box {
    background: transparent;
    border: none;
    padding: 0;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.badge-value {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--theme-accent);
}

.custom-slider {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    outline: none;
    accent-color: var(--theme-accent);
    cursor: pointer;
}

.tip-box {
    font-size: 0.78rem;
    color: var(--theme-text-muted);
    padding: 4px 0 0;
    background: transparent;
    line-height: 1.4;
}

/* Progress Container */
.progress-container {
    margin: 16px 0;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 14px 16px;
    position: relative;
}

.progress-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.progress-left-badges {
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-pages-badge {
    font-family: var(--theme-font-head);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--theme-text);
}

.progress-timer-badge {
    font-family: var(--theme-font-mono, monospace);
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--theme-text-muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.3px;
}

.progress-percent-badge {
    font-family: var(--theme-font-head);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--theme-accent);
}

.progress-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--theme-accent) 0%, #ff5277 50%, var(--theme-accent) 100%);
    background-size: 200% 100%;
    border-radius: 999px;
    transition: width 0.25s ease-out;
    animation: fillShimmer 2s linear infinite;
}

@keyframes fillShimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.progress-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.progress-status-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.progress-pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--theme-accent);
    box-shadow: 0 0 6px var(--theme-accent);
    animation: pulseDot 1.2s infinite ease-in-out;
    flex-shrink: 0;
}

@keyframes pulseDot {
    0%, 100% { transform: scale(0.85); opacity: 0.6; }
    50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 12px var(--theme-accent); }
}

.progress-status-text {
    font-size: 0.76rem;
    color: var(--theme-text-muted);
    letter-spacing: 0.3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-cancel-compress {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 0, 77, 0.08);
    border: 1px solid rgba(255, 0, 77, 0.3);
    color: #ff3366;
    font-family: var(--theme-font-head);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.btn-cancel-compress:hover {
    background: rgba(255, 0, 77, 0.2);
    border-color: rgba(255, 0, 77, 0.6);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(255, 0, 77, 0.3);
    transform: translateY(-1px);
}

.btn-cancel-compress:active {
    transform: translateY(0);
}

/* Results: Redesigned Minimalist Metrics Grid */
.result-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.result-check-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(52, 211, 153, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.3);
    color: #34d399;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.result-title {
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--theme-text);
    margin: 0;
}

.result-filename-text {
    font-size: 0.72rem;
    color: var(--theme-text-muted);
    margin-top: 3px;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 440px;
}

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

.metric-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 72px;
}

.metric-label {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    color: var(--theme-text-muted);
    margin-bottom: 5px;
}

.metric-val {
    font-family: var(--theme-font-head);
    font-size: 1.15rem;
    font-weight: 700;
    color: #cbd5e1;
    letter-spacing: 0.3px;
}

.metric-val-highlight {
    color: var(--theme-accent);
}

.metric-meta-text {
    font-size: 0.74rem;
    color: var(--theme-text-muted);
    font-weight: 500;
    line-height: 1.35;
}

.result-actions-container {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.btn-try-other {
    width: 100%;
    margin-bottom: 12px;
    justify-content: center;
    padding: 10px 16px;
    font-size: 0.78rem;
    font-weight: 600;
    border-color: rgba(255, 255, 255, 0.12);
    letter-spacing: 0.3px;
    background: rgba(255, 255, 255, 0.03);
}

.btn-try-other:hover {
    border-color: rgba(255, 0, 77, 0.45);
    background: rgba(255, 0, 77, 0.08);
    color: #ffffff;
}

.actions-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 14px;
}

/* Settings Modal */
.settings-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.settings-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(5px);
}

.settings-modal-card {
    position: relative;
    background: #11141c;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.65);
    overflow: hidden;
    animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.settings-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.settings-modal-title {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    color: var(--theme-text);
    margin: 0;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--theme-text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
}

.modal-close-btn:hover {
    color: var(--theme-text);
}

.settings-modal-body {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-option-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.015);
    transition: all 0.15s ease;
}

.modal-option-row:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.035);
}

.modal-option-row input {
    margin-top: 3px;
    accent-color: var(--theme-accent);
}

.modal-option-content strong {
    font-size: 0.8rem;
    color: var(--theme-text);
    display: block;
    margin-bottom: 2px;
}

.modal-option-content small {
    font-size: 0.72rem;
    color: var(--theme-text-muted);
    line-height: 1.35;
    display: block;
}

.settings-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    justify-content: flex-end;
    background: rgba(255, 255, 255, 0.01);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast-message {
    background: #111622;
    border: 1px solid var(--theme-border-highlight);
    color: var(--theme-text);
    padding: 10px 18px;
    border-radius: 999px;
    font-family: var(--theme-font-body);
    font-size: 0.84rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    animation: toastSlideUp 0.25s ease-out;
    white-space: nowrap;
}

.toast-message.error {
    border-color: rgba(255, 0, 77, 0.4);
    color: #ff4d79;
    background: #180d14;
}

.toast-message.info {
    border-color: rgba(59, 130, 246, 0.4);
    color: #60a5fa;
    background: #0d1524;
}

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

@media (max-width: 640px) {
    .radio-grid {
        grid-template-columns: 1fr;
    }
    .slider-row {
        flex-direction: column;
    }
    .actions-grid {
        grid-template-columns: 1fr;
    }
    .result-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
