/* VoiceForge AI Design System */
:root {
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --accent: #10b981;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --danger: #ef4444;
    --radius: 12px;
}

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

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.1) 0px, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 20px;
}

.app-container {
    width: 100%;
    max-width: 1400px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    padding: 16px 24px;
    border-radius: var(--radius);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    font-size: 28px;
    background: rgba(99, 102, 241, 0.2);
    padding: 8px;
    border-radius: 10px;
}

.brand-text h1 {
    font-size: 22px;
    font-weight: 700;
}

.brand-text h1 span {
    color: var(--primary);
}

.tagline {
    font-size: 12px;
    color: var(--text-muted);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.badge {
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
}

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

/* Buttons */
.btn {
    padding: 10px 18px;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 15px var(--primary-glow);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-success {
    background: var(--accent);
    color: white;
    text-decoration: none;
}

.btn-large {
    padding: 14px 28px;
    font-size: 16px;
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Navigation Tabs */
.tabs-bar {
    display: flex;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 600;
    padding: 10px 18px;
    cursor: pointer;
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
    color: white;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Tab Contents */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Cards & Layout */
.grid-layout {
    display: grid;
    grid-template-columns: 320px 1fr 340px;
    gap: 20px;
}

@media (max-width: 1100px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.card-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Form Inputs */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.6);
    color: white;
    font-size: 14px;
    outline: none;
    transition: border 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary);
}

select.form-control {
    cursor: pointer;
}

.script-textarea {
    flex-grow: 1;
    min-height: 280px;
    resize: vertical;
    line-height: 1.6;
    margin-bottom: 14px;
}

/* Pill Group Filter */
.pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pill-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 20px;
    cursor: pointer;
}

.pill-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Fine tuning sliders */
.tuning-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.tuning-grid input[type="range"] {
    accent-color: var(--primary);
}

/* Editor Card Header */
.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.char-count {
    font-size: 12px;
    color: var(--text-muted);
}

/* Result Card */
.audio-result-card {
    margin-top: 20px;
    padding: 16px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.result-title {
    font-size: 14px;
    font-weight: 600;
    color: #34d399;
}

.audio-player {
    width: 100%;
}

/* File Dropzone */
.file-dropzone {
    border: 2px dashed var(--border-color);
    padding: 30px;
    border-radius: var(--radius);
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.file-dropzone:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.dropzone-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.file-dropzone p span {
    color: var(--primary);
    font-weight: 600;
}

.file-info {
    margin-top: 10px;
    font-size: 13px;
    color: #34d399;
}

/* Status Message */
.status-msg {
    margin-top: 16px;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
}

.status-msg.success {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.status-msg.error {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

/* Modal */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-card {
    background: #1e293b;
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 480px;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

.help-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Loading Spinner */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

.hidden {
    display: none !important;
}

/* --- History Log Styles --- */
.history-card {
    max-height: 600px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.history-list {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 4px;
}

/* Scrollbar styling for history */
.history-list::-webkit-scrollbar {
    width: 6px;
}
.history-list::-webkit-scrollbar-track {
    background: transparent;
}
.history-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
.history-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

.history-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    padding: 40px 10px;
}

.history-item {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.history-item.active-play {
    border-color: var(--accent);
    background: rgba(16, 185, 129, 0.05);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-voice {
    font-size: 11px;
    font-weight: 600;
    color: var(--primary-hover);
    background: rgba(99, 102, 241, 0.15);
    padding: 2px 6px;
    border-radius: 10px;
}

.history-date {
    font-size: 10px;
    color: var(--text-muted);
}

.history-text {
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 6px;
}

.history-actions-left {
    display: flex;
    gap: 8px;
}

.history-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.history-btn:hover {
    color: var(--text-main);
}

.history-btn-delete:hover {
    color: var(--danger);
}

/* ==========================================
   🔑 Premium Glassmorphism Login Dashboard
   ========================================== */

.login-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #090d16;
    overflow: hidden;
    z-index: 9999;
}

.login-bg-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(16, 185, 129, 0.05) 50%, transparent 100%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: blur(80px);
    pointer-events: none;
    animation: pulseGlow 8s infinite alternate ease-in-out;
}

@keyframes pulseGlow {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 10;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    font-size: 40px;
    background: rgba(99, 102, 241, 0.15);
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    margin: 0 auto 15px auto;
    border: 1px solid rgba(99, 102, 241, 0.25);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.login-header h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.login-header h2 span {
    color: var(--primary);
}

.login-header p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 5px;
}

.login-error-msg {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .form-control {
    background: rgba(15, 23, 42, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.login-form .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.25);
}

/* ==========================================
   🎛️ Premium Range Slider Rehaul (Custom Track & Thumb)
   ========================================== */

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    outline: none;
    margin: 12px 0;
    transition: background 0.2s ease;
}

input[type="range"]:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Chrome/Safari */
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 0 10px var(--primary-glow);
    border: 2px solid #ffffff;
    transition: transform 0.1s ease, background 0.1s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: #ffffff;
    box-shadow: 0 0 15px var(--primary);
}

/* Firefox */
input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 0 10px var(--primary-glow);
    border: 2px solid #ffffff;
    transition: transform 0.1s ease, background 0.1s ease;
}

input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
    background: #ffffff;
    box-shadow: 0 0 15px var(--primary);
}

/* ==========================================
   📁 Project Manager Component Rehaul
   ========================================== */

.project-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.4) !important;
    backdrop-filter: blur(8px);
    margin-bottom: 12px;
    padding: 12px 20px;
    gap: 15px;
    flex-wrap: nowrap;
}

.project-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.project-bar-left label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
}

.project-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.project-select {
    width: 180px !important;
    height: 32px !important;
    padding: 0 10px !important;
    border-radius: 8px !important;
    font-weight: 500;
    font-size: 13px !important;
    background: #0f172a !important;
    border: 1px solid var(--border-color) !important;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.project-select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.3) !important;
}

.btn-delete-proj {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #f87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.2) !important;
}

.btn-delete-proj:hover {
    background: rgba(239, 68, 68, 0.25) !important;
    border-color: rgba(239, 68, 68, 0.35) !important;
}

