/* SoundLabs - Complete Dark Theme CSS (Standalone) */

/* ==========================================================================
   1. CSS VARIABLES & BASE STYLES
   ========================================================================== */
:root {
    --bg-primary: #0D0C1D;
    --bg-secondary: rgba(255, 255, 255, 0.05);
    --bg-tertiary: rgba(255, 255, 255, 0.08);
    --text-primary: #E5E7EB;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;
    --text-color: #E5E7EB;
    --border-color: rgba(255, 255, 255, 0.1);
    --primary-color: #8B5CF6; /* Purple for music theme */
    --secondary-color: #EC4899; /* Pink accent */
    --success-color: #10B981;
    --error-color: #EF4444;
    --transition: 0.3s ease;
    --transition-speed: 0.3s;
    --glass-background: rgba(255, 255, 255, 0.05);
    --glass-background-hover: rgba(255, 255, 255, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: var(--bg-primary) !important;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* ==========================================================================
   2. NAVIGATION - FROM IMAGESTACK
   ========================================================================== */
.nav-container {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #0D0C1D !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    width: 100%;
}

.nav-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    height: 4rem;
    background-color: #0D0C1D !important;
}

.nav-links {
    display: none;
}

.auth-buttons {
    display: none;
}

.nav-link {
    padding: 0.5rem 0.75rem;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 0.375rem;
    transition: background-color var(--transition-speed), color var(--transition-speed);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    position: relative;
    z-index: 1;
}

.nav-link:hover {
    background-color: var(--glass-background-hover);
    color: var(--text-color);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.08);
}

/* Dropdown styles */
.nav-item.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown-toggle {
    cursor: pointer;
}

.dropdown-arrow {
    margin-left: 0.4em;
    font-size: 0.7em;
    transition: transform var(--transition-speed) ease;
    display: inline-block;
    vertical-align: middle;
}

.nav-dropdown-menu {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    min-width: 200px;
    padding: 0.5rem 0;
    background: #0D0C1D;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.5rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    pointer-events: none;
    transition: opacity var(--transition-speed) ease,
                visibility var(--transition-speed) ease,
                transform var(--transition-speed) ease;
}

.nav-item.nav-dropdown:hover > .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.nav-item.nav-dropdown:hover > .nav-dropdown-toggle .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-item {
    display: block;
    padding: 0.6rem 1.2rem;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

.nav-dropdown-item:hover,
.nav-dropdown-item:focus,
.nav-dropdown-item.active {
    background-color: var(--secondary-color);
    color: var(--text-color);
    text-decoration: none;
}

/* Mobile Menu Button */
.mobile-menu-button {
    display: block;
    background: none;
    border: none;
    color: var(--text-color);
    padding: 0.5rem;
    cursor: pointer;
    transition: opacity var(--transition-speed);
    margin-left: auto;
    z-index: 51;
}

.mobile-menu-button:hover {
    opacity: 0.8;
}

/* Mobile Menu Panel */
.mobile-menu {
    display: none;
    position: fixed;
    top: 4rem;
    left: 0;
    right: 0;
    background: #0D0C1D !important;
    backdrop-filter: blur(12px);
    padding: 1rem 0;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    transform: translateY(-100%);
    transition: transform var(--transition-speed) ease-out;
    z-index: 49;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mobile-menu.active {
    transform: translateY(0);
    display: block;
}

.mobile-menu .nav-link:not(.sub-link),
.mobile-menu .mobile-submenu-toggle {
    display: block;
    padding: 0.9rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-decoration: none;
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
    color: var(--text-color);
}

/* Mobile submenu styles */
.mobile-submenu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-submenu {
    background-color: rgba(0, 0, 0, 0.1);
    padding-left: 0;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease-out;
}

.mobile-submenu .sub-link {
    display: block;
    padding: 0.75rem 1.5rem 0.75rem 2.5rem;
    text-align: left;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-decoration: none;
}

.mobile-menu .auth-buttons-mobile {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1.5rem 1.5rem 1rem;
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.75rem;
}

/* Logo Styling */
.nav-logo-link {
    display: inline-flex;
    align-items: center;
    height: 100%;
    padding: 0.25rem 0;
    margin-right: 1rem;
}

.nav-logo-img {
    height: 2.5rem;
    width: auto;
    max-height: calc(100% - 0.5rem);
    transition: height var(--transition-speed) ease;
    display: block;
}

/* Desktop Navigation */
@media (min-width: 910px) {
    .mobile-menu-button {
        display: none !important;
    }
    .mobile-menu {
        display: none !important;
    }
    .nav-links {
        display: flex !important;
        gap: 0.5rem;
        align-items: center;
        margin-left: 1rem;
        margin-right: auto;
    }
    .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    .auth-buttons {
        display: flex !important;
        gap: 0.5rem;
        align-items: center;
        margin-left: 1rem;
    }
    .nav-content {
        height: 4rem;
    }
    .nav-logo-img {
        height: 64px;
    }
    .nav-logo-link {
        margin-right: 1rem;
    }
}

.profile-icon, .submit-icon {
    padding:10px!important;
}

.profile-menu.show {
    background: #0D0C1D!important;
}
/* ==========================================================================
   3. BUTTONS - FROM IMAGESTACK
   ========================================================================== */
.button {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all var(--transition-speed);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
}

.button-primary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.button-primary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    color: var(--text-color);
    text-decoration: none;
}

.button-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.button-secondary:hover {
    background: var(--bg-secondary);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    text-decoration: none;
}

.button-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-color);
}

.button-outline:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-color);
    text-decoration: none;
}

/* Mobile Menu Buttons */
.mobile-menu .button {
    width: 100%;
    padding: 0.75rem 0.5rem;
    font-size: 1rem;
}

.mobile-menu .button-primary {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.mobile-menu .button-outline {
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
}

/* ==========================================================================
   4. MODAL STYLES - FROM IMAGESTACK
   ========================================================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
}

.modal-content {
    background: rgba(13, 12, 29, 0.98);
    margin: 10% auto;
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    width: 90%;
    max-width: 500px;
    color: var(--text-primary);
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition);
}

.close:hover {
    color: var(--text-primary);
}

.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.modal-content h2 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* ==========================================================================
   5. TOAST NOTIFICATIONS - FROM IMAGESTACK
   ========================================================================== */
.toast-container {
    position: fixed;
    top: 5rem;
    right: 1rem;
    z-index: 1000;
}

.toast {
    background: rgba(13, 12, 29, 0.95);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    animation: slideIn 0.3s ease-out;
    backdrop-filter: blur(10px);
}

.toast-success {
    border-left: 3px solid var(--success-color);
}

.toast-error {
    border-left: 3px solid var(--error-color);
}

.toast-info {
    border-left: 3px solid var(--primary-color);
}

.toast i {
    margin-right: 0.5rem;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ==========================================================================
   6. FOOTER - FROM IMAGESTACK
   ========================================================================== */
.footer {
    background: var(--bg-primary) !important;
    backdrop-filter: blur(10px);
    padding: 4rem 0 0;
    margin-top: 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 4rem;
}

.footer-section h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.footer-description {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-speed);
}

.footer-links a:hover {
    color: var(--text-color);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-color);
    transition: all var(--transition-speed);
    text-decoration: none;
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
    color: var(--text-color);
    text-decoration: none;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem 0;
    margin-top: 2rem;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-bottom p {
    margin: 0;
    color: var(--text-muted);
}

.footer-bottom-links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-bottom-links a,
.footer-bottom-links button {
    color: var(--text-muted);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-size: inherit;
    transition: color var(--transition-speed);
}

.footer-bottom-links a:hover,
.footer-bottom-links button:hover {
    color: var(--text-color);
}

.footer-v2 {
    background: #0D0C1D !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    margin: 0 !important;
}

/* ==========================================================================
   7. SOUNDLABS SPECIFIC LAYOUT
   ========================================================================== */
.soundlabs-container {
    display: flex;
    min-height: calc(100vh - 64px);
    background: var(--bg-primary);
}

.soundlabs-sidebar {
    width: 280px;
    background: rgba(255, 255, 255, 0.03);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    position: sticky;
    top: 64px;
    height: calc(100vh - 64px);
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-section {
    padding: 1rem 0;
}

.sidebar-section h3 {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0 1.5rem;
    margin-bottom: 0.5rem;
}

.tool-nav {
    display: flex;
    flex-direction: column;
}

.tool-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition);
    position: relative;
}

.tool-link:hover:not(.disabled) {
    background: var(--bg-secondary);
    color: var(--text-primary);
    text-decoration: none;
}

.tool-link.active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.tool-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-color);
}

.tool-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tool-link i {
    width: 20px;
    text-align: center;
}

.badge-new {
    background: var(--primary-color);
    color: white;
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    margin-left: auto;
    text-transform: uppercase;
}

.badge-soon {
    background: var(--text-muted);
    color: white;
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    margin-left: auto;
    text-transform: uppercase;
}

.soundlabs-main {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.tool-header {
    padding: 20px;
}

.tool-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.tool-title h1 {
    font-size: 2rem;
    color: var(--text-primary);
    margin: 0;
}

.usage-counter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-secondary);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.tool-description p {
    color: var(--text-secondary);
    margin: 0;
}

/* ==========================================================================
   8. SOUNDLABS GENERATION WORKSPACE
   ========================================================================== */
.generation-workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.generation-panel,
.result-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    overflow: hidden;
}

.panel-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin: 0;
}

.generation-controls {
    padding: 1.5rem;
}

.control-group {
    margin-bottom: 1.5rem;
}

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

.control-group label {
    display: block;
    color: var(--text-primary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control,
.form-select {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 0.5rem;
    transition: all var(--transition);
    font-family: inherit;
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(139, 92, 246, 0.05);
}

/* Duration slider */
.duration-slider-container {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.duration-display {
    text-align: center;
    margin-top: 0.5rem;
    font-size: 1.125rem;
    color: var(--text-primary);
}

.form-range {
    width: 100%;
    height: 6px;
    background: var(--bg-primary);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.form-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 8px rgba(139, 92, 246, 0.1);
}

.form-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

/* Advanced settings */
.advanced-settings {
    margin-top: 1.5rem;
}

.advanced-toggle {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.advanced-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.advanced-panel {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.5rem;
}

.scale-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.scale-display small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.scale-display span {
    color: var(--text-primary);
    font-weight: 600;
}

/* Generate button */
.generate-btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.generate-btn:hover:not(:disabled) {
    background: #7C3AED;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.generate-btn:disabled {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ==========================================================================
   9. RESULT AREA & AUDIO PLAYER
   ========================================================================== */
.result-area {
    min-height: 400px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.result-placeholder {
    text-align: center;
    color: var(--text-muted);
}

.result-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.audio-player {
    width: 100%;
}

.track-info {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.track-info h4 {
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.track-prompt {
    color: var(--text-secondary);
    margin: 0.5rem 0;
    font-style: italic;
}

.track-meta {
    display: flex;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.audio-control {
    width: 100%;
    margin: 1rem 0;
}

.audio-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    flex: 1;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
}

/* Processing indicator */
.processing-indicator {
    text-align: center;
    color: var(--text-primary);
}

.generation-progress {
    margin-top: 1.5rem;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.progress-bar {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0;
    animation: progress 30s linear;
}

@keyframes progress {
    to { width: 100%; }
}

/* ==========================================================================
   10. HISTORY SECTION
   ========================================================================== */
.generation-history {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.history-header h3 {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-counter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.history-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all var(--transition);
}

.history-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.history-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.history-info {
    flex: 1;
    min-width: 0;
}

.history-prompt {
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-duration {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.history-notice {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background-color: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 0.5rem;
    color: var(--text-primary);
    text-align: center;
    font-size: 0.875rem;
}

/* ==========================================================================
   11. LOGIN OVERLAY & GUEST STATES
   ========================================================================== */
.login-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(13, 12, 29, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.login-prompt {
    text-align: center;
    padding: 2rem;
    max-width: 400px;
}

.login-prompt h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.login-prompt p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.login-prompt .button {
    display: inline-block;
    margin: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all var(--transition);
}

.login-prompt .button-primary {
    background: var(--primary-color);
    color: white;
}

.login-prompt .button-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

/* ==========================================================================
   12. MOBILE TOOLS MENU
   ========================================================================== */
.mobile-tools-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 100;
    transition: all var(--transition);
}

.mobile-tools-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.mobile-tools-menu {
    display: none;
    position: fixed;
    bottom: 90px;
    right: 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    z-index: 99;
    min-width: 250px;
    max-height: 70vh;
    overflow-y: auto;
}

.mobile-tools-menu.active {
    display: block;
}

.mobile-tools-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.mobile-tools-header h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ==========================================================================
   13. UTILITIES & ANIMATIONS
   ========================================================================== */
.loading {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

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

.prompt-tips {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 0.25rem;
}

.prompt-tips small {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ==========================================================================
   14. RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 1024px) {
    .generation-workspace {
        grid-template-columns: 1fr;
    }
    
    .soundlabs-sidebar {
        display: none;
    }
    
    .soundlabs-main {
        padding: 1rem;
        padding-bottom: 100px;
    }
    
    .mobile-tools-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-tools-menu .tool-nav {
        display: flex;
        flex-direction: column;
    }
    
    .mobile-tools-menu .tool-link {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.75rem 1.5rem;
        color: var(--text-secondary);
        text-decoration: none;
        transition: all var(--transition);
        position: relative;
    }
    
    .mobile-tools-menu .tool-link:hover:not(.disabled) {
        background: var(--bg-secondary);
        color: var(--text-primary);
    }
    
    .mobile-tools-menu .tool-link.active {
        background: var(--bg-tertiary);
        color: var(--text-primary);
    }
    
    .mobile-tools-menu .tool-link.disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }
}

@media (max-width: 768px) {
    .tool-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .audio-actions {
        flex-direction: column;
    }
    
    .history-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-bottom-links {
        justify-content: center;
    }
}

/* ==========================================================================
   15. ADDITIONAL FIXES & OVERRIDES
   ========================================================================== */
a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

/* Ensure proper text selection color */
::selection {
    background-color: rgba(139, 92, 246, 0.3);
}

/* Scrollbar styling for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Focus states for accessibility */
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Text area resize */
textarea {
    resize: vertical;
    min-height: 80px;
}

/* Bootstrap overrides to ensure dark theme consistency */
.btn {
    border-radius: 0.5rem;
}

.form-control:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(139, 92, 246, 0.25) !important;
}

/* Ensure all text inputs have consistent styling */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
textarea,
select {
    background: var(--bg-tertiary) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    background: rgba(139, 92, 246, 0.05) !important;
    border-color: var(--primary-color) !important;
}
  /* ==========================================================================
   7. BANNER - ALIGNED WITH DARK THEME
   ========================================================================== */
.banner-container {
  width: 100%;
  background: #0D0C1D !important;
  position: relative;
  overflow: hidden;
  z-index: 60;
}

.banner-content {
  margin: 0 auto;
  position: relative;
  z-index: 10;
}

.banner-link {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.75rem;
  text-decoration: none;
  color: var(--text-color);
  background: var(--glass-background);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
  font-size: 0.875rem;
  transition: opacity 0.3s ease;
}

.banner-link:hover {
  opacity: 0.9;
  color: var(--text-color);
}


/* Add to soundlabs.css */

/* Tags styling */
.tags-container {
    margin-top: 0.5rem;
}

.selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
    min-height: 40px;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
}

.selected-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.remove-tag {
    margin-left: 0.5rem;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
}

.popular-tags {
    margin-top: 0.5rem;
}

.tag-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.tag-btn {
    padding: 0.25rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.875rem;
}

.tag-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.explore-tags-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.explore-tags-link:hover {
    text-decoration: underline;
}

/* BPM Control */
.bpm-control {
    display: flex;
    gap: 0.5rem;
}

.bpm-control .form-select {
    flex: 1;
}

.bpm-control .form-control {
    flex: 0 0 100px;
}

/* Lyrics helper */
.lyrics-helper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.btn-small {
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all var(--transition);
}

.btn-small:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
}

/* Song lyrics display */
.song-lyrics {
    margin-top: 0.5rem;
}

.song-lyrics pre {
    background: var(--bg-tertiary);
    padding: 0.75rem;
    border-radius: 0.25rem;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: inherit;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
}

/* Required field indicator */
.required {
    color: var(--error-color);
}

/* Tool container */
.tool-container {
    width: 100%;
}

/* Songs container for multiple results */
.songs-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* History tags */
.history-tags {
    display: block;
    color: var(--text-muted);
    font-size: 0.7rem;
    margin-top: 0.25rem;
}

/* === SoundLabs: tool visibility controller (append) === */
.tool-container[aria-hidden="true"],
.tool-container[hidden] {
  display: none !important;
}

/* Base: hide by default, show when active */
.tool-container { 
  display: none; 
}
.tool-container.active {
  display: block !important;
}

/* Also respect the body/html data attribute your JS sets */
[data-current-tool="backing-tracks"] #backing-tracks-tool,
[data-current-tool="song-generator"] #song-generator-tool {
  display: block !important;
}
/* Overlay stays inert unless active */
.mobile-tools-menu {
    /* keep your layout */
    position: fixed;
    bottom: 90px;
    right: 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    z-index: 99;
    min-width: 250px;
    max-height: 70vh;
    overflow-y: auto;

    /* visibility control */
    display: block;            /* allow transitions */
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity .2s ease, transform .2s ease;
}

.mobile-tools-menu.active {
    opacity: 1;
    pointer-events: auto;
    transform: none;
}

/* Makes it harder for any other stacking context to visually "hide" the tool area */
.soundlabs-main { position: relative; }


/* ====== SoundLabs: nuclear visibility override ====== */
/* Make ALL tool containers inert by default */
.tool-container {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

/* The active tool must be visible above any overlays */
.tool-container.active {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  position: relative !important;
  z-index: 1 !important;
}

/* If you ever rely on data-current-tool, support that too */
[data-current-tool="backing-tracks"] #backing-tracks-tool,
[data-current-tool="song-generator"] #song-generator-tool {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  position: relative !important;
  z-index: 1 !important;
}

/* Mobile tools menu must NEVER cover content unless active */
#mobileToolsMenu {
  display: block;               /* allow transitions without reflow */
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
  z-index: 99;
}
#mobileToolsMenu.active {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}


/* Lyrics Generator Modal Styles */
.lyrics-generator-form {
    padding: 1rem 0;
}

.lyrics-generator-form .control-group {
    margin-bottom: 1.5rem;
}

.lyrics-generator-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.lyrics-generator-form .required {
    color: var(--accent-color);
}

.lyrics-generator-form .button-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.lyrics-generator-form .button-group .button {
    flex: 1;
}

#lyricsGeneratorLoading .loading {
    border-color: var(--accent-color);
    border-top-color: transparent;
}

/* Validation Messages */
.validation-error {
    background-color: #fee;
    color: #c33;
    border: 1px solid #fcc;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

.validation-warning {
    background-color: #fff8dc;
    color: #856404;
    border: 1px solid #ffeeba;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

.info-box {
    background: #f0f4ff;
    border-left: 3px solid #4A90E2;
    border-radius: 4px;
    padding: 0.75rem;
    margin: 1rem 0;
}

.info-box ul {
    margin: 0.5rem 0 0 1.5rem;
    font-size: 0.875rem;
    line-height: 1.6;
}

.info-box li {
    margin: 0.25rem 0;
}
/* Usage counter enhancements */
.usage-counter {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.usage-counter span {
    font-weight: 600;
}

.usage-period {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Low usage warning colors */
.usage-counter span[style*="color: #ff6b6b"] {
    background: rgba(255, 107, 107, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 107, 107, 0.3);
}
/* Voice Generator Specific Styles */
.speaker-config {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.speaker-config label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.remove-speaker {
    padding: 0.5rem 0.75rem !important;
    background: rgba(255, 107, 107, 0.1) !important;
    border: 1px solid rgba(255, 107, 107, 0.3) !important;
    color: #ff6b6b !important;
}

.remove-speaker:hover {
    background: rgba(255, 107, 107, 0.2) !important;
}

#speakersList {
    margin-bottom: 1rem;
}

/* Ensure text-to-voice tool visibility works */
[data-current-tool="text-to-voice"] #text-to-voice-tool {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: relative !important;
    z-index: 1 !important;
}