@import url('../../common/fonts/outfit.css');

:root {
    --bg-color: #0b1121;
    --text-color: #f1f5f9;
    --text-muted: #94a3b8;
    --accent-color: #00e5ff;
    --secondary-color: #ff0080;
    --tertiary-color: #8b5cf6;
    
    --panel-bg: rgba(255, 255, 255, 0.02);
    --panel-border: rgba(255, 255, 255, 0.05);
    
    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    
    --gradient-start: var(--accent-color);
    --gradient-end: var(--secondary-color);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', 'Inter', system-ui, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Background Blobs */
.bg-blobs {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background: radial-gradient(circle at center, #0f172a 0%, #020617 100%);
}
.blob {
    position: absolute;
    filter: blur(80px);
    border-radius: 50%;
    opacity: 0.5;
    animation: drift 20s infinite alternate ease-in-out;
}
.blob-1 { top: -20%; left: -10%; width: 50vw; height: 50vw; background: rgba(0, 229, 255, 0.12); animation-delay: 0s; }
.blob-2 { bottom: -10%; right: -10%; width: 60vw; height: 60vw; background: rgba(255, 0, 128, 0.08); animation-delay: -5s; }
.blob-3 { top: 30%; left: 40%; width: 40vw; height: 40vw; background: rgba(139, 92, 246, 0.1); transform: translateX(-50%); animation-delay: -10s; }

@keyframes drift {
    0% { transform: translate(0, 0) rotate(0deg) scale(1); }
    100% { transform: translate(3%, 5%) rotate(5deg) scale(1.05); }
}

/* Typography */
header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    z-index: 1;
}

h1 {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--accent-color), var(--tertiary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 800;
    letter-spacing: -1.5px;
    filter: drop-shadow(0 0 20px rgba(0, 229, 255, 0.15));
}

.sub-heading {
    font-size: 1.6rem;
    margin-bottom: 1rem;
    color: #fff;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 400;
}

/* Layout */
.container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.workspace {
    flex: 1.2;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.controls {
    flex: 1;
    min-width: 320px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--glass-shadow);
}

/* Canvas Area */
.canvas-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    background: #000;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Form Elements & Containers */
.upload-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

/* Buttons */
.btn {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color), #00b3cc);
    border: none;
    color: #000;
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #33ebff, var(--accent-color));
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 229, 255, 0.5);
    color: #000;
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color), #cc0066);
    border: none;
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 0, 128, 0.3);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #ff3399, var(--secondary-color));
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 0, 128, 0.5);
    color: #fff;
}

.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(1);
}

/* Controls & Settings */
.control-group {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s;
}
.control-group:hover {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255,255,255, 0.1);
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    letter-spacing: 0.5px;
}
.control-group h3 i { margin-right: 0.5rem; color: var(--accent-color); }

.control-item {
    margin-bottom: 1.2rem;
}
.control-item:last-child { margin-bottom: 0; }

.control-item label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 500;
}

.value-display {
    font-weight: 700;
    color: var(--accent-color);
    background: rgba(0, 229, 255, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    min-width: 40px;
    text-align: center;
}

/* Inputs & Sliders */
input[type="file"] { display: none; }

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    border: 3px solid #0f172a;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.3);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.6);
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem 0;
}
.checkbox-container label {
    margin: 0;
    font-size: 1rem;
    color: #fff;
    cursor: pointer;
}

input[type="checkbox"] {
    appearance: none;
    width: 22px;
    height: 22px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
input[type="checkbox"]:checked {
    background: linear-gradient(135deg, var(--accent-color), var(--tertiary-color));
    border-color: transparent;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}
input[type="checkbox"]:checked::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    color: #0b1121;
    font-size: 12px;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}

/* Aspect Ratio / Number Inputs */
.aspect-ratio-container {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    background: var(--glass-bg);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid var(--glass-border);
}

.aspect-ratio-container input[type="number"],
.export-settings input[type="number"],
.export-settings input[type="text"] {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 0.6rem;
    border-radius: 8px;
    width: 70px;
    text-align: center;
    font-size: 1rem;
    font-weight: 500;
    transition: border-color 0.3s;
}
.aspect-ratio-container input[type="number"]:focus {
    border-color: var(--accent-color);
    outline: none;
}
.aspect-ratio-container span {
    font-weight: bold;
    color: var(--text-muted);
}

.aspect-ratio-presets {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.aspect-ratio-presets button {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

/* Tabs */
.segment-control {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 0.4rem;
    gap: 0.4rem;
}
.segment-control button {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.8rem 1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
}
.segment-control button:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}
.segment-control button.active {
    background: var(--glass-bg);
    color: var(--accent-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tab-content { display: none; }
.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Export Settings & Progress */
.export-settings {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    background: var(--glass-bg);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    margin-bottom: 1.5rem;
}
.export-settings .control-item {
    flex: 1;
    min-width: 150px;
    margin-bottom: 0;
}

.button-center-container {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0;
}

.progress-container {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 12px;
}
.progress-container p { margin-bottom: 0.5rem; font-weight: 600; }
progress {
    width: 100%; height: 8px;
    border-radius: 4px; overflow: hidden;
}
progress::-webkit-progress-bar { background: rgba(255, 255, 255, 0.1); }
progress::-webkit-progress-value { background: linear-gradient(90deg, var(--accent-color), var(--secondary-color)); }

/* Results */
.result-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.result-preview {
    max-width: 100%;
    max-height: 500px;
    border-radius: 16px;
    display: none;
    box-shadow: var(--glass-shadow);
    border: 1px solid var(--glass-border);
}
.download-container {
    display: flex; gap: 0.8rem; margin-top: 1.5rem; flex-wrap: wrap; justify-content: center;
}

.status-message { color: var(--accent-color); margin-top: 1rem; font-weight: 500; text-align: center; display: inline-flex; align-items: center; justify-content: center; width: 100%; gap: 2px;}
.status-message::after { content: ''; display: inline-block; width: 2px; height: 1.1em; background: var(--accent-color); animation: status-blink 1s step-end infinite; vertical-align: middle; margin-left: 2px; }
@keyframes status-blink { 0%,100%{opacity:1} 50%{opacity:0} }
.debug-info {
    font-size: 0.8rem; color: var(--text-muted); background: rgba(0, 0, 0, 0.4);
    padding: 1rem; border-radius: 8px; margin-top: 1rem; max-height: 120px; overflow-y: auto;
}

/* Animation Frames Display */
.animation-display {
    background: var(--glass-bg);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
}
.animation-controls { display: flex; gap: 0.8rem; justify-content: center; margin-bottom: 1rem; }
.animation-frames {
    display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center;
    max-height: 250px; overflow-y: auto; padding: 1rem;
    background: rgba(0, 0, 0, 0.2); border-radius: 12px;
}
.frame-thumbnail {
    width: 60px; height: 60px; object-fit: cover; border-radius: 8px;
    cursor: pointer; border: 2px solid transparent; transition: all 0.2s;
}
.frame-thumbnail:hover { transform: scale(1.1); box-shadow: 0 4px 10px rgba(0,0,0,0.3); }
.frame-thumbnail.active { border-color: var(--accent-color); box-shadow: 0 0 12px rgba(0, 229, 255, 0.4); }

.gif-settings {
    margin-top: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 12px;
}
.gif-settings h4 { margin-bottom: 1rem; color: var(--text-color); font-size: 1.1rem; }
.quality-buttons, .size-buttons { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.quality-btn, .size-btn { flex: 1; min-width: 90px; }
.size-btn.active, .quality-btn.active { background: var(--accent-color); color: #000; border-color: var(--accent-color); }

/* Tooltips */
.tooltip {
    position: relative; display: inline-flex; align-items: center; margin-left: 6px; cursor: help;
    color: var(--text-muted); transition: color 0.2s;
}
.tooltip:hover { color: var(--accent-color); }
.tooltip .tooltiptext {
    visibility: hidden; width: 220px;
    background: #0f172a; border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff; text-align: left; border-radius: 8px; padding: 12px;
    position: absolute; z-index: 10; bottom: 130%; left: 50%; margin-left: -110px;
    opacity: 0; transition: all 0.3s; font-size: 0.85rem; font-weight: normal; font-family: 'Inter', sans-serif;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}
.tooltip .tooltiptext.visible, .tooltip:hover .tooltiptext {
    visibility: visible; opacity: 1; bottom: 150%;
}
.tooltip .tooltiptext::after {
    content: ""; position: absolute; top: 100%; left: 50%; margin-left: -6px;
    border-width: 6px; border-style: solid; border-color: #0f172a transparent transparent transparent;
}

/* Drag & Drop Overlay */
.drop-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
    transition: all 0.3s ease;
}
.drop-overlay i { font-size: 2.5rem; color: rgba(255, 255, 255, 0.3); margin-bottom: 0.8rem; transition: color 0.3s; }
.drop-overlay p { font-size: 1rem; color: rgba(255, 255, 255, 0.3); font-weight: 600; transition: color 0.3s; }

/* Highlight on drag over */
.canvas-container.drag-over .drop-overlay {
    background: rgba(0, 229, 255, 0.12);
    border-color: var(--accent-color);
    backdrop-filter: blur(4px);
}
.canvas-container.drag-over .drop-overlay i { color: var(--accent-color); }
.canvas-container.drag-over .drop-overlay p { color: var(--accent-color); }

/* Hide overlay after image is loaded */
.canvas-container.has-image .drop-overlay { display: none; }
.canvas-container.has-image.drag-over .drop-overlay { display: flex; }

/* HQ Export Panel */
.hq-export-panel {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.hq-export-panel h4 { color: var(--accent-color); margin-bottom: 0.5rem; font-size: 1rem; }
.hq-export-panel .hq-desc { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1rem; }
.hq-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.hq-btn { flex: 1; min-width: 80px; }

/* SEO Content */
.seo-content-v2 {
    max-width: 1000px; width: 100%; margin: 6rem auto 2rem; position: relative; z-index: 1;
}
.seo-section-v2 {
    background: var(--glass-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border); border-radius: 24px; padding: 3rem;
    margin-bottom: 3rem; box-shadow: var(--glass-shadow);
}
.seo-section-v2 h2.seo-glitch-title {
    font-size: 1.7rem; margin-bottom: 2rem; text-align: center;
    background: linear-gradient(135deg, #fff, var(--text-muted)); -webkit-background-clip: text; background-clip: text; color: transparent;
    font-weight: 700; position: relative;
}
.seo-section-v2 p { font-size: 0.95rem; color: #cbd5e1; margin-bottom: 1.5rem; line-height: 1.8; }

.feature-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; margin-top: 2rem; }
.feature-item {
    background: rgba(0, 0, 0, 0.2); border-radius: 16px; padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05); transition: transform 0.3s, background 0.3s;
}
.feature-item:hover { transform: translateY(-5px); background: rgba(0, 0, 0, 0.3); border-color: rgba(255,255,255, 0.1); }
.feature-item h3 { font-size: 1.1rem; color: #fff; margin-bottom: 0.8rem; display: flex; align-items: center; gap: 0.8rem; }
.feature-item p { font-size: 0.9rem; margin-bottom: 0; color: var(--text-muted); }

/* Accordion */
.accordion { border-radius: 16px; overflow: hidden; border: 1px solid var(--glass-border); background: rgba(0, 0, 0, 0.2); }
.accordion-item { border-bottom: 1px solid var(--glass-border); }
.accordion-item:last-child { border-bottom: none; }
.accordion-button {
    background: transparent; color: #fff; cursor: pointer; padding: 1.2rem 1.5rem; width: 100%; text-align: left;
    border: none; outline: none; font-size: 1rem; font-weight: 600; display: flex; justify-content: space-between;
    transition: background 0.3s;
}
.accordion-button:hover { background: rgba(255, 255, 255, 0.03); }
.accordion-button:after {
    content: '\f067'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
    color: var(--accent-color); transition: transform 0.3s;
}
.accordion-button.active:after { content: '\f068'; transform: rotate(180deg); }
.accordion-content { background: rgba(0, 0, 0, 0.1); max-height: 0; overflow: hidden; transition: max-height 0.4s ease; }
.accordion-content p { padding: 1.2rem 1.5rem; margin: 0; font-size: 0.95rem; }

/* Usage Notice */
.usage-notice-v2 { background: rgba(0, 0, 0, 0.2); border-radius: 16px; padding: 2rem; border-left: 4px solid var(--secondary-color); }
.usage-notice-v2 h3 { color: var(--secondary-color); font-size: 1.1rem; margin-bottom: 1rem; }
.usage-notice-v2 ul { padding-left: 1.5rem; margin-bottom: 1.5rem; color: #cbd5e1; }
.usage-notice-v2 ul li { margin-bottom: 0.5rem; }

/* Footer */
footer { text-align: center; margin-top: 4rem; padding-bottom: 2rem; z-index: 1; position: relative; }
footer p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.5; margin-bottom: 1rem; }
footer a { color: var(--accent-color); text-decoration: none; font-weight: 500; transition: color 0.2s; }
footer a:hover { color: #fff; text-shadow: 0 0 8px rgba(0, 229, 255, 0.5); }

/* Responsive Settings */
@media (max-width: 900px) {
    .container { flex-direction: column; }
    h1 { font-size: 2rem; }
    .sub-heading { font-size: 1.3rem; }
    .feature-list { grid-template-columns: 1fr; }
    .seo-section-v2 { padding: 2rem; }
    .seo-section-v2 h2.seo-glitch-title { font-size: 1.4rem; }
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 10px; background: #0b1121; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }
