/* ========== Reset & Base ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a2e;
    --bg-card: rgba(255,255,255,0.05);
    --neon-blue: #00d4ff;
    --neon-purple: #a855f7;
    --neon-pink: #ec4899;
    --neon-green: #10b981;
    --text-primary: #ffffff;
    --text-secondary: rgba(255,255,255,0.7);
    --border-color: rgba(255,255,255,0.1);
    --glass-bg: rgba(255,255,255,0.08);
    --glass-border: rgba(255,255,255,0.15);
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}
/* ========== Animated Background ========== */
.bg-animation {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1; overflow: hidden;
}
.bg-animation::before {
    content: '';
    position: absolute; top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at 20% 50%, rgba(0,212,255,0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(168,85,247,0.1) 0%, transparent 50%),
                radial-gradient(circle at 40% 80%, rgba(236,72,153,0.08) 0%, transparent 50%);
    animation: bgFloat 20s ease-in-out infinite;
}
@keyframes bgFloat {
    0%,100% { transform: translate(0,0) rotate(0deg); }
    33% { transform: translate(2%,2%) rotate(2deg); }
    66% { transform: translate(-2%,1%) rotate(-1deg); }
}
/* ========== Header ========== */
.header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(10,10,10,0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 15px 30px;
    display: flex; align-items: center; justify-content: space-between;
}
.header .logo {
    display: flex; align-items: center; gap: 12px;
    font-size: 1.5rem; font-weight: 700; text-decoration: none;
}
.header .logo i {
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    font-size: 1.8rem;
}
.header .logo span {
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.tagline { color: var(--text-secondary); font-size: 0.9rem; }
.mobile-menu-btn {
    display: none; background: none; border: none;
    color: var(--text-primary); font-size: 1.5rem; cursor: pointer;
}
.back-link {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--neon-blue); text-decoration: none;
    font-size: 0.9rem; margin-bottom: 20px;
    transition: all 0.3s ease;
}
.back-link:hover { color: var(--neon-purple); gap: 12px; }
/* ========== Sidebar ========== */
.sidebar {
    position: fixed; top: 65px; left: 0; bottom: 0;
    width: 260px; background: rgba(26,26,46,0.95);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    overflow-y: auto; z-index: 90;
    transition: transform 0.3s ease;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb {
    background: var(--glass-border); border-radius: 4px;
}
.category-title {
    padding: 20px 20px 10px; font-size: 0.75rem;
    text-transform: uppercase; letter-spacing: 2px;
    color: var(--neon-blue); font-weight: 600;
}
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 20px; cursor: pointer;
    transition: all 0.3s ease; color: var(--text-secondary);
    border-left: 3px solid transparent; text-decoration: none;
}
.nav-item:hover {
    background: rgba(255,255,255,0.05); color: var(--text-primary);
}
.nav-item.active {
    background: rgba(0,212,255,0.1);
    border-left-color: var(--neon-blue); color: var(--neon-blue);
}
.nav-item i { width: 20px; text-align: center; }
.nav-item span { font-size: 0.9rem; }
/* ========== Main Content ========== */
.main-content {
    margin-left: 260px; margin-top: 65px;
    padding: 30px; min-height: calc(100vh - 65px);
}
.tool-header {
    margin-bottom: 30px;
}
.tool-header h1 {
    font-size: 2rem; margin-bottom: 10px;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.tool-header p { color: var(--text-secondary); }
/* ========== Glass Card ========== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px; padding: 24px;
    margin-bottom: 24px;
    transition: all 0.3s ease;
}
.glass-card:hover {
    border-color: rgba(0,212,255,0.3);
    box-shadow: 0 0 30px rgba(0,212,255,0.1);
}
/* ========== Form Elements ========== */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block; margin-bottom: 8px;
    color: var(--text-secondary); font-size: 0.9rem;
}
.form-row {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}
input[type="number"], input[type="text"], select, input[type="range"] {
    width: 100%; padding: 12px 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px; color: var(--text-primary);
    font-size: 0.9rem; transition: all 0.3s ease;
}
input[type="number"]:focus, input[type="text"]:focus, select:focus {
    outline: none; border-color: var(--neon-blue);
    box-shadow: 0 0 15px rgba(0,212,255,0.2);
}
input[type="range"] {
    -webkit-appearance: none; height: 6px; padding: 0;
    background: rgba(255,255,255,0.2); border: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 20px; height: 20px;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
    border-radius: 50%; cursor: pointer;
}
select { cursor: pointer; }
select option { background: var(--bg-secondary); }
input[type="checkbox"], input[type="radio"] {
    width: auto; margin-right: 8px; accent-color: var(--neon-blue);
}
.checkbox-group { display: flex; align-items: center; gap: 10px; }
/* ========== Buttons ========== */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 24px; border: none; border-radius: 8px;
    font-size: 0.95rem; cursor: pointer; transition: all 0.3s ease;
    font-weight: 500; text-decoration: none;
}
.btn-primary {
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
    color: white;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0,212,255,0.4);
}
.btn-secondary {
    background: rgba(255,255,255,0.1); color: white;
    border: 1px solid var(--glass-border);
}
.btn-secondary:hover { background: rgba(255,255,255,0.2); }
.btn-success {
    background: linear-gradient(135deg, var(--neon-green), #059669);
    color: white;
}
.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(16,185,129,0.4);
}
.btn:disabled {
    opacity: 0.5; cursor: not-allowed; transform: none !important;
}
.btn-group { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 15px; }
/* ========== Upload Area ========== */
.upload-area {
    border: 2px dashed var(--glass-border);
    border-radius: 12px; padding: 40px;
    text-align: center; cursor: pointer;
    transition: all 0.3s ease; margin-bottom: 20px;
}
.upload-area:hover, .upload-area.dragover {
    border-color: var(--neon-blue);
    background: rgba(0,212,255,0.05);
}
.upload-area i {
    font-size: 3rem; color: var(--neon-blue); margin-bottom: 15px;
}
.upload-area p { color: var(--text-secondary); }
.upload-area .supported { font-size: 0.8rem; margin-top: 10px; opacity: 0.7; }
.file-input { display: none; }
/* ========== File List ========== */
.file-list {
    display: flex; flex-direction: column; gap: 10px; margin-top: 15px;
}
.file-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px; background: rgba(255,255,255,0.05);
    border-radius: 8px;
}
.file-item img {
    width: 50px; height: 50px; object-fit: cover; border-radius: 6px;
}
.file-item .info { flex: 1; }
.file-item .name { font-weight: 500; }
.file-item .size { color: var(--text-secondary); font-size: 0.8rem; }
.file-item .remove {
    background: none; border: none; color: #ef4444;
    cursor: pointer; font-size: 1.2rem;
}
/* ========== Progress ========== */
.progress-container {
    margin: 20px 0; display: none;
}
.progress-container.show { display: block; }
.progress-bar {
    height: 8px; background: rgba(255,255,255,0.1);
    border-radius: 4px; overflow: hidden; margin-bottom: 10px;
}
.progress-fill {
    height: 100%; width: 0; border-radius: 4px;
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple));
    transition: width 0.3s ease;
}
.progress-text {
    color: var(--text-secondary); font-size: 0.9rem;
}
/* ========== Result Area ========== */
.result-area {
    margin-top: 20px; display: none;
}
.result-area.show { display: block; }
.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px; margin-top: 15px;
}
.result-item {
    position: relative; border-radius: 8px; overflow: hidden;
    background: rgba(255,255,255,0.05);
}
.result-item img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.result-item .label {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 5px; background: rgba(0,0,0,0.7);
    font-size: 0.75rem; text-align: center;
}
.preview-image {
    max-width: 100%; max-height: 300px;
    border-radius: 8px; margin: 10px 0;
}
/* ========== Wavesurfer ========== */
#wavesurfer-container {
    width: 100%; height: 120px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px; margin: 15px 0;
    overflow: hidden;
}
/* ========== Info Sections ========== */
.info-sections { margin-top: 40px; }
.info-card {
    background: linear-gradient(135deg, rgba(0,212,255,0.05), rgba(168,85,247,0.05));
    border: 1px solid var(--glass-border);
    border-radius: 12px; padding: 20px; margin-bottom: 16px;
}
.info-card h3 {
    font-size: 1.1rem; margin-bottom: 12px;
    color: var(--neon-blue);
}
.info-card ul { list-style: none; padding: 0; }
.info-card li {
    padding: 8px 0; color: var(--text-secondary);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex; align-items: flex-start; gap: 10px;
}
.info-card li:last-child { border-bottom: none; }
.info-card li i { color: var(--neon-green); margin-top: 3px; }
.steps-list { counter-reset: step; }
.steps-list li { counter-increment: step; }
.steps-list li::before {
    content: counter(step);
    min-width: 28px; height: 28px;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
    border-radius: 50%; display: flex;
    align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 600; color: white;
}
/* ========== Loading Overlay ========== */
.loading-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8); backdrop-filter: blur(10px);
    display: none; align-items: center; justify-content: center;
    z-index: 1000; flex-direction: column; gap: 20px;
}
.loading-overlay.show { display: flex; }
.spinner {
    width: 50px; height: 50px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--neon-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: var(--text-primary); font-size: 1.1rem; }
/* ========== Toast ========== */
.toast-container {
    position: fixed; top: 80px; right: 20px; z-index: 1001;
}
.toast {
    padding: 15px 20px; border-radius: 8px;
    margin-bottom: 10px; animation: slideIn 0.3s ease;
    display: flex; align-items: center; gap: 10px;
    min-width: 280px;
}
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
.toast-success {
    background: rgba(16,185,129,0.2); border: 1px solid var(--neon-green);
    color: var(--neon-green);
}
.toast-error {
    background: rgba(239,68,68,0.2); border: 1px solid #ef4444; color: #ef4444;
}
.toast-info {
    background: rgba(0,212,255,0.2); border: 1px solid var(--neon-blue);
    color: var(--neon-blue);
}
/* ========== Position Grid ========== */
.position-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 8px; width: fit-content;
}
.position-btn {
    width: 50px; height: 35px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: 6px; color: var(--text-secondary);
    cursor: pointer; transition: all 0.3s ease;
    font-size: 0.7rem;
}
.position-btn:hover, .position-btn.active {
    background: rgba(0,212,255,0.2);
    border-color: var(--neon-blue); color: var(--neon-blue);
}
/* ========== Video Preview ========== */
.video-preview {
    max-width: 100%; border-radius: 8px;
    background: rgba(0,0,0,0.5); margin: 15px 0;
}
/* ========== Crop Grid Preview ========== */
.crop-grid-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px; max-width: 300px; margin: 15px auto;
}
.crop-grid-cell {
    aspect-ratio: 1; background: rgba(255,255,255,0.1);
    border: 1px solid var(--glass-border);
    border-radius: 4px; overflow: hidden;
}
.crop-grid-cell img { width: 100%; height: 100%; object-fit: cover; }
/* ========== Homepage Cards ========== */
.hero-section {
    text-align: center; padding: 60px 30px;
}
.hero-section h1 {
    font-size: 3rem; margin-bottom: 15px;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple), var(--neon-pink));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    animation: glow 3s ease-in-out infinite alternate;
}
@keyframes glow {
    from { filter: drop-shadow(0 0 10px rgba(0,212,255,0.3)); }
    to { filter: drop-shadow(0 0 20px rgba(168,85,247,0.4)); }
}
.hero-section p {
    color: var(--text-secondary); font-size: 1.2rem; margin-bottom: 40px;
}
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px; max-width: 1200px; margin: 0 auto;
}
.tool-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px; padding: 30px;
    text-decoration: none; color: var(--text-primary);
    transition: all 0.3s ease; display: flex;
    flex-direction: column; gap: 15px;
}
.tool-card:hover {
    transform: translateY(-5px);
    border-color: var(--neon-blue);
    box-shadow: 0 10px 40px rgba(0,212,255,0.15);
}
.tool-card .icon {
    width: 60px; height: 60px;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
    border-radius: 12px; display: flex;
    align-items: center; justify-content: center;
    font-size: 1.5rem; color: white;
}
.tool-card h3 { font-size: 1.2rem; }
.tool-card p { color: var(--text-secondary); font-size: 0.9rem; }
.tool-card .badge {
    display: inline-block; padding: 4px 10px;
    background: rgba(0,212,255,0.15);
    border: 1px solid rgba(0,212,255,0.3);
    border-radius: 20px; font-size: 0.75rem;
    color: var(--neon-blue); width: fit-content;
}
.category-header {
    grid-column: 1 / -1;
    padding: 20px 0 10px;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 10px;
}
.category-header h2 {
    font-size: 1.5rem; display: flex; align-items: center; gap: 10px;
}
.category-header h2 i {
    color: var(--neon-blue);
}
/* ========== Responsive ========== */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .mobile-menu-btn { display: block; }
    .header { padding: 15px 20px; }
    .main-content { padding: 20px; }
    .form-row { grid-template-columns: 1fr; }
    .tagline { display: none; }
    .hero-section h1 { font-size: 2rem; }
    .tools-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .tool-header h1 { font-size: 1.5rem; }
    .btn-group { flex-direction: column; }
    .btn { width: 100%; justify-content: center; }
}
