/* Tool-specific styles only - base styles are in tool-layout.css */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #0a0a0a;
    color: #e5e7eb;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #141414;
    border-bottom: 1px solid #374151;
    z-index: 100;
}

    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

    margin-top: 60px;
    padding: 48px 24px;
    text-align: center;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    max-width: 720px;
    margin: 0 auto;
}

.tool-main {
    flex: 1;
    padding: 32px 24px 120px;
}

.tool-container {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.input-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group > label {
    font-size: 14px;
    font-weight: 500;
    color: #e5e7eb;
}

.file-upload-zone {
    background-color: #0a0a0a;
    border: 2px dashed #374151;
    border-radius: 12px;
    padding: 48px 32px;
    text-align: center;
    cursor: pointer;
    transition: all 150ms ease;
    position: relative;
    outline: none;
}

.file-upload-zone.has-error {
    border-color: #dc2626;
    background-color: #7f1d1d;
}

.file-upload-zone.has-file {
    border-style: solid;
    border-color: #374151;
    padding: 24px;
}

.upload-icon {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    opacity: 0.7;
    color: #6b7280;
    letter-spacing: 2px;
}

.upload-primary {
    font-size: 16px;
    font-weight: 400;
    color: #e5e7eb;
    margin-bottom: 4px;
}

.upload-secondary {
    font-size: 14px;
    font-weight: 400;
    color: #9ca3af;
}

.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 8px;
}

.file-info-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.file-name {
    font-size: 14px;
    font-weight: 500;
    color: #e5e7eb;
    word-break: break-all;
}

.file-dimensions {
    font-size: 13px;
    color: #9ca3af;
}

.file-size {
    font-size: 13px;
    color: #9ca3af;
}

.settings-title {
    font-size: 15px;
    font-weight: 500;
    color: #d1d5db;
    margin-bottom: 12px;
}

.setting-hint {
    font-size: 13px;
    color: #6b7280;
    margin-top: 8px;
}

.setting-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.platform-section {
    display: flex;
    flex-direction: column;
}

.platform-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.platform-tab {
    background-color: #1a1a1a;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 10px 18px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 150ms ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.platform-tab:hover {
    background-color: #374151;
}

.platform-tab.active {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
}

.platform-tab.active .pro-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.pro-badge {
    color: #0a0a0a;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 5px;
    border-radius: 3px;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.preset-section {
    display: flex;
    flex-direction: column;
}

.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.preset-btn {
    background-color: #1a1a1a;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 150ms ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.preset-btn:hover {
    background-color: #374151;
}

.preset-btn.active {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
}

.preset-btn .preset-dims {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.7;
}

.preset-btn.active .preset-dims {
    opacity: 0.9;
}

.preview-section {
    display: flex;
    flex-direction: column;
}

.preview-container {
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    cursor: grab;
    touch-action: none;
}

.preview-container:active {
    cursor: grabbing;
}

.preview-container canvas {
    display: block;
    max-width: 100%;
}

.preview-info {
    font-size: 13px;
    color: #6b7280;
    margin-top: 8px;
    text-align: center;
}

.fitmode-section {
    display: flex;
    flex-direction: column;
}

.fitmode-buttons {
    display: flex;
    gap: 0;
    border: 1px solid #374151;
    border-radius: 6px;
    overflow: hidden;
    width: fit-content;
}

.fitmode-btn {
    background-color: #1a1a1a;
    border: none;
    color: #9ca3af;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 150ms ease;
}

.fitmode-btn:first-child {
    border-right: 1px solid #374151;
}

.fitmode-btn:hover {
    color: #e5e7eb;
    background-color: #252525;
}

.fitmode-btn.active {
    background-color: #3b82f6;
    color: #ffffff;
}

.background-section {
    display: flex;
    flex-direction: column;
}

.background-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.color-picker-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-picker-group label {
    font-size: 14px;
    font-weight: 500;
    color: #e5e7eb;
}

input[type="color"] {
    -webkit-appearance: none;
    border: 1px solid #374151;
    border-radius: 6px;
    width: 44px;
    height: 36px;
    cursor: pointer;
    background: none;
    padding: 2px;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.blur-toggle-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #e5e7eb;
    user-select: none;
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-switch {
    width: 40px;
    height: 22px;
    background-color: #374151;
    border-radius: 11px;
    position: relative;
    transition: background-color 150ms ease;
    flex-shrink: 0;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background-color: #9ca3af;
    border-radius: 50%;
    transition: all 150ms ease;
}

.toggle-label input[type="checkbox"]:checked + .toggle-switch {
    background-color: #3b82f6;
}

.toggle-label input[type="checkbox"]:checked + .toggle-switch::after {
    left: 21px;
}

.toggle-label input[type="checkbox"]:disabled + .toggle-switch {
    opacity: 0.5;
    cursor: not-allowed;
}

.smartcrop-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.format-section {
    display: flex;
    flex-direction: column;
}

.format-buttons {
    display: flex;
    gap: 0;
    border: 1px solid #374151;
    border-radius: 6px;
    overflow: hidden;
    width: fit-content;
}

.format-btn {
    background-color: #1a1a1a;
    border: none;
    color: #9ca3af;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 150ms ease;
}

.format-btn:first-child {
    border-right: 1px solid #374151;
}

.format-btn:hover {
    color: #e5e7eb;
    background-color: #252525;
}

.format-btn.active {
    background-color: #3b82f6;
    color: #ffffff;
}

.quality-slider-group {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quality-slider-group label {
    font-size: 14px;
    font-weight: 500;
    color: #e5e7eb;
}

input[type="range"].slider {
    width: 100%;
    height: 4px;
    background-color: #374151;
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
    display: block;
}

input[type="range"].slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background-color: #3b82f6;
    border-radius: 50%;
    cursor: pointer;
}

input[type="range"].slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background-color: #3b82f6;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

input[type="range"].slider:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.batch-section {
    padding: 24px;
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.batch-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.batch-actions {
    display: flex;
    gap: 12px;
}

.batch-presets {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

label.batch-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #e5e7eb;
    padding: 8px 12px;
    background-color: #1a1a1a;
    border: 1px solid #374151;
    border-radius: 6px;
    transition: background-color 150ms ease;
}

label.batch-checkbox:hover {
    background-color: #252525;
}

label.batch-checkbox input[type="checkbox"] {
    display: none;
}

label.batch-checkbox .checkbox-custom {
    width: 18px;
    height: 18px;
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 4px;
    position: relative;
    transition: all 150ms ease;
    flex-shrink: 0;
}

label.batch-checkbox input[type="checkbox"]:checked + .checkbox-custom {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

label.batch-checkbox input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 6px;
    width: 4px;
    height: 8px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.batch-preset-dims {
    font-size: 12px;
    color: #6b7280;
    margin-left: auto;
}

.resize-action {
    padding-top: 8px;
}

.resize-action .button-primary {
    width: 100%;
}

.processing-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 32px;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #374151;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    font-size: 14px;
    color: #9ca3af;
}

.progress-bar {
    width: 100%;
    max-width: 300px;
    height: 4px;
    background-color: #374151;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #3b82f6;
    border-radius: 2px;
    width: 0%;
    transition: width 200ms ease;
}

.button-primary {
    background-color: #3b82f6;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: background-color 150ms ease;
    text-align: center;
}

.button-secondary {
    background-color: #1a1a1a;
    color: #e5e7eb;
    border: 1px solid #374151;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 150ms ease;
    text-align: center;
}

.button-text {
    background: none;
    border: none;
    color: #3b82f6;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    padding: 4px 0;
    transition: color 150ms ease;
}

.button-text:hover {
    color: #60a5fa;
}

.button-download {
    background-color: #059669;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: background-color 150ms ease;
    text-align: center;
    width: 100%;
}

.output-section {
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.output-header h3 {
    font-size: 22px;
    font-weight: 600;
    line-height: 28px;
    color: #d1d5db;
}

.result-preview {
    background-color: #0a0a0a;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
}

.result-preview img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 4px;
}

.result-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stat-item {
    flex: 1 1 calc(25% - 6px);
    min-width: 100px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
    padding: 12px;
    background-color: #1a1a1a;
    border-radius: 6px;
}

.stat-label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 14px;
    font-weight: 600;
    color: #e5e7eb;
}

.download-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.batch-results {
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-top: 1px solid #374151;
    padding-top: 24px;
}

.batch-results-header h4 {
    font-size: 18px;
    font-weight: 500;
    color: #d1d5db;
}

.batch-results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.batch-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background-color: #1a1a1a;
    border: 1px solid #374151;
    border-radius: 6px;
}

.batch-result-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    border: 1px solid #374151;
}

.batch-result-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.batch-result-name {
    font-size: 13px;
    font-weight: 500;
    color: #e5e7eb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.batch-result-dims {
    font-size: 12px;
    color: #9ca3af;
}

.batch-result-size {
    font-size: 12px;
    color: #6b7280;
}

.batch-result-download {
    background: none;
    border: 1px solid #374151;
    color: #3b82f6;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 150ms ease;
    flex-shrink: 0;
}

.batch-result-download:hover {
    background-color: #1e3a8a;
    border-color: #3b82f6;
}

.batch-download-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pro-cta-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.pro-cta-text {
    font-size: 14px;
    color: #d1d5db;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 24px;
}

.modal-overlay.modal-hidden {
    display: none;
}

.modal-overlay.modal-visible {
    display: flex;
}

.modal {
    background-color: #141414;
    border: 1px solid #374151;
    border-radius: 12px;
    padding: 0;
    max-width: 480px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 24px 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 22px;
    font-weight: 600;
    color: #ffffff;
}

.modal-close {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #e5e7eb;
}

.modal-content {
    padding: 24px;
}

.modal-feature-label {
    font-size: 15px;
    color: #9ca3af;
    margin-bottom: 20px;
}

.pro-features-list {
    margin-bottom: 24px;
}

.pro-feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
}

.feature-check {
    width: 20px;
    height: 20px;
    background-color: #059669;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.feature-text {
    font-size: 15px;
    color: #e5e7eb;
}

.modal-cta {
    width: 100%;
    display: block;
}

.error-message {
    background-color: #7f1d1d;
    border: 1px solid #dc2626;
    color: #fca5a5;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
}

.info-message {
    background-color: #1e3a5f;
    border: 1px solid #3b82f6;
    color: #93c5fd;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
}

.success-message {
    background-color: #064e3b;
    border: 1px solid #059669;
    color: #6ee7b7;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
}

.warning-message {
    background-color: #78350f;
    border: 1px solid #f59e0b;
    color: #fde68a;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
}

.footer {
    background-color: #0a0a0a;
    border-top: 1px solid #374151;
    padding: 32px 24px;
    text-align: center;
    margin-top: auto;
}

.footer p {
    font-size: 14px;
    color: #6b7280;
}

@media (max-width: 768px) {
        padding: 32px 16px;
    }

        font-size: 28px;
        line-height: 36px;
    }

        font-size: 14px;
    }

    .tool-main {
        padding: 24px 16px 100px;
    }

    .tool-container {
        gap: 32px;
    }

    .output-section {
        padding: 16px;
    }

    .stat-item {
        flex: 1 1 calc(50% - 4px);
        padding: 10px;
    }

    .stat-value {
        font-size: 13px;
    }

    .platform-tab {
        padding: 8px 14px;
        font-size: 13px;
    }

    .preset-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .file-upload-zone {
        padding: 32px 16px;
    }

    .pro-cta-content {
        flex-direction: column;
        gap: 10px;
    }

        padding: 0 16px;
    }

    .button-primary,
    .button-secondary {
        width: 100%;
    }

    .result-preview img {
        max-height: 280px;
    }

    .batch-result-item {
        flex-wrap: wrap;
    }

    .batch-result-download {
        width: 100%;
        text-align: center;
    }

    .batch-section {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .platform-tabs {
        gap: 6px;
    }

    .platform-tab {
        padding: 8px 12px;
        font-size: 12px;
    }

    .fitmode-btn,
    .format-btn {
        padding: 8px 18px;
        font-size: 13px;
    }
}

.modal-hidden {
    display: none;
}