:root {
    --bg-primary: #0B0B0B;
    --bg-secondary: #161616;
    --bg-card: #1E1E1E;
    --accent-primary: #00FF00;
    --accent-glow: rgba(0, 255, 0, 0.3);
    --text-main: #FFFFFF;
    --text-dim: #888888;
    --text-muted: #555555;
    --border-color: #2A2A2A;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --sidebar-width: 72px;
    --header-height: 64px;
    --transition-speed: 0.3s;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 0;
    z-index: 100;
}

.logo {
    margin-bottom: 40px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent-primary), #00CC00);
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 15px var(--accent-glow);
}

.side-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.nav-item {
    color: var(--text-muted);
    font-size: 20px;
    text-decoration: none;
    transition: var(--transition-speed);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.nav-item:hover {
    color: var(--text-main);
    background-color: var(--bg-card);
}

.nav-item.active {
    color: var(--accent-primary);
    background-color: rgba(0, 255, 0, 0.1);
}

.sidebar-footer {
    margin-top: auto;
}

.user-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
}

/* Main Content Styling */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.content-header {
    height: var(--header-height);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 32px;
}

.tabs {
    display: flex;
    gap: 32px;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 0;
    position: relative;
    transition: var(--transition-speed);
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    color: var(--text-main);
}

.tab-btn:disabled,
.tab-btn.disabled {
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.6;
    pointer-events: none;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -18px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-glow);
}

.badge {
    background-color: #FF4D4D;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 4px;
    vertical-align: top;
}

.model-selector {
    background-color: var(--bg-card);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.history-entry-btn {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-speed);
}

.history-entry-btn:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-glow);
}

.status-indicator {
    background-color: #2A4A2A;
    color: var(--accent-primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

/* Workspace Layout */
.workspace {
    flex: 1;
    display: flex;
    padding: 24px;
    gap: 24px;
    overflow: hidden;
}

.control-panel {
    width: 400px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.upload-section {
    background-color: var(--bg-secondary);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.upload-grid {
    display: flex;
    align-items: center;
    gap: 12px;
}

.upload-box {
    flex: 1;
    height: 140px;
    background-color: #1a1a1a;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-speed);
    text-align: center;
    padding: 10px;
}

.upload-box:hover {
    border-color: var(--accent-primary);
    background-color: rgba(0, 255, 0, 0.02);
}

.upload-box.active {
    background-color: #222;
}

.upload-box i {
    font-size: 24px;
    margin-bottom: 12px;
    color: var(--text-dim);
}

.upload-box span {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
}

.upload-box small {
    color: var(--accent-primary);
    font-size: 11px;
}

.upload-box.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.transfer-icon {
    color: var(--text-muted);
}

.config-guide {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-dim);
}

.config-guide a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
}

.bottom-controls {
    margin-top: auto;
    background-color: var(--bg-secondary);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.control-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.select-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.select-group label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.select-group select {
    background-color: #1a1a1a;
    border: 1px solid var(--border-color);
    color: white;
    padding: 8px;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
}

.generate-btn {
    background: linear-gradient(135deg, #00FF00, #00CC00);
    color: black;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(0, 255, 0, 0.2);
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 255, 0, 0.4);
}

.generate-btn:active {
    transform: translateY(0);
}

/* Preview Area Styling */
.preview-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.preview-container {
    flex: 1;
    background-color: #000;
    border-radius: 24px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.video-mockup {
    width: 100%;
    height: 100%;
    position: relative;
}

.video-mockup img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
}

/* Glassmorphism Bar */
.prompt-overlay {
    position: absolute;
    bottom: 80px;
    left: 0;
    right: 0;
    padding: 0 40px;
}

.glass-bar {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.glass-bar input {
    flex: 1;
    background: none;
    border: none;
    color: white;
    font-size: 15px;
    outline: none;
}

.glass-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.toggle-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #CCC;
}

.toggle {
    width: 32px;
    height: 16px;
    background-color: #333;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
}

.toggle.active {
    background-color: var(--accent-primary);
}

.toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    background-color: white;
    border-radius: 50%;
    transition: 0.2s;
}

.toggle.active::after {
    left: 18px;
}

.send-prompt {
    width: 32px;
    height: 32px;
    background-color: var(--accent-primary);
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Video Controls Overlay */
.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
}

.playback-btn {
    color: white;
    cursor: pointer;
}

.progress-container {
    flex: 1;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.progress-bar {
    height: 100%;
    background-color: var(--accent-primary);
    border-radius: 2px;
    box-shadow: 0 0 10px var(--accent-glow);
}

.time {
    font-size: 12px;
    color: var(--text-dim);
    font-family: monospace;
}

.extra-controls {
    display: flex;
    gap: 16px;
    color: var(--text-dim);
}

.extra-controls i:hover {
    color: white;
    cursor: pointer;
}

/* Notification Styling */
.notification {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(40, 40, 40, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    animation: slideIn 0.5s ease-out;
    z-index: 1000;
}

.noti-content {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.noti-content i {
    color: var(--accent-primary);
}

.noti-content a {
    color: var(--accent-primary);
    text-decoration: underline;
}

.close-noti {
    cursor: pointer;
    color: var(--text-muted);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Login Components */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #1a1a1a 0%, #000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.login-card {
    width: 420px;
    padding: 40px;
    text-align: center;
    border-radius: 24px;
}

.glass-card {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.logo-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.logo-large h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.login-card p {
    color: var(--text-dim);
    font-size: 14px;
    margin-bottom: 32px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: left;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.input-group input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    padding: 14px;
    border-radius: 12px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: 0.2s;
}

.input-group select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    padding: 14px;
    border-radius: 12px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: 0.2s;
}

.input-group input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.1);
}

.input-group select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.1);
}

.login-footer {
    margin-top: 32px;
    color: var(--text-muted);
}

/* History Panel */
.history-panel {
    position: fixed;
    top: 20px;
    right: -400px;
    width: 360px;
    height: calc(100% - 40px);
    z-index: 1500;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.history-panel.active {
    transform: translateX(-420px);
}

.panel-header {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.panel-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.panel-header button {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 20px;
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.history-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: 0.2s;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent-primary);
}

.history-item-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.history-item-info h4 {
    font-size: 14px;
    margin-bottom: 4px;
    color: white;
}

.history-item-info span {
    font-size: 12px;
    color: var(--text-dim);
}

.status-badge {
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    font-weight: 700;
}

.status-badge.done {
    background: rgba(0, 255, 0, 0.1);
    color: var(--accent-primary);
}

.status-badge.processing {
    background: rgba(255, 165, 0, 0.1);
    color: orange;
}

.status-badge.failed {
    background: rgba(255, 0, 0, 0.1);
    color: #ff4444;
}

.history-actions {
    display: flex;
    gap: 8px;
}

.history-btn {
    flex: 1;
    padding: 8px;
    border-radius: 8px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: white;
    font-size: 12px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
}

.history-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    gap: 16px;
}

.history-empty i {
    font-size: 48px;
}
