/* ============================================
   Wavefront Artist Dashboard - App Stylesheet
   ============================================ */

/* --- Design Tokens --- */
:root {
    --black: #0a0a0a;
    --white: #f5f5f0;
    --accent: #ff6b35;
    --accent-hover: #e55a28;
    --accent-glow: rgba(255, 107, 53, 0.15);
    --muted: #8a8a7a;
    --card-bg: rgba(255, 255, 255, 0.03);
    --border: rgba(255, 255, 255, 0.06);
    --danger: #e53e3e;
    --danger-hover: #c53030;
    --success: #38a169;
    --blue: #4299e1;
    --sidebar-width: 240px;
    --radius: 16px;
    --radius-sm: 8px;
    --transition: 0.2s ease;
}

/* --- Reset --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--black);
    color: var(--white);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Noise overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    line-height: 1.2;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity var(--transition);
}

a:hover {
    opacity: 0.85;
}

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* --- Layout --- */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 40px;
    max-width: 1200px;
    width: 100%;
}

/* --- Sidebar --- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: rgba(10, 10, 10, 0.95);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-logo {
    padding: 28px 24px;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo a {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.5px;
}

.sidebar-logo .accent {
    color: var(--accent);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all var(--transition);
}

.sidebar-nav a:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.04);
    opacity: 1;
}

.sidebar-nav a.active {
    color: var(--accent);
    background: var(--accent-glow);
}

.sidebar-nav a .nav-icon {
    font-size: 1.15rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.sidebar-footer .user-email {
    font-size: 0.8rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 8px;
}

.sidebar-footer .logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 0;
    font-family: inherit;
    transition: color var(--transition);
}

.sidebar-footer .logout-btn:hover {
    color: var(--danger);
}

/* Mobile hamburger */
.hamburger {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
    background: rgba(10, 10, 10, 0.9);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    color: var(--white);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 90;
}

/* --- Page Header --- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header h1 {
    font-size: 1.75rem;
    letter-spacing: -0.5px;
}

.page-header h2 {
    font-size: 1.35rem;
    letter-spacing: -0.3px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    white-space: nowrap;
    line-height: 1.2;
}

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

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    box-shadow: 0 0 24px var(--accent-glow);
}

.btn-secondary {
    background: transparent;
    color: var(--white);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover:not(:disabled) {
    background: var(--danger-hover);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
    padding: 8px 12px;
}

.btn-ghost:hover {
    color: var(--white);
}

.btn .btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* --- Cards --- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
    border-color: rgba(255, 107, 53, 0.2);
}

.card-clickable {
    cursor: pointer;
}

.card-clickable:hover {
    border-color: var(--accent);
    box-shadow: 0 0 32px rgba(255, 107, 53, 0.06);
}

/* --- Stats Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
}

.stat-card .stat-number {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1;
    margin-bottom: 6px;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Forms --- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--white);
    margin-bottom: 8px;
}

.form-group label .required {
    color: var(--accent);
    margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--white);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--muted);
    opacity: 0.6;
}

.form-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238a8a7a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}

.form-select option {
    background: #1a1a1a;
    color: var(--white);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Date input styling */
input[type="date"].form-input {
    color-scheme: dark;
}

input[type="date"].form-input::-webkit-calendar-picker-indicator {
    filter: invert(0.6);
    cursor: pointer;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
}

.form-error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 6px;
}

/* --- Release List --- */
.release-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.release-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    gap: 16px;
}

.release-item:hover {
    border-color: var(--accent);
    box-shadow: 0 0 32px rgba(255, 107, 53, 0.06);
}

.release-item-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.release-item-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.release-item-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.release-item-date {
    font-size: 0.85rem;
    color: var(--muted);
}

.release-item-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* --- Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* Status badges */
.badge-upcoming {
    background: rgba(66, 153, 225, 0.15);
    color: var(--blue);
}

.badge-released {
    background: rgba(56, 161, 105, 0.15);
    color: var(--success);
}

.badge-promoting {
    background: var(--accent-glow);
    color: var(--accent);
}

.badge-pending {
    background: rgba(138, 138, 122, 0.15);
    color: var(--muted);
}

/* Release type badges */
.badge-single {
    background: rgba(159, 122, 234, 0.15);
    color: #b794f6;
}

.badge-ep {
    background: rgba(66, 153, 225, 0.15);
    color: #63b3ed;
}

.badge-album {
    background: rgba(237, 137, 54, 0.15);
    color: #ed8936;
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    padding: 20px;
    opacity: 0;
    animation: fadeIn 0.2s ease forwards;
}

.modal-content {
    background: #141414;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 500px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideUp 0.25s ease forwards;
}

.modal-content h2 {
    margin-bottom: 8px;
}

.modal-content p {
    color: var(--muted);
    margin-bottom: 24px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* --- Toast Notifications --- */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: toastIn 0.3s ease forwards;
    max-width: 380px;
}

.toast-success {
    background: var(--success);
}

.toast-error {
    background: var(--danger);
}

.toast-exit {
    animation: toastOut 0.25s ease forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(40px); }
}

/* --- Promo Cards --- */
.promo-section {
    margin-top: 32px;
}

.promo-section h3 {
    font-size: 1.15rem;
    margin-bottom: 16px;
}

.promo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.promo-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: border-color var(--transition);
}

.promo-card:hover {
    border-color: rgba(255, 107, 53, 0.25);
}

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

.promo-card-platform {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 1rem;
}

.promo-card-platform .platform-icon {
    font-size: 1.2rem;
}

.promo-card-body {
    font-size: 0.9rem;
    line-height: 1.7;
    color: rgba(245, 245, 240, 0.85);
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 16px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.promo-card-hashtags {
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 16px;
    word-break: break-word;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--white);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

.copy-btn.copied {
    background: rgba(56, 161, 105, 0.15);
    border-color: var(--success);
    color: var(--success);
}

/* --- Empty States --- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    text-align: center;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 0.95rem;
    color: var(--muted);
    max-width: 360px;
    margin-bottom: 24px;
}

/* --- Loading Spinner --- */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.spinner-small {
    width: 18px;
    height: 18px;
    border-width: 2px;
}

.spinner-center {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 64px;
}

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

/* --- Onboarding --- */
.onboarding-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
}

.onboarding-container {
    max-width: 560px;
    width: 100%;
}

.onboarding-header {
    text-align: center;
    margin-bottom: 40px;
}

.onboarding-header .logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.onboarding-header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.onboarding-header p {
    color: var(--muted);
    font-size: 1rem;
}

.onboarding-form {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
}

.onboarding-section {
    margin-bottom: 28px;
}

.onboarding-section h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

/* --- Auth Pages --- */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
}

.auth-container {
    max-width: 400px;
    width: 100%;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header .logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
}

.auth-header h1 {
    font-size: 1.75rem;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--muted);
}

.auth-form {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--muted);
}

.auth-footer a {
    font-weight: 600;
}

/* --- Release Detail --- */
.release-detail-header {
    margin-bottom: 32px;
}

.release-detail-header h1 {
    font-size: 2rem;
    margin-bottom: 12px;
}

.release-detail-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.release-detail-description {
    color: rgba(245, 245, 240, 0.8);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 24px;
}

.release-detail-streaming {
    margin-bottom: 24px;
}

.release-detail-streaming a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.release-detail-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
    transition: color var(--transition);
}

.back-link:hover {
    color: var(--white);
    opacity: 1;
}

/* --- Section Divider --- */
.section {
    margin-bottom: 40px;
}

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

.section-header h2 {
    font-size: 1.25rem;
}

/* --- Upcoming Releases Section on Dashboard --- */
.upcoming-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.upcoming-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}

.upcoming-item:hover {
    border-color: var(--accent);
}

.upcoming-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.upcoming-item-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.upcoming-item-date {
    font-size: 0.85rem;
    color: var(--muted);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .main-content {
        margin-left: 0;
        padding: 24px 16px;
        padding-top: 64px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .release-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .release-item-badges {
        margin-top: 8px;
    }

    .promo-grid {
        grid-template-columns: 1fr;
    }

    .release-detail-actions {
        flex-direction: column;
    }

    .release-detail-actions .btn {
        width: 100%;
    }

    .modal-content {
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .onboarding-form,
    .auth-form {
        padding: 24px 20px;
    }

    .onboarding-header h1 {
        font-size: 1.5rem;
    }

    .stat-card .stat-number {
        font-size: 2rem;
    }
}

/* --- Utility Classes --- */
.text-muted {
    color: var(--muted);
}

.text-accent {
    color: var(--accent);
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 16px;
}

.mb-4 {
    margin-bottom: 16px;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}
