/**
 * TulBD Advanced Image Resizer Suite - Modern Interactive UI Styles
 */

.tb-resizer-container {
    max-width: 1200px;
    margin: 0 auto 40px auto;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1e293b;
}

/* Header & Quick Pills */
.tb-resizer-header {
    text-align: center;
    margin-bottom: 24px;
}

.tb-resizer-title {
    font-size: 28px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 10px 0;
    line-height: 1.25;
}

.tb-resizer-lead {
    font-size: 15px;
    color: #64748b;
    max-width: 800px;
    margin: 0 auto 18px auto;
    line-height: 1.6;
}

.tb-resizer-pills-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
}

.tb-resizer-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 11px;
    font-size: 11.5px;
    font-weight: 600;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tb-resizer-pill:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1d4ed8;
    transform: translateY(-1px);
}

.tb-resizer-pill.active {
    background: #2563eb !important;
    color: #ffffff !important;
    border-color: #1d4ed8 !important;
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.35);
}

/* Hero Dropzone */
.tb-resizer-dropzone {
    position: relative;
    border: 2px dashed #94a3b8;
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.9) 0%, rgba(241, 245, 249, 0.7) 100%);
    border-radius: 20px;
    padding: 44px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.04);
    margin-bottom: 24px;
}

.tb-resizer-dropzone:hover,
.tb-resizer-dropzone.dragover {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 10px 30px -5px rgba(37, 99, 235, 0.15);
    transform: scale(1.004);
}

.tb-resizer-file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.tb-resizer-dropzone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.tb-resizer-dropzone-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #dbeafe;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    transition: transform 0.2s ease;
}

.tb-resizer-dropzone:hover .tb-resizer-dropzone-icon {
    transform: scale(1.1);
}

.tb-resizer-dropzone-main {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    display: block;
}

.tb-resizer-dropzone-sub {
    font-size: 13px;
    color: #64748b;
    display: block;
    margin-top: 4px;
}

.tb-resizer-browse-btn {
    margin-top: 6px;
    background: #2563eb;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
    transition: background 0.15s ease;
}

.tb-resizer-browse-btn:hover {
    background: #1d4ed8;
}

.tb-resizer-paste-hint {
    margin-top: 14px;
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

/* Workspace Studio Grid */
.tb-resizer-workspace {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 35px -5px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.tb-resizer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 580px;
    width: 100%;
    box-sizing: border-box;
}

.tb-resizer-grid > * {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

@media (max-width: 900px) {
    .tb-resizer-grid {
        grid-template-columns: 1fr;
        min-height: auto;
    }
}

/* Left Controls Column */
.tb-resizer-controls-panel {
    padding: 24px 28px;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

@media (max-width: 900px) {
    .tb-resizer-controls-panel {
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        padding: 20px 16px;
    }
}

/* Selected File Bar */
.tb-resizer-file-info {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 10px 14px;
}

.tb-resizer-file-thumb {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    border: 1px solid #cbd5e1;
    flex-shrink: 0;
}

.tb-resizer-file-meta {
    flex-grow: 1;
    overflow: hidden;
}

.tb-resizer-file-name {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tb-resizer-file-stats {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.tb-resizer-btn-change {
    background: transparent;
    border: 1px solid #cbd5e1;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.tb-resizer-btn-change:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* Tabs */
.tb-resizer-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: #f1f5f9;
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
}

@media (max-width: 600px) {
    .tb-resizer-tabs {
        grid-template-columns: repeat(2, 1fr);
    }
}

.tb-resizer-tab {
    background: transparent;
    border: none;
    font-size: 12.5px;
    font-weight: 600;
    color: #64748b;
    padding: 8px 6px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.tb-resizer-tab:hover {
    color: #0f172a;
}

.tb-resizer-tab.active {
    background: #ffffff;
    color: #2563eb;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.tb-resizer-tab-pane {
    display: none;
}

.tb-resizer-tab-pane.active {
    display: block;
}

/* Input Fields & Rows */
.tb-resizer-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.tb-resizer-col {
    flex: 1;
    min-width: 0;
}

.tb-resizer-col label,
.tb-resizer-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.tb-resizer-input-suffix {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.tb-resizer-input-suffix input {
    width: 100%;
    min-width: 0;
    height: 42px;
    padding: 8px 36px 8px 12px;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    box-sizing: border-box;
    transition: border-color 0.15s ease;
}

.tb-resizer-select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 42px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    box-sizing: border-box;
    transition: border-color 0.15s ease;
    text-overflow: ellipsis;
}

.tb-resizer-input-suffix input:focus,
.tb-resizer-select:focus {
    outline: none;
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.tb-resizer-suffix {
    position: absolute;
    right: 12px;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    pointer-events: none;
}

.tb-resizer-aspect-toggle-col {
    width: 44px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tb-resizer-aspect-lock {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.tb-resizer-aspect-lock:hover {
    background: #e2e8f0;
}

.tb-resizer-aspect-lock.active {
    background: #eff6ff;
    color: #2563eb;
    border-color: #93c5fd;
}

/* Preset Chips */
.tb-resizer-preset-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
}

.tb-resizer-chip-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-right: 4px;
}

.tb-resizer-chip,
.tb-resizer-kb-chip,
.tb-resizer-ratio-chip,
.tb-resizer-print-chip {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-size: 11.5px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tb-resizer-chip:hover,
.tb-resizer-kb-chip:hover,
.tb-resizer-ratio-chip:hover,
.tb-resizer-print-chip:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.tb-resizer-chip.active,
.tb-resizer-kb-chip.active,
.tb-resizer-ratio-chip.active,
.tb-resizer-print-chip.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

/* Range Alert Notice */
.tb-resizer-range-alert {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 10px;
    padding: 10px 14px;
    margin-top: 12px;
    font-size: 13px;
    color: #065f46;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

/* Social Presets */
.tb-social-box {
    margin-top: 12px;
    background: #faf5ff;
    border: 1px solid #e9d5ff;
    border-radius: 10px;
    padding: 12px;
}

.tb-social-title {
    font-size: 12.5px;
    font-weight: 700;
    color: #7e22ce;
    margin-bottom: 8px;
}

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

.tb-btn-social {
    background: #ffffff;
    border: 1px solid #d8b4fe;
    color: #6b21a8;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tb-btn-social:hover,
.tb-btn-social.active {
    background: #7e22ce;
    color: #ffffff;
    border-color: #7e22ce;
}

/* Print Section */
.tb-print-config {
    margin-top: 12px;
}

.tb-passport-toggle-box {
    display: flex;
    align-items: center;
}

.tb-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
}

.tb-checkbox-label input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Advanced Section */
.tb-resizer-advanced-section {
    border-top: 1px solid #f1f5f9;
    padding-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tb-resizer-range {
    width: 100%;
    height: 6px;
    accent-color: #2563eb;
    cursor: pointer;
    margin-top: 10px;
}

/* Action Center */
.tb-resizer-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.tb-btn-download {
    flex-grow: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    padding: 13px 20px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    transition: all 0.15s ease;
}

.tb-btn-download:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
}

.tb-btn-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #334155;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 18px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tb-btn-copy:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* Right Interactive Preview Panel */
.tb-resizer-preview-panel {
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #f1f5f9;
}

.tb-resizer-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}

.tb-preview-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.tb-preview-badges {
    display: flex;
    gap: 6px;
}

.tb-badge {
    font-size: 11.5px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
}

.tb-badge-size {
    background: #dbeafe;
    color: #1e40af;
}

.tb-badge-dim {
    background: #f1f5f9;
    color: #475569;
}

.tb-badge-diff {
    background: #dcfce7;
    color: #166534;
}

/* Viewport & Canvas */
.tb-resizer-viewport {
    flex-grow: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 16px 16px;
    background-color: #f8fafc;
    min-height: 420px;
}

.tb-resizer-canvas-wrap {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
}

.tb-output-canvas {
    max-width: 100%;
    max-height: 460px;
    height: auto;
    display: block;
    object-fit: contain;
}

/* 2x2 Passport Overlay */
.tb-passport-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    box-sizing: border-box;
    border: 2px dashed rgba(37, 99, 235, 0.7);
}

.tb-guide-head-oval {
    position: absolute;
    top: 15%;
    left: 20%;
    width: 60%;
    height: 65%;
    border-radius: 50% 50% 45% 45%;
    border: 2px dashed rgba(239, 68, 68, 0.75);
}

.tb-guide-eyes-line {
    position: absolute;
    top: 42%;
    left: 10%;
    width: 80%;
    border-top: 1px dashed rgba(245, 158, 11, 0.85);
}

.tb-guide-chin-line {
    position: absolute;
    top: 75%;
    left: 25%;
    width: 50%;
    border-top: 1px dashed rgba(239, 68, 68, 0.85);
}

.tb-guide-label {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.75);
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

/* Loading Spinner */
.tb-resizer-spinner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.75);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 10;
}

.tb-spin-circle {
    width: 38px;
    height: 38px;
    border: 3.5px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: tbResizerSpin 0.7s linear infinite;
}

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

/* Viewport Footer */
.tb-viewport-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 18px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
}

.tb-zoom-controls {
    display: flex;
    gap: 4px;
}

.tb-btn-zoom {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tb-btn-zoom.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.tb-viewport-format {
    font-size: 11.5px;
    font-weight: 700;
    color: #64748b;
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 6px;
}

/* ============================================================
   STICKY MOBILE ACTION BAR (Disabled per user request)
   ============================================================ */
.tb-resizer-mobile-bar {
    display: none !important;
}

.tb-resizer-mobile-bar.active {
    display: none !important;
}

/* Responsive Controls on Mobile (<= 768px) */
@media (max-width: 768px) {
    .tb-resizer-container {
        padding-bottom: 0;
    }

    .tb-resizer-advanced-section .tb-resizer-row,
    .tb-print-config {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .tb-resizer-col {
        width: 100%;
        min-width: 0;
    }

    .tb-resizer-select {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 600px) {
    .tb-resizer-title {
        font-size: 22px;
    }

    .tb-resizer-lead {
        font-size: 13.5px;
    }

    .tb-resizer-dropzone {
        padding: 30px 14px;
        border-radius: 16px;
    }

    .tb-resizer-dropzone-icon {
        width: 58px;
        height: 58px;
    }

    .tb-resizer-dropzone-main {
        font-size: 16px;
    }

    .tb-resizer-tabs {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 6px;
        padding-bottom: 4px;
    }

    .tb-resizer-tabs::-webkit-scrollbar {
        display: none;
    }

    .tb-resizer-tab {
        flex-shrink: 0;
        white-space: nowrap;
        font-size: 12.5px;
        padding: 8px 12px;
        min-height: 40px;
    }

    .tb-resizer-input-suffix input,
    .tb-resizer-select {
        font-size: 16px !important;
        height: 44px;
    }

    .tb-resizer-chip,
    .tb-resizer-kb-chip,
    .tb-resizer-ratio-chip,
    .tb-resizer-print-chip {
        padding: 8px 12px;
        font-size: 12.5px;
        min-height: 38px;
    }

    .tb-resizer-viewport {
        min-height: 280px;
        padding: 12px;
    }

    .tb-output-canvas {
        max-height: 320px;
    }

    .tb-resizer-row {
        gap: 8px;
    }

    .tb-resizer-aspect-toggle-col {
        width: 36px;
        min-width: 36px;
    }

    .tb-resizer-actions {
        flex-direction: column;
        gap: 8px;
    }

    .tb-btn-download,
    .tb-btn-copy {
        width: 100%;
        justify-content: center;
    }
}
