/**
 * ToolSphare - HEIC to JPG Workstation Stylesheet
 * Fully Responsive, Mobile & Desktop Ergonomics, Dark Slate Theme
 */

.heic-workstation {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    margin: 0 auto;
    font-family: inherit;
    color: #e2e8f0;
}

/* Hero Drop Zone */
.heic-hero-dropzone {
    position: relative;
    border: 2px dashed #334155;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.75), rgba(30, 41, 59, 0.45));
    border-radius: 1.25rem;
    padding: 2.75rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.heic-hero-dropzone:hover,
.heic-hero-dropzone.is-dragover {
    border-color: #38bdf8;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.9), rgba(56, 189, 248, 0.08));
    transform: translateY(-2px);
    box-shadow: 0 12px 36px rgba(56, 189, 248, 0.15);
}

.heic-dropzone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.heic-drop-hint {
    font-size: 0.85rem;
    color: #64748b;
    margin: -0.25rem 0 0 0;
}

.heic-drop-hint .btn-link {
    color: #38bdf8;
    background: none;
    border: none;
    padding: 0;
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
    font-weight: 500;
}

.heic-drop-hint .btn-link:hover {
    color: #7dd3fc;
}

.heic-drop-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(99, 102, 241, 0.2));
    border: 1px solid rgba(56, 189, 248, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #38bdf8;
    margin-bottom: 0.25rem;
    box-shadow: 0 4px 16px rgba(56, 189, 248, 0.2);
}

.heic-drop-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #f8fafc;
    margin: 0;
}

.heic-drop-subtitle {
    font-size: 0.95rem;
    color: #94a3b8;
    margin: 0;
    max-width: 32rem;
}

.heic-drop-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.heic-btn-select {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.975rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.heic-btn-select:hover {
    background: linear-gradient(135deg, #0369a1, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
}

.heic-btn-sample {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(30, 41, 59, 0.85);
    color: #38bdf8;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(56, 189, 248, 0.35);
    cursor: pointer;
    transition: all 0.2s ease;
}

.heic-btn-sample:hover {
    background: rgba(56, 189, 248, 0.12);
    border-color: #38bdf8;
    color: #7dd3fc;
}

.heic-drop-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.heic-mini-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.775rem;
    font-weight: 500;
    color: #64748b;
    background: rgba(15, 23, 42, 0.6);
    padding: 0.3rem 0.65rem;
    border-radius: 9999px;
    border: 1px solid rgba(51, 65, 85, 0.5);
}

/* Settings Bar */
.heic-settings-card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid #1e293b;
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.heic-settings-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.95rem;
    font-weight: 600;
    color: #cbd5e1;
    margin: 0;
}

.heic-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    align-items: flex-end;
}

.heic-setting-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.heic-setting-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.heic-setting-label span.val {
    color: #38bdf8;
    font-family: monospace;
    font-size: 0.9rem;
}

.heic-select {
    width: 100%;
    background: #0b1120;
    border: 1px solid #334155;
    color: #f1f5f9;
    padding: 0.65rem 0.85rem;
    border-radius: 0.625rem;
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.heic-select:focus {
    border-color: #38bdf8;
}

.heic-range-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.heic-range {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #334155;
    outline: none;
    cursor: pointer;
}

.heic-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #38bdf8;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
    transition: transform 0.15s ease;
}

.heic-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.heic-presets-row {
    display: flex;
    gap: 0.4rem;
}

.heic-quality-preset {
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    background: #1e293b;
    border: 1px solid #334155;
    color: #94a3b8;
    border-radius: 0.4rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.heic-quality-preset:hover,
.heic-quality-preset.active {
    background: rgba(56, 189, 248, 0.15);
    border-color: #38bdf8;
    color: #38bdf8;
}

/* Queue Section */
.heic-queue-section {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid #1e293b;
    border-radius: 1.25rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.heic-queue-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #1e293b;
}

.heic-queue-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.heic-queue-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f8fafc;
    margin: 0;
}

.heic-queue-counter {
    font-size: 0.85rem;
    font-weight: 600;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    border: 1px solid rgba(56, 189, 248, 0.25);
}

.heic-queue-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
}

/* Progress Bar */
.heic-progress-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.heic-progress-track {
    height: 8px;
    background: #1e293b;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.heic-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #38bdf8, #6366f1);
    transition: width 0.2s ease;
}

.heic-progress-text {
    font-size: 0.85rem;
    color: #94a3b8;
    text-align: right;
    margin: 0;
}

/* Card Queue Grid */
.heic-queue-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.heic-queue-list::-webkit-scrollbar {
    width: 6px;
}
.heic-queue-list::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 3px;
}

.heic-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid #334155;
    border-radius: 0.85rem;
    padding: 0.85rem 1rem;
    transition: all 0.2s ease;
}

.heic-card:hover {
    border-color: #475569;
    background: rgba(30, 41, 59, 0.85);
}

.heic-card.done {
    border-color: rgba(16, 185, 129, 0.3);
}

.heic-card.error {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.05);
}

.heic-card-thumb {
    width: 4rem;
    height: 4rem;
    border-radius: 0.625rem;
    background: #0f172a;
    border: 1px solid #334155;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.heic-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.heic-thumb-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
}

.heic-thumb-pending,
.heic-thumb-err {
    color: #64748b;
}

.heic-thumb-err {
    color: #ef4444;
}

.heic-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.heic-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.heic-card-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.heic-badge {
    font-size: 0.725rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 9999px;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-ready {
    background: rgba(148, 163, 184, 0.15);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.badge-converting {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-done {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-error {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.heic-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.825rem;
    color: #94a3b8;
}

.size-orig {
    color: #94a3b8;
}

.size-conv {
    color: #f8fafc;
    font-weight: 600;
}

.size-arrow {
    color: #64748b;
}

.size-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 0.35rem;
}

.diff-smaller {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.diff-larger {
    background: rgba(234, 179, 8, 0.15);
    color: #facc15;
}

.heic-dims {
    color: #64748b;
    font-size: 0.775rem;
    background: #0f172a;
    padding: 0.15rem 0.45rem;
    border-radius: 0.25rem;
}

.heic-card-error {
    font-size: 0.8rem;
    color: #f87171;
    margin-top: 0.2rem;
}

.heic-card-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.btn-ghost {
    background: transparent;
    color: #94a3b8;
    border: none;
    padding: 0.4rem;
    border-radius: 0.4rem;
    cursor: pointer;
}

.btn-ghost:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(56, 189, 248, 0.2);
    border-top-color: #38bdf8;
    border-radius: 50%;
    animation: heicSpin 0.7s linear infinite;
}

.spinner-sm {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: heicSpin 0.7s linear infinite;
}

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

/* Modal */
.heic-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.heic-modal.is-open {
    display: flex;
}

.heic-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.heic-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.heic-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #1e293b;
}

.heic-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #f8fafc;
}

.heic-modal-header span {
    font-size: 0.85rem;
    color: #94a3b8;
}

.heic-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: #1e293b;
    border: none;
    color: #cbd5e1;
    font-size: 1.5rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.heic-modal-close:hover {
    background: #ef4444;
    color: #ffffff;
}

.heic-modal-body {
    padding: 1rem;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.heic-modal-body img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 0.5rem;
    object-fit: contain;
}

/* Feature Cards Grid below tool */
.heic-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}

.heic-feature-card {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid #1e293b;
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: all 0.2s ease;
}

.heic-feature-card:hover {
    border-color: #38bdf8;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(56, 189, 248, 0.08);
}

.heic-feature-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(99, 102, 241, 0.15));
    border: 1px solid rgba(56, 189, 248, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #38bdf8;
}

.heic-feature-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #f8fafc;
    margin: 0;
}

.heic-feature-card p {
    font-size: 0.875rem;
    color: #94a3b8;
    line-height: 1.5;
    margin: 0;
}

/* Mobile & Tablet Responsive Adjustments */
@media (max-width: 640px) {
    .heic-hero-dropzone {
        padding: 2rem 1rem;
    }

    .heic-drop-title {
        font-size: 1.15rem;
    }

    .heic-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .heic-card-thumb {
        width: 100%;
        height: 7rem;
    }

    .heic-card-actions {
        width: 100%;
        justify-content: space-between;
    }

    .heic-queue-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .heic-queue-actions {
        justify-content: stretch;
    }

    .heic-queue-actions .btn {
        flex: 1;
    }
}
