/* ═══════════════════════════════════════════════════════════════
   AI Lyrics Generator – ailyrics.yeb.to
   ═══════════════════════════════════════════════════════════════ */

:root {
    --al-primary: #667eea;
    --al-primary-dark: #564ecc;
    --al-secondary: #764ba2;
    --al-danger: #dc3545;
    --al-success: #28a745;
    --al-warning: #ffc107;
    --al-surface: rgba(255,255,255,.98);
    --al-surface-alt: rgba(248,249,250,.8);
    --al-radius: 20px;
    --al-shadow: 0 20px 60px rgba(0,0,0,.12);
    --al-sidebar-w: 320px;
} 
 
/* ── Layout ───────────────────────────────────────────────────── */

.al-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 1rem;
}

.al-hero {
    text-align: center;
    color: #fff;
    margin-bottom: 2rem;
}
.al-hero h1 {
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    font-weight: 700;
    margin-bottom: .5rem;
    text-shadow: 0 2px 20px rgba(0,0,0,.2);
}
.al-hero p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    opacity: .9;
}

.al-workspace {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

/* ── Sidebar ──────────────────────────────────────────────────── */

.al-sidebar {
    width: var(--al-sidebar-w);
    flex-shrink: 0;
    background: var(--al-surface);
    border-radius: var(--al-radius);
    box-shadow: var(--al-shadow);
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    overflow-x: hidden;
}

.al-sidebar-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: var(--al-surface);
    z-index: 2;
    border-radius: var(--al-radius) var(--al-radius) 0 0;
}
.al-sidebar-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--al-primary), var(--al-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.al-sidebar-body {
    padding: .5rem 0;
}

/* Accordion sections */
.al-section {
    border-bottom: 1px solid #f0f0f0;
}
.al-section:last-child { border-bottom: none; }

.al-section-toggle {
    width: 100%;
    background: none;
    border: none;
    padding: .75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    cursor: pointer;
    font-weight: 600;
    font-size: .9rem;
    color: #333;
    transition: background .15s;
}
.al-section-toggle:hover { background: rgba(102,126,234,.04); }
.al-section-toggle .al-chevron {
    margin-left: auto;
    transition: transform .2s;
    font-size: .7rem;
    color: #aaa;
}
.al-section-toggle.open .al-chevron { transform: rotate(180deg); }
.al-section-toggle .al-section-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--al-primary), var(--al-secondary));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    flex-shrink: 0;
}

.al-section-content {
    padding: 0 1.25rem 1rem;
    display: none;
}
.al-section-content.open { display: block; }

/* Sidebar tag badges */
.al-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: .25rem .6rem;
    border-radius: 20px;
    font-size: .8rem;
    font-weight: 500;
    background: linear-gradient(135deg, rgba(102,126,234,.12), rgba(118,75,162,.12));
    color: var(--al-primary-dark);
}
.al-tag button {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    opacity: .6;
}
.al-tag button:hover { opacity: 1; }

.al-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

/* Sidebar inputs */
.al-sidebar .form-control,
.al-sidebar .form-select {
    font-size: .85rem;
    border-radius: 10px;
}

.al-sidebar .form-label {
    font-size: .8rem;
    font-weight: 600;
    color: #555;
    margin-bottom: .25rem;
}

/* Autocomplete dropdown */
.al-autocomplete {
    position: relative;
}
.al-autocomplete .list-group {
    position: absolute;
    z-index: 1000;
    max-height: 160px;
    overflow-y: auto;
    width: 100%;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    border-radius: 10px;
}

/* Save preset preview */
.al-save-preview {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: .8rem;
    margin-top: .5rem;
}
.al-save-preview h6 {
    font-size: .82rem;
    font-weight: 600;
    color: #555;
    margin-bottom: .5rem;
}
.al-preview-list {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    margin-bottom: .6rem;
    max-height: 180px;
    overflow-y: auto;
}
.al-preview-row {
    display: flex;
    gap: .4rem;
    font-size: .78rem;
    line-height: 1.3;
}
.al-preview-label {
    font-weight: 600;
    color: #888;
    white-space: nowrap;
    min-width: 70px;
}
.al-preview-value {
    color: #333;
    word-break: break-word;
}
.al-save-preview input {
    width: 100%;
    font-size: .82rem;
    padding: .35rem .6rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    margin-bottom: .5rem;
}
.al-save-preview .al-preview-actions {
    display: flex;
    gap: .4rem;
}
.al-save-preview .al-preview-actions button {
    flex: 1;
    font-size: .8rem;
    padding: .35rem .6rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 500;
}
.al-save-preview .al-preview-actions button:first-child {
    background: var(--al-primary);
    color: #fff;
}
.al-save-preview .al-preview-actions button:last-child {
    background: #e9ecef;
    color: #666;
}

/* Structure list in sidebar */
.al-struct-row {
    display: grid;
    grid-template-columns: 1fr 50px 36px;
    gap: .4rem;
    align-items: center;
    padding: .25rem 0;
}
.al-struct-row select,
.al-struct-row input {
    font-size: .82rem;
    padding: .3rem .5rem;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}
.al-struct-remove {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: #fee;
    color: var(--al-danger);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .15s;
}
.al-struct-remove:hover { background: var(--al-danger); color: #fff; }

.al-add-section {
    margin-top: .5rem;
    background: none;
    border: 1px dashed #ccc;
    border-radius: 8px;
    padding: .4rem .8rem;
    font-size: .82rem;
    color: #666;
    cursor: pointer;
    width: 100%;
    transition: .15s;
}
.al-add-section:hover { border-color: var(--al-primary); color: var(--al-primary); }

/* Presets in sidebar */
.al-preset-item {
    padding: .5rem .75rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: .4rem;
    cursor: pointer;
    font-size: .85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: .15s;
}
.al-preset-item:hover { border-color: var(--al-primary); background: rgba(102,126,234,.03); }
.al-preset-delete {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 1rem;
}
.al-preset-delete:hover { color: var(--al-danger); }

/* ── Generate Button ──────────────────────────────────────────── */

.al-generate-btn {
    width: 100%;
    padding: .85rem 1.5rem;
    border: none;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #ff6b35, #f7931e, #ff6b35);
    background-size: 200% 200%;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(255,107,53,.35);
    transition: transform .15s, box-shadow .15s;
    animation: al-pulse-glow 3s ease-in-out infinite;
    margin: .75rem 1.25rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
}
.al-generate-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 10px 32px rgba(255,107,53,.45);
}
.al-generate-btn:disabled {
    background: linear-gradient(135deg, #9e9e9e, #757575);
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    animation: none;
    cursor: not-allowed;
}
.al-generate-btn .al-credits-badge {
    background: rgba(255,255,255,.25);
    padding: .15rem .5rem;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 700;
}
@keyframes al-pulse-glow {
    0%, 100% { box-shadow: 0 6px 24px rgba(255,107,53,.35); }
    50% { box-shadow: 0 10px 36px rgba(255,107,53,.55); }
}

/* ── Main Content Area ────────────────────────────────────────── */

.al-main {
    flex: 1;
    min-width: 0;
}

/* Top toolbar (minimal) */
.al-toolbar {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.al-toolbar-btn {
    padding: .5rem 1rem;
    border: 2px solid rgba(255,255,255,.3);
    border-radius: 12px;
    background: rgba(255,255,255,.15);
    color: #fff;
    font-weight: 600;
    font-size: .85rem;
    cursor: pointer;
    transition: .2s;
    display: flex;
    align-items: center;
    gap: .4rem;
    backdrop-filter: blur(10px);
}
.al-toolbar-btn:hover {
    background: rgba(255,255,255,.25);
    border-color: rgba(255,255,255,.5);
}

/* Mobile sidebar toggle */
.al-sidebar-toggle {
    display: none;
    padding: .6rem 1.2rem;
    border: 2px solid rgba(255,255,255,.3);
    border-radius: 12px;
    background: rgba(255,255,255,.15);
    color: #fff;
    font-weight: 600;
    font-size: .9rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
    align-items: center;
    gap: .4rem;
}

/* Settings summary pills */
.al-summary {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: 1rem;
}
.al-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: .3rem .7rem;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    transition: .15s;
    border: none;
}
.al-pill:hover { filter: brightness(1.1); transform: translateY(-1px); }
.al-pill--lang     { background: #e0e7ff; color: #3730a3; }
.al-pill--topic    { background: #fef3c7; color: #92400e; }
.al-pill--genre    { background: #ede9fe; color: #5b21b6; }
.al-pill--mood     { background: #fce7f3; color: #9d174d; }
.al-pill--tone     { background: #d1fae5; color: #065f46; }
.al-pill--orig     { background: #e0f2fe; color: #0c4a6e; }
.al-pill--forbid   { background: #fee2e2; color: #991b1b; }
.al-pill--rhyme    { background: #fef9c3; color: #713f12; }
.al-pill--ref      { background: #f3e8ff; color: #6b21a8; }

/* ── Lyrics Blocks ────────────────────────────────────────────── */

.al-blocks {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.al-block {
    background: var(--al-surface);
    border: 2px solid #e9ecef;
    border-radius: 16px;
    overflow: hidden;
    transition: .2s;
}
.al-block.dragging {
    opacity: .6;
    transform: rotate(1.5deg);
    box-shadow: 0 10px 30px rgba(0,0,0,.15);
}
.al-block:hover { border-color: var(--al-primary); }

.al-block-header {
    background: var(--al-surface-alt);
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}

.al-drag-handle {
    color: #ccc;
    cursor: grab;
    font-size: 1.1rem;
    user-select: none;
}
.al-drag-handle:active { cursor: grabbing; }

.al-title-input {
    flex: 1;
    padding: .6rem .9rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: .95rem;
    font-weight: 600;
    min-width: 180px;
    transition: .2s;
}
.al-title-input:focus {
    outline: none;
    border-color: var(--al-primary);
    box-shadow: 0 0 0 3px rgba(102,126,234,.1);
}

.al-block-actions {
    display: flex;
    align-items: center;
    gap: .3rem;
}

.al-icon-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    transition: .15s;
}
.al-icon-btn:hover { background: rgba(102,126,234,.08); color: var(--al-primary); }
.al-icon-btn--danger:hover { background: rgba(220,53,69,.08); color: var(--al-danger); }

/* Structure indicator */
.al-struct-indicator {
    width: 100%;
    padding: 0 1.25rem .4rem;
    font-size: .72rem;
    color: #999;
    display: flex;
    align-items: center;
    gap: .3rem;
    flex-wrap: wrap;
}
.al-struct-indicator span {
    background: #f1f5f9;
    padding: .1rem .4rem;
    border-radius: 4px;
}

/* Block content */
.al-block-body {
    padding: 1.25rem;
    display: none;
}
.al-block-body.open { display: block; }

.al-lyrics-area { position: relative; }

.al-textarea {
    width: 100%;
    min-height: 180px;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-family: 'Georgia', serif;
    font-size: .95rem;
    line-height: 1.7;
    resize: vertical;
    transition: .2s;
}
.al-textarea:focus {
    outline: none;
    border-color: var(--al-primary);
    box-shadow: 0 0 0 3px rgba(102,126,234,.08);
}

.al-floating-menu {
    position: absolute;
    right: .75rem;
    top: .75rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    opacity: 0;
    transition: .2s;
}
.al-lyrics-area:hover .al-floating-menu { opacity: 1; }

.al-float-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 10px;
    background: rgba(255,255,255,.95);
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    color: var(--al-primary);
    transition: .15s;
}
.al-float-btn:hover {
    transform: scale(1.08);
    background: var(--al-primary);
    color: #fff;
}

/* Word/line count */
.al-word-count {
    display: flex;
    gap: 1rem;
    padding: .5rem 0 0;
    font-size: .75rem;
    color: #aaa;
}

/* Empty state */
.al-empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #999;
}
.al-empty-state .al-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: .5;
}
.al-empty-state h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #666;
    margin-bottom: .5rem;
}
.al-empty-state p {
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ── Loading Overlay ──────────────────────────────────────────── */

.al-loading {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,.8);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 4000;
}
.al-loading .spinner-border {
    width: 3.5rem;
    height: 3.5rem;
}
.al-loading-text {
    margin-top: 1rem;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--al-primary-dark);
}

/* ── Landing Section ──────────────────────────────────────────── */

.al-landing {
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 4rem 0;
    margin-top: 3rem;
}
.al-landing .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}
.al-landing .section-header {
    text-align: center;
    margin-bottom: 4rem;
}
.al-landing .section-title {
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1rem;
    text-shadow: 0 2px 20px rgba(0,0,0,.2);
}

.al-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 5rem;
}
.al-feature-card {
    background: rgba(255,255,255,.95);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 20px 60px rgba(0,0,0,.1);
    transition: transform .3s, box-shadow .3s;
    border: 1px solid rgba(255,255,255,.2);
}
.al-feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 80px rgba(0,0,0,.15);
}
.al-feature-card .feature-icon { font-size: 3rem; margin-bottom: 1.5rem; display: block; }
.al-feature-card h3 { font-size: 1.5rem; font-weight: 700; margin-bottom: 1rem; color: #2d3748; }
.al-feature-card p { color: #4a5568; line-height: 1.7; }

.al-how-it-works {
    background: rgba(255,255,255,.95);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0,0,0,.1);
}
.al-how-it-works h2 {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.al-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}
.al-step { text-align: center; }
.al-step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1.5rem;
    box-shadow: 0 10px 30px rgba(102,126,234,.3);
}
.al-step h3 { font-size: 1.3rem; font-weight: 600; margin-bottom: 1rem; color: #2d3748; }
.al-step p { color: #4a5568; line-height: 1.6; }

.al-pricing {
    background: linear-gradient(135deg, #ffd700, #ffb300, #ff8f00);
    color: #1a1a1a;
    padding: 1.5rem 2rem;
    border-radius: 16px;
    text-align: center;
    margin-top: 3rem;
    box-shadow: 0 10px 40px rgba(255,215,0,.3);
}
.al-pricing h3 { font-size: 1.5rem; font-weight: 700; margin-bottom: .5rem; }
.al-pricing p { font-size: 1.1rem; opacity: .9; }

/* ── History panel ────────────────────────────────────────────── */

.al-history-panel {
    background: var(--al-surface);
    border-radius: var(--al-radius);
    box-shadow: var(--al-shadow);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}
.al-history-item {
    padding: .6rem .75rem;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    margin-bottom: .4rem;
    cursor: pointer;
    transition: .15s;
    font-size: .82rem;
}
.al-history-item:hover { border-color: var(--al-primary); background: rgba(102,126,234,.03); }
.al-history-item .al-history-time { font-size: .72rem; color: #999; }
.al-history-item .al-history-title { font-weight: 600; color: #333; }

/* ── Responsive ───────────────────────────────────────────────── */

@media (max-width: 900px) {
    .al-workspace { flex-direction: column; }

    .al-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 360px;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0 var(--al-radius) var(--al-radius) 0;
        z-index: 3000;
        transition: left .3s ease;
    }
    .al-sidebar.open { left: 0; }

    .al-sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.4);
        z-index: 2999;
    }
    .al-sidebar-overlay.open { display: block; }

    .al-sidebar-toggle { display: flex; }

    .al-main { width: 100%; }

    .al-floating-menu {
        position: static;
        flex-direction: row;
        opacity: 1;
        margin-top: .75rem;
        justify-content: center;
    }

    .al-drag-handle { display: none; }

    .al-landing .section-title { font-size: 2rem; }
    .al-features-grid { grid-template-columns: 1fr; }
    .al-how-it-works { padding: 2rem; }
}

@media (min-width: 901px) {
    .al-sidebar-overlay { display: none !important; }
}
