* { box-sizing: border-box; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

body {
    background: #0a0c12;
    background-image:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(99,102,241,0.12) 0%, transparent 60%),
        radial-gradient(ellipse 40% 30% at 80% 80%, rgba(139,92,246,0.06) 0%, transparent 50%);
    background-attachment: fixed;
}

.glass {
    background: rgba(22, 27, 38, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.07);
}

.glass-light {
    background: rgba(28, 35, 51, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.06);
}

.input-field {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: #e2e8f0;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    border-radius: 10px;
}
.input-field:focus {
    border-color: rgba(99,102,241,0.6);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
.input-field::placeholder { color: rgba(255,255,255,0.2); }

.btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}
.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    opacity: 0;
    transition: opacity 0.2s;
}
.btn-primary:hover::before { opacity: 1; }
.btn-primary:active { transform: scale(0.97); }
.btn-primary > * { position: relative; z-index: 1; }

.btn-secondary {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.09);
    border-color: rgba(255,255,255,0.14);
    color: #e2e8f0;
}
.btn-secondary:active { transform: scale(0.97); }

.btn-danger {
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.15);
    color: #f87171;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-danger:hover {
    background: rgba(239,68,68,0.15);
    border-color: rgba(239,68,68,0.3);
}

.btn-success {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}
.btn-success::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #10b981, #34d399);
    opacity: 0;
    transition: opacity 0.2s;
}
.btn-success:hover::before { opacity: 1; }
.btn-success:active { transform: scale(0.97); }
.btn-success > * { position: relative; z-index: 1; }

.card-enter {
    animation: cardIn 0.35s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
}
@keyframes cardIn {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.animate-fade-in {
    animation: fadeIn 0.25s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateX(8px); }
    to { opacity: 1; transform: translateX(0); }
}

.spin { animation: spin 0.8s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.dropzone-active {
    border-color: rgba(99,102,241,0.7) !important;
    background: rgba(99,102,241,0.07) !important;
    box-shadow: 0 0 40px rgba(99,102,241,0.2), inset 0 0 30px rgba(99,102,241,0.05) !important;
}
.dropzone-active .dz-icon {
    transform: scale(1.15) translateY(-4px);
    color: #818cf8;
}

.status-converting .action-btn { opacity: 0.4; pointer-events: none; }

.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 2px 10px;
    border-radius: 99px;
    border: 1px solid transparent;
    transition: all 0.2s;
}
.tag-indigo { background: rgba(99,102,241,0.12); color: #a5b4fc; border-color: rgba(99,102,241,0.15); }
.tag-green { background: rgba(34,197,94,0.1); color: #86efac; border-color: rgba(34,197,94,0.15); }
.tag-red { background: rgba(239,68,68,0.1); color: #fca5a5; border-color: rgba(239,68,68,0.15); }
.tag-violet { background: rgba(139,92,246,0.12); color: #c4b5fd; border-color: rgba(139,92,246,0.15); }
.tag-amber { background: rgba(245,158,11,0.12); color: #fcd34d; border-color: rgba(245,158,11,0.15); }

.modal-backdrop {
    background: rgba(7, 9, 15, 0.85);
    backdrop-filter: blur(24px);
}

.progress-bar-fill {
    background: linear-gradient(90deg, #4f46e5, #7c3aed, #a855f7);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease infinite;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.cropper-view-box { outline: 2px solid #818cf8; }
.cropper-line, .cropper-point { background-color: #818cf8; }
.cropper-modal { background-color: rgba(0,0,0,0.8); }

select.input-field option { background: #1c2333; color: #e2e8f0; }

.label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
    margin-bottom: 6px;
    display: block;
}

.crop-ratio-btn {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.crop-ratio-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #e2e8f0;
}
.crop-ratio-btn.crop-ratio-active {
    background: rgba(99,102,241,0.25);
    border-color: rgba(99,102,241,0.5);
    color: #a5b4fc;
}

.btn-secondary.preset-active {
    background: rgba(99,102,241,0.15);
    border-color: rgba(99,102,241,0.5);
    color: #a5b4fc;
    box-shadow: 0 0 30px rgba(99,102,241,0.1);
    transform: translateY(-2px);
}

.confirm-active {
    background: #ef4444 !important;
    color: white !important;
    border-color: #fca5a5 !important;
    box-shadow: 0 0 20px rgba(239,68,68,0.4);
    transform: scale(1.1);
}

/* Custom Tooltips */
[data-tooltip] {
    position: relative;
}
[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    padding: 6px 10px;
    background: #1e293b;
    color: #f1f5f9;
    font-size: 11px;
    font-weight: 700;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.5);
    z-index: 100;
}
[data-tooltip]:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    border: 6px solid transparent;
    border-top-color: #1e293b;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99;
}
[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
