/* ============================================
   VALTYK CONTENT ENGINE — Design System
   Premium Dark Theme with Gradient Accents
   ============================================ */

/* === CSS Variables === */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #16161f;
    --bg-card-hover: #1a1a25;
    --bg-input: #1e1e2a;
    --border: #2a2a3a;
    --border-focus: #667eea;
    --text-primary: #f0f0f5;
    --text-secondary: #8888a0;
    --text-muted: #55556a;
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --accent-1: #667eea;
    --accent-2: #764ba2;
    --linkedin: #0077b5;
    --facebook: #1877f2;
    --twitter: #1da1f2;
    --instagram: #e4405f;
    --success: #2ecc71;
    --warning: #f39c12;
    --danger: #e74c3c;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 30px rgba(102, 126, 234, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* === Animated Background === */
.bg-grid {
    position: fixed;
    inset: 0;
    background-image: 
        linear-gradient(rgba(102, 126, 234, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(102, 126, 234, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: 0;
    pointer-events: none;
}

.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.4;
    z-index: 0;
    pointer-events: none;
    animation: float 20s ease-in-out infinite;
}

.bg-glow-1 {
    width: 500px;
    height: 500px;
    background: var(--accent-1);
    top: -200px;
    right: -100px;
    opacity: 0.08;
}

.bg-glow-2 {
    width: 400px;
    height: 400px;
    background: var(--accent-2);
    bottom: -150px;
    left: -100px;
    opacity: 0.06;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(30px, -20px); }
    66% { transform: translate(-20px, 30px); }
}

/* === Header === */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

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

.logo-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    font-size: 22px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.brand-name {
    font-size: 1.2rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-tagline {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* === Main Layout === */
.main-container {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 0;
    min-height: calc(100vh - 77px - 50px);
}

/* === Panels === */
.panel {
    padding: 32px;
}

.panel-form {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    max-height: calc(100vh - 77px - 50px);
}

.panel-results {
    overflow-y: auto;
    max-height: calc(100vh - 77px - 50px);
    display: flex;
    flex-direction: column;
}

.panel-header {
    margin-bottom: 28px;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.panel-icon {
    font-size: 1.2rem;
}

.panel-subtitle {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* === Form Styles === */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.required {
    color: var(--accent-1);
}

.optional {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.75rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.9rem;
    transition: var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

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

/* === Platform Selector === */
.platform-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.platform-chip {
    cursor: pointer;
}

.platform-chip input {
    display: none;
}

.chip-content {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: var(--transition);
    user-select: none;
}

.platform-chip input:checked + .chip-content {
    background: rgba(102, 126, 234, 0.15);
    border-color: var(--accent-1);
    color: var(--accent-1);
}

.platform-chip:hover .chip-content {
    border-color: var(--accent-1);
}

[data-platform="linkedin"] input:checked + .chip-content {
    background: rgba(0, 119, 181, 0.15);
    border-color: var(--linkedin);
    color: var(--linkedin);
}

[data-platform="facebook"] input:checked + .chip-content {
    background: rgba(24, 119, 242, 0.15);
    border-color: var(--facebook);
    color: var(--facebook);
}

[data-platform="twitter"] input:checked + .chip-content {
    background: rgba(29, 161, 242, 0.15);
    border-color: var(--twitter);
    color: var(--twitter);
}

[data-platform="instagram"] input:checked + .chip-content {
    background: rgba(228, 64, 95, 0.15);
    border-color: var(--instagram);
    color: var(--instagram);
}

/* === Generate Button === */
.btn-generate {
    width: 100%;
    padding: 16px 24px;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    margin-top: 8px;
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.35);
}

.btn-generate:active {
    transform: translateY(0);
}

.btn-generate:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

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

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

/* === AI Idea Generator === */
.idea-generator-section {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.08));
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 8px;
}

.idea-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.idea-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-ideas {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #f39c12, #e74c3c);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: var(--font);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-ideas:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(243, 156, 18, 0.35);
}

.btn-ideas:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-ideas-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

.ideas-container {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.idea-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    cursor: pointer;
    transition: var(--transition);
    animation: slideUp 0.4s ease forwards;
    opacity: 0;
}

.idea-card:hover {
    border-color: var(--accent-1);
    background: var(--bg-card-hover);
    transform: translateX(4px);
    box-shadow: var(--shadow-glow);
}

.idea-card.selected {
    border-color: var(--success);
    background: rgba(46, 204, 113, 0.08);
}

.idea-card-number {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--accent-1);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.idea-card-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.4;
}

.idea-card-hook {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 8px;
    line-height: 1.4;
}

.idea-card-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.idea-tag {
    padding: 3px 8px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 100px;
    font-size: 0.65rem;
    color: var(--accent-1);
    font-weight: 500;
}

.idea-tag.viral {
    background: rgba(243, 156, 18, 0.12);
    color: var(--warning);
}

.idea-use-hint {
    font-size: 0.7rem;
    color: var(--success);
    font-weight: 600;
    margin-top: 6px;
    opacity: 0;
    transition: var(--transition);
}

.idea-card:hover .idea-use-hint {
    opacity: 1;
}

/* === Divider === */
.divider-or {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0 20px;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.divider-or::before,
.divider-or::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* === Empty State === */
.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 40px;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

.empty-state h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    max-width: 400px;
    line-height: 1.6;
}

.empty-features {
    display: flex;
    gap: 8px;
    margin-top: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.feature-tag {
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* === Loading State === */
.loading-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 40px;
}

.loader-orb {
    position: relative;
    width: 100px;
    height: 100px;
    margin-bottom: 30px;
}

.orb-ring {
    position: absolute;
    inset: 0;
    border: 3px solid transparent;
    border-top-color: var(--accent-1);
    border-right-color: var(--accent-2);
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.orb-core {
    position: absolute;
    inset: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: var(--bg-card);
    border-radius: 50%;
}

.loading-state h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loading-sub {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 24px;
}

.loading-progress {
    width: 260px;
    height: 4px;
    background: var(--bg-card);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent-gradient);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* === Results === */
.results-content {
    padding: 0;
}

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

.results-meta {
    display: flex;
    gap: 8px;
}

.meta-tag {
    padding: 4px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.results-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
}

/* === Platform Cards === */
.platform-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    animation: slideUp 0.5s ease forwards;
    opacity: 0;
}

.platform-card:hover {
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: var(--shadow-glow);
}

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

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.card-header h3 {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 600;
}

.platform-badge {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
}

.badge-linkedin { background: rgba(0, 119, 181, 0.15); }
.badge-facebook { background: rgba(24, 119, 242, 0.15); }
.badge-twitter { background: rgba(29, 161, 242, 0.15); }
.badge-instagram { background: rgba(228, 64, 95, 0.15); }
.badge-image { background: rgba(255, 215, 0, 0.15); }

.btn-copy {
    padding: 6px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-copy:hover {
    border-color: var(--accent-1);
    color: var(--accent-1);
}

.card-body {
    padding: 20px;
}

.card-body .post-content {
    font-size: 0.88rem;
    line-height: 1.7;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.card-body .hashtags {
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--accent-1);
    opacity: 0.8;
}

.thread-tweets {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tweet-item {
    padding: 14px 16px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--twitter);
    font-size: 0.85rem;
    line-height: 1.5;
}

.tweet-number {
    font-size: 0.7rem;
    color: var(--twitter);
    font-weight: 700;
    margin-bottom: 4px;
}

/* === Image Prompt Card === */
.image-prompt-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
    animation: slideUp 0.5s ease 0.4s forwards;
    opacity: 0;
}

.image-prompt-text {
    padding: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.6;
}

/* === New Content Button === */
.btn-new {
    width: 100%;
    padding: 14px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-new:hover {
    border-color: var(--accent-1);
    background: rgba(102, 126, 234, 0.1);
}

/* === Toast === */
.toast {
    position: fixed;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--bg-card);
    border: 1px solid var(--success);
    border-radius: 100px;
    font-size: 0.85rem;
    color: var(--success);
    box-shadow: var(--shadow-lg);
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.toast.show {
    bottom: 30px;
}

/* === Footer === */
.footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 16px;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.footer a {
    color: var(--accent-1);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* === Responsive === */

/* --- Tablet & Small Desktop --- */
@media (max-width: 900px) {
    .main-container {
        grid-template-columns: 1fr;
    }
    
    .panel-form {
        border-right: none;
        border-bottom: 1px solid var(--border);
        max-height: none;
    }
    
    .panel-results {
        max-height: none;
        min-height: 400px;
    }
    
    .header {
        padding: 12px 16px;
    }
    
    .panel {
        padding: 20px 16px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* --- Mobile --- */
@media (max-width: 768px) {
    /* Header */
    .header {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px 14px;
    }

    .header-brand {
        gap: 10px;
    }

    .logo-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .brand-name {
        font-size: 1rem;
    }

    .brand-tagline {
        font-size: 0.65rem;
    }

    .header-stats {
        flex-wrap: wrap;
        gap: 8px;
    }

    .stat-pill {
        padding: 5px 10px;
        font-size: 0.72rem;
    }

    /* Auth bar */
    .auth-bar {
        flex-wrap: wrap;
        gap: 4px;
    }

    .btn-auth {
        padding: 5px 10px;
        font-size: 0.7rem;
    }

    .btn-auth-sm {
        padding: 4px 8px;
        font-size: 0.65rem;
    }

    .auth-user {
        font-size: 0.7rem;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Panel */
    .panel {
        padding: 16px 12px;
    }

    .panel-title {
        font-size: 1rem;
    }

    .panel-subtitle {
        font-size: 0.78rem;
    }

    /* Form */
    .form-group input,
    .form-group select {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    /* Ideas */
    .idea-generator-section {
        padding: 14px;
    }

    .idea-title {
        font-size: 0.82rem;
    }

    .btn-ideas {
        padding: 10px 16px;
        font-size: 0.82rem;
    }

    .idea-card-title {
        font-size: 0.82rem;
    }

    .idea-card-hook {
        font-size: 0.72rem;
    }

    /* Empty state */
    .empty-state {
        padding: 40px 20px;
    }

    .empty-icon {
        font-size: 3rem;
    }

    .empty-state h3 {
        font-size: 1.1rem;
    }

    .empty-state p {
        font-size: 0.82rem;
    }

    /* Loading */
    .loading-state {
        padding: 40px 20px;
    }

    .loader-orb {
        width: 80px;
        height: 80px;
    }

    /* Results */
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .card-header {
        padding: 12px 14px;
    }

    .card-header h3 {
        font-size: 0.85rem;
    }

    .card-body {
        padding: 14px;
    }

    .card-body .post-content {
        font-size: 0.82rem;
    }

    /* Generate button */
    .btn-generate {
        padding: 14px 20px;
        font-size: 0.92rem;
    }

    /* All Modals */
    .auth-modal-card {
        max-width: 95vw !important;
        width: 95% !important;
        padding: 24px 18px;
        max-height: 90vh;
        overflow-y: auto;
    }

    .auth-modal-card h2 {
        font-size: 1.15rem;
    }

    .auth-close {
        top: 10px;
        right: 14px;
    }

    .auth-input {
        padding: 10px 12px;
        font-size: 0.82rem;
    }

    .btn-auth-submit {
        padding: 11px;
        font-size: 0.82rem;
    }

    .btn-auth-google {
        padding: 10px;
        font-size: 0.82rem;
    }

    /* Upgrade Modal benefits */
    .auth-benefit {
        padding: 7px 12px;
        font-size: 0.78rem;
    }

    /* Industry grid */
    .industry-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .industry-chip {
        padding: 8px 6px;
        font-size: 0.72rem;
    }

    /* Business Modal - stack grids */
    #businessModal .auth-modal-card div[style*="grid-template-columns: 1fr 1fr"],
    #businessModal .auth-modal-card div[style*="grid-template-columns:1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Footer */
    .footer {
        font-size: 0.68rem;
        padding: 12px;
    }
}

/* --- Small Mobile --- */
@media (max-width: 480px) {
    /* Header compact */
    .header {
        padding: 8px 10px;
    }

    .header-brand {
        gap: 8px;
    }

    .logo-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
        border-radius: 8px;
    }

    .brand-name {
        font-size: 0.88rem;
    }

    .brand-tagline {
        display: none;
    }

    .stat-pill {
        display: none;
    }

    .auth-user {
        max-width: 80px;
    }

    #bizProfileBtn {
        font-size: 0.62rem !important;
        padding: 3px 6px !important;
    }

    /* Panel */
    .panel {
        padding: 14px 10px;
    }

    .panel-header {
        margin-bottom: 18px;
    }

    .panel-title {
        font-size: 0.92rem;
        gap: 8px;
    }

    .panel-subtitle {
        font-size: 0.72rem;
    }

    /* Form */
    .form-group {
        margin-bottom: 14px;
    }

    .form-group label {
        font-size: 0.75rem;
        margin-bottom: 5px;
    }

    .form-group input,
    .form-group select {
        padding: 9px 10px;
        font-size: 0.82rem;
        border-radius: 8px;
    }

    /* Ideas */
    .idea-generator-section {
        padding: 12px;
        border-radius: 12px;
    }

    .idea-title {
        font-size: 0.78rem;
    }

    .btn-ideas {
        padding: 9px 14px;
        font-size: 0.78rem;
    }

    .idea-card {
        padding: 10px 12px;
    }

    .idea-card-title {
        font-size: 0.78rem;
    }

    .idea-card-meta {
        gap: 4px;
    }

    .idea-tag {
        font-size: 0.6rem;
        padding: 2px 6px;
    }

    .divider-or {
        font-size: 0.68rem;
        margin: 6px 0 14px;
    }

    /* Generate button */
    .btn-generate {
        padding: 12px 16px;
        font-size: 0.85rem;
        border-radius: 10px;
    }

    /* Empty state */
    .empty-state {
        padding: 30px 14px;
    }

    .empty-icon {
        font-size: 2.5rem;
        margin-bottom: 14px;
    }

    .empty-state h3 {
        font-size: 1rem;
    }

    .empty-state p {
        font-size: 0.78rem;
    }

    .feature-tag {
        font-size: 0.68rem;
        padding: 4px 10px;
    }

    /* Results */
    .results-header h2 {
        font-size: 1rem;
    }

    .meta-tag {
        font-size: 0.65rem;
        padding: 3px 8px;
    }

    .platform-badge {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }

    .btn-copy {
        padding: 4px 10px;
        font-size: 0.68rem;
    }

    .card-body {
        padding: 12px;
    }

    .card-body .post-content {
        font-size: 0.78rem;
        line-height: 1.6;
    }

    .card-body .hashtags {
        font-size: 0.72rem;
    }

    .tweet-item {
        padding: 10px 12px;
        font-size: 0.78rem;
    }

    /* Modals full-screen on small devices */
    .auth-modal-card {
        max-width: 100vw !important;
        width: 100% !important;
        padding: 20px 14px;
        border-radius: 16px 16px 0 0;
        max-height: 92vh;
        position: fixed;
        bottom: 0;
        margin: 0;
    }

    .auth-modal {
        align-items: flex-end;
    }

    .auth-modal-card h2 {
        font-size: 1.05rem;
    }

    .auth-input {
        padding: 9px 10px;
        font-size: 0.8rem;
        margin-bottom: 8px;
    }

    .auth-benefit {
        padding: 6px 10px;
        font-size: 0.72rem;
    }

    /* Industry grid 2 cols on small */
    .industry-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
    }

    .industry-chip {
        padding: 7px 4px;
        font-size: 0.68rem;
    }

    /* Image gen */
    .btn-generate-image {
        padding: 12px 16px;
        font-size: 0.85rem;
    }

    /* Toast */
    .toast {
        font-size: 0.78rem;
        padding: 10px 18px;
        max-width: 90vw;
    }

    .toast.show {
        bottom: 20px;
    }

    /* Loading */
    .loading-state {
        padding: 30px 14px;
    }

    .loader-orb {
        width: 70px;
        height: 70px;
        margin-bottom: 20px;
    }

    .loading-state h3 {
        font-size: 1rem;
    }

    .loading-sub {
        font-size: 0.78rem;
    }

    .loading-progress {
        width: 200px;
    }

    /* Report section button */
    .btn-new {
        padding: 12px 16px;
        font-size: 0.82rem;
    }

    /* Footer */
    .footer {
        font-size: 0.65rem;
        padding: 10px;
    }
}

/* --- Very small (iPhone SE, etc) --- */
@media (max-width: 360px) {
    .panel {
        padding: 12px 8px;
    }

    .auth-modal-card {
        padding: 16px 10px;
    }

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

    .industry-chip {
        font-size: 0.62rem;
    }

    .header-brand {
        gap: 6px;
    }

    .brand-name {
        font-size: 0.82rem;
    }
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}


/* === DALL-E Image Generator Button === */
.btn-generate-image {
    width: 100%;
    margin-top: 16px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 50%, #ffd86f 100%);
    background-size: 200% 200%;
    border: none;
    border-radius: var(--radius-md);
    color: #fff;
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.3px;
    animation: shimmerGradient 3s ease infinite;
}

@keyframes shimmerGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.btn-generate-image:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 87, 108, 0.4);
}

.btn-generate-image:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.image-gen-card {
    border-color: rgba(245, 87, 108, 0.3) !important;
}

.image-gen-card:hover {
    border-color: rgba(245, 87, 108, 0.5) !important;
    box-shadow: 0 0 20px rgba(245, 87, 108, 0.1);
}

/* === Auth Bar & Modal === */
.header-stats { display: flex; align-items: center; gap: 12px; }
.auth-bar { display: flex; align-items: center; gap: 8px; }
.auth-user { font-size: 0.78rem; color: var(--accent-1); font-weight: 600; }
.btn-auth {
    padding: 7px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn-auth:hover { border-color: var(--accent-1); color: var(--accent-1); }
.btn-auth-sm { padding: 5px 12px; font-size: 0.7rem; }
#authLoggedIn { display: flex; align-items: center; gap: 8px; }

.auth-modal {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10,10,15,0.9);
    backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
}
.auth-modal.hidden { display: none !important; }
.auth-modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 36px;
    max-width: 380px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.auth-modal-card h2 {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 6px;
    text-align: center;
}
.auth-close {
    position: absolute; top: 14px; right: 18px;
    background: none; border: none;
    color: var(--text-muted); font-size: 1.5rem;
    cursor: pointer; transition: var(--transition);
}
.auth-close:hover { color: var(--text-primary); }
.auth-input {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.85rem;
    margin-bottom: 10px;
    outline: none;
    transition: var(--transition);
}
.auth-input:focus { border-color: var(--accent-1); }
.btn-auth-google {
    width: 100%;
    padding: 12px;
    background: #fff;
    border: none;
    border-radius: var(--radius-md);
    color: #333;
    font-family: var(--font);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    transition: var(--transition);
}
.btn-auth-google:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(255,255,255,0.15); }
.btn-auth-submit {
    width: 100%;
    padding: 12px;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-md);
    color: #fff;
    font-family: var(--font);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}
.btn-auth-submit:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(102,126,234,0.3); }



/* === Industry Picker === */
.industry-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.industry-chip {
    padding: 10px 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}
.industry-chip:hover {
    border-color: var(--accent-1);
    color: var(--accent-1);
    background: rgba(102, 126, 234, 0.08);
    transform: translateY(-1px);
}

/* === Auth Benefits === */
.auth-benefits {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}
.auth-benefit {
    padding: 8px 14px;
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.82rem;
    border-left: 3px solid var(--accent-1);
}
.btn-auth-skip {
    display: block;
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}
.btn-auth-skip:hover {
    border-color: var(--text-secondary);
    color: var(--text-secondary);
}

/* === Onboarding Tour === */
.tour-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9998;
    backdrop-filter: blur(2px);
}

.tour-spotlight {
    position: relative;
    z-index: 9999;
    box-shadow: 0 0 0 4px var(--accent-1), 0 0 0 9999px rgba(0, 0, 0, 0.55);
    border-radius: 10px;
    transition: box-shadow 0.3s ease;
}

.tour-tooltip {
    position: fixed;
    z-index: 10000;
    background: var(--bg-card);
    border: 1px solid var(--accent-1);
    border-radius: 14px;
    padding: 16px 18px;
    max-width: 320px;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.25), 0 0 0 1px rgba(102, 126, 234, 0.15);
    animation: tourPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes tourPop {
    from { opacity: 0; transform: scale(0.9) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.tour-tooltip-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--accent-1);
    margin-bottom: 6px;
}

.tour-tooltip-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 12px;
}

.tour-tooltip-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tour-skip {
    padding: 6px 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.7rem;
    cursor: pointer;
    transition: color 0.2s;
}

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

.tour-next {
    padding: 8px 18px;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    border: none;
    border-radius: 8px;
    color: #fff;
    font-family: var(--font);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tour-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}

@media (max-width: 480px) {
    .tour-tooltip { max-width: 280px; padding: 12px 14px; }
    .tour-tooltip-title { font-size: 0.8rem; }
    .tour-tooltip-text { font-size: 0.7rem; }
}

/* === Referral Widget === */
.referral-widget {
    margin-top: 14px;
    padding: 14px;
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(102, 126, 234, 0.04) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.referral-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.referral-icon {
    font-size: 1rem;
}

.referral-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
}

.referral-count {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-1);
    background: rgba(102, 126, 234, 0.1);
    padding: 3px 8px;
    border-radius: 100px;
}

.referral-desc {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin: 0 0 8px;
    line-height: 1.4;
}

.referral-link-row {
    display: flex;
    gap: 4px;
}

.referral-link-input {
    flex: 1;
    padding: 7px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.65rem;
    outline: none;
    cursor: text;
}

.referral-link-input:focus {
    border-color: var(--accent-1);
}

.referral-copy-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    border: none;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.referral-copy-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

@media (max-width: 480px) {
    .referral-widget { padding: 10px; }
    .referral-link-input { font-size: 0.6rem; }
}

/* === SEO Score === */
.seo-score-card {
    border: 1px solid rgba(0, 184, 148, 0.15) !important;
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(0, 184, 148, 0.02) 100%) !important;
}

.seo-grade {
    font-size: 1.3rem;
    font-weight: 900;
    margin-left: auto;
}

.seo-score-body {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
}

.seo-ring-container {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.seo-ring {
    width: 80px;
    height: 80px;
}

.seo-ring-num {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--text-primary);
}

.seo-checklist {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
    flex: 1;
}

.seo-check {
    display: flex;
    align-items: center;
    gap: 4px;
}

.seo-check-icon {
    font-size: 0.65rem;
}

.seo-check-name {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.seo-check.fail .seo-check-name {
    color: var(--text-muted);
    opacity: 0.6;
}

.seo-words {
    padding: 8px 16px 12px;
    font-size: 0.68rem;
    color: var(--text-muted);
    text-align: center;
    border-top: 1px solid var(--border);
    margin-top: 4px;
}

@media (max-width: 480px) {
    .seo-score-body { flex-direction: column; gap: 10px; }
    .seo-ring-container { width: 64px; height: 64px; }
    .seo-ring { width: 64px; height: 64px; }
    .seo-ring-num { font-size: 1rem; }
    .seo-checklist { gap: 3px 8px; }
    .seo-check-name { font-size: 0.62rem; }
}

/* === Presets === */
.presets-section {
    margin-top: 4px;
    padding: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

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

.presets-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.btn-save-preset {
    padding: 4px 10px;
    background: transparent;
    border: 1px dashed var(--border);
    border-radius: 100px;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-save-preset:hover {
    border-color: var(--accent-1);
    color: var(--accent-1);
    border-style: solid;
}

.presets-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.presets-empty {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-style: italic;
}

.preset-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-pill:hover {
    border-color: var(--accent-1);
    background: rgba(102, 126, 234, 0.06);
    transform: translateY(-1px);
}

.preset-pill-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preset-pill:hover .preset-pill-name {
    color: var(--accent-1);
}

.preset-pill-delete {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 0.55rem;
    cursor: pointer;
    opacity: 0;
    transition: all 0.15s ease;
    padding: 0;
    font-family: var(--font);
}

.preset-pill:hover .preset-pill-delete {
    opacity: 1;
}

.preset-pill-delete:hover {
    background: rgba(225, 112, 85, 0.15);
    color: #e17055;
}

@media (max-width: 480px) {
    .presets-section { padding: 10px; }
    .preset-pill { padding: 4px 8px; }
    .preset-pill-name { font-size: 0.65rem; max-width: 100px; }
    .preset-pill-delete { opacity: 1; }
}

/* === Inline Editing === */
.card-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.btn-edit {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.btn-edit:hover {
    border-color: var(--accent-1);
    background: rgba(102, 126, 234, 0.06);
}

.btn-share {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.btn-share-wa:hover {
    border-color: #25d366;
    background: rgba(37, 211, 102, 0.08);
}

.btn-edit-active {
    border-color: var(--accent-1);
    background: rgba(102, 126, 234, 0.12);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.15);
}

.inline-editing {
    border: 1px dashed var(--accent-1) !important;
    border-radius: 8px !important;
    padding: 12px !important;
    background: rgba(102, 126, 234, 0.03) !important;
    outline: none;
    box-shadow: inset 0 0 12px rgba(102, 126, 234, 0.06);
    cursor: text;
    min-height: 80px;
    transition: all 0.2s ease;
}

.inline-editing:focus {
    box-shadow: inset 0 0 16px rgba(102, 126, 234, 0.08), 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.edit-actions {
    display: flex;
    gap: 8px;
    padding: 8px 16px 12px;
    justify-content: flex-end;
    animation: calSlideUp 0.2s ease;
}

.btn-edit-save {
    padding: 7px 16px;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    border: none;
    border-radius: 8px;
    color: #fff;
    font-family: var(--font);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-edit-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-edit-cancel {
    padding: 7px 14px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-edit-cancel:hover {
    border-color: #e17055;
    color: #e17055;
}

@media (max-width: 480px) {
    .btn-edit { width: 28px; height: 28px; font-size: 0.65rem; }
    .edit-actions { padding: 6px 12px 10px; }
    .btn-edit-save, .btn-edit-cancel { padding: 6px 12px; font-size: 0.7rem; }
}

/* === Panel Tabs === */
.panel-tabs {
    display: flex;
    gap: 4px;
    padding: 0 0 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.panel-tab {
    flex: 1;
    padding: 10px 16px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.panel-tab:hover {
    border-color: var(--accent-1);
    color: var(--text-secondary);
}

.panel-tab.active {
    background: rgba(102, 126, 234, 0.1);
    border-color: var(--accent-1);
    color: var(--accent-1);
}

/* === Library === */
.library-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.library-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 4px 12px;
    border-radius: 100px;
}

.library-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.library-search {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.82rem;
    outline: none;
    transition: var(--transition);
}

.library-search:focus {
    border-color: var(--accent-1);
}

.library-filters {
    display: flex;
    gap: 4px;
}

.lib-filter {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.lib-filter:hover {
    border-color: var(--accent-1);
    color: var(--text-secondary);
}

.lib-filter.active {
    background: rgba(102, 126, 234, 0.12);
    border-color: var(--accent-1);
    color: var(--accent-1);
}

/* Library Cards */
.library-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: calc(100vh - 320px);
    overflow-y: auto;
}

.library-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    transition: var(--transition);
}

.library-card:hover {
    border-color: rgba(102, 126, 234, 0.3);
}

.lib-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.lib-card-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.lib-platform-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
}

.lib-date {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.lib-card-actions {
    display: flex;
    gap: 4px;
}

.btn-copy-sm {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    padding: 0;
    border-radius: 8px;
}

.lib-card-preview {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.5;
    cursor: pointer;
    padding: 8px 0;
    border-radius: 4px;
    transition: var(--transition);
    white-space: pre-wrap;
}

.lib-card-preview:hover {
    color: var(--text-primary);
}

.lib-card-preview.expanded {
    background: var(--bg-input);
    padding: 12px;
    border-radius: var(--radius-md);
    max-height: 300px;
    overflow-y: auto;
}

.lib-card-tags {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}

.lib-tag {
    font-size: 0.65rem;
    color: var(--accent-1);
    background: rgba(102, 126, 234, 0.08);
    padding: 2px 8px;
    border-radius: 100px;
}

.library-empty {
    text-align: center;
    padding: 40px 16px;
    color: var(--text-muted);
    font-size: 0.88rem;
}

/* Library shortcut button */
.btn-library-shortcut {
    margin-top: 20px;
    padding: 10px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-library-shortcut:hover {
    border-color: var(--accent-1);
    color: var(--accent-1);
}

/* Responsive library */
@media (max-width: 768px) {
    .panel-tabs { gap: 3px; }
    .panel-tab { padding: 8px 12px; font-size: 0.75rem; }
    .library-search { padding: 8px 12px; font-size: 0.78rem; }
    .lib-filter { padding: 5px 8px; font-size: 0.68rem; }
    .library-list { max-height: calc(100vh - 280px); }
}

@media (max-width: 480px) {
    .panel-tabs { margin-bottom: 14px; padding-bottom: 12px; }
    .panel-tab { padding: 7px 8px; font-size: 0.7rem; }
    .lib-card-preview { font-size: 0.72rem; }
    .library-list { max-height: none; }
}

/* === Content Calendar === */
.calendar-widget {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
}

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

.cal-nav-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1.2rem;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
}

.cal-nav-btn:hover {
    border-color: var(--accent-1);
    color: var(--accent-1);
}

.cal-month-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 4px;
}

.cal-weekdays span {
    text-align: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 6px 0;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: var(--bg-input);
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: default;
    transition: all 0.2s ease;
    padding: 2px;
    min-height: 40px;
}

.cal-day-empty {
    background: transparent;
}

.cal-day-num {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.cal-day-today {
    border-color: var(--accent-1);
    background: rgba(102, 126, 234, 0.08);
}

.cal-day-today .cal-day-num {
    color: var(--accent-1);
    font-weight: 800;
}

.cal-day-active {
    cursor: pointer;
    background: rgba(0, 184, 148, 0.06);
    border-color: rgba(0, 184, 148, 0.2);
}

.cal-day-active:hover {
    transform: scale(1.08);
    border-color: rgba(0, 184, 148, 0.5);
    box-shadow: 0 2px 8px rgba(0, 184, 148, 0.15);
}

.cal-day-gap {
    border: 1px dashed rgba(225, 112, 85, 0.25);
    background: rgba(225, 112, 85, 0.03);
}

.cal-day-gap .cal-day-num {
    color: var(--text-muted);
    opacity: 0.6;
}

.cal-dots {
    display: flex;
    gap: 2px;
    justify-content: center;
}

.cal-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
}

.cal-dot-legend {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    vertical-align: middle;
}

.cal-legend {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.cal-legend-item {
    font-size: 0.68rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.cal-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 14px;
}

.cal-stat-box {
    text-align: center;
    background: var(--bg-input);
    border-radius: 10px;
    padding: 10px 6px;
}

.cal-stat-num {
    display: block;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--accent-1);
}

.cal-stat-label {
    font-size: 0.62rem;
    color: var(--text-muted);
    font-weight: 600;
}

.cal-day-detail {
    margin-top: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    animation: calSlideUp 0.3s ease;
}

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

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

.cal-day-detail-header h4 {
    font-size: 0.92rem;
    font-weight: 700;
}

.cal-close-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font);
}

.cal-close-btn:hover {
    border-color: var(--accent-1);
    color: var(--text-primary);
}

.cal-day-detail-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.cal-detail-card {
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 10px 12px;
}

.cal-detail-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.cal-detail-card-header .lib-platform-name {
    flex: 1;
}

.cal-detail-preview {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

@media (max-width: 768px) {
    .calendar-widget { padding: 14px; }
    .cal-day { min-height: 34px; }
    .cal-day-num { font-size: 0.65rem; }
    .cal-dot { width: 4px; height: 4px; }
    .cal-legend { gap: 8px; }
    .cal-legend-item { font-size: 0.6rem; }
    .cal-stat-num { font-size: 1rem; }
    .cal-stat-label { font-size: 0.58rem; }
}

@media (max-width: 480px) {
    .cal-grid { gap: 2px; }
    .cal-day { min-height: 28px; border-radius: 6px; }
    .cal-day-num { font-size: 0.6rem; }
    .cal-dots { gap: 1px; }
    .cal-dot { width: 3px; height: 3px; }
    .cal-weekdays span { font-size: 0.58rem; }
    .cal-stats { gap: 4px; }
    .cal-stat-box { padding: 8px 4px; }
}

.streak-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    background: rgba(255, 149, 0, 0.12);
    border: 1px solid rgba(255, 149, 0, 0.25);
    border-radius: 100px;
    cursor: default;
    transition: var(--transition);
}

.streak-fire {
    font-size: 0.85rem;
    animation: fireWiggle 2s ease-in-out infinite;
}

@keyframes fireWiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

.streak-count {
    font-size: 0.85rem;
    font-weight: 800;
    color: #ff9500;
}

.streak-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Hot streak (7+ days) */
.streak-badge.streak-hot {
    background: rgba(255, 149, 0, 0.2);
    border-color: rgba(255, 149, 0, 0.4);
    animation: streakPulse 2s ease-in-out infinite;
}

@keyframes streakPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 149, 0, 0); }
    50% { box-shadow: 0 0 12px 2px rgba(255, 149, 0, 0.2); }
}

/* Fire mode (30+ days) */
.streak-badge.streak-fire-mode {
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.2), rgba(255, 59, 48, 0.15));
    border-color: rgba(255, 59, 48, 0.4);
}

.streak-badge.streak-fire-mode .streak-count {
    background: linear-gradient(135deg, #ff9500, #ff3b30);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === Monthly Progress Pill === */
.progress-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 100px;
}

.progress-text {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
}

.progress-bar-mini {
    width: 50px;
    height: 4px;
    background: var(--bg-input);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Celebration Overlay === */
.celebration-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 15, 0.92);
    backdrop-filter: blur(16px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.celebration-content {
    text-align: center;
    z-index: 2;
    animation: celebBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes celebBounce {
    0% { transform: scale(0.3); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.celebration-emoji {
    font-size: 4rem;
    margin-bottom: 16px;
    animation: celebSpin 0.8s ease-out;
}

@keyframes celebSpin {
    0% { transform: rotate(-20deg) scale(0); }
    60% { transform: rotate(10deg) scale(1.2); }
    100% { transform: rotate(0) scale(1); }
}

.celebration-content h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #667eea, #f093fb, #ffd86f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.celebration-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Confetti */
.confetti-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.confetti-particle {
    position: absolute;
    top: -10px;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    animation: confettiFall linear forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg) scale(0.3);
        opacity: 0;
    }
}

/* Responsive for streak elements */
@media (max-width: 768px) {
    .streak-badge {
        padding: 4px 8px;
        gap: 3px;
    }
    .streak-fire { font-size: 0.75rem; }
    .streak-count { font-size: 0.75rem; }
    .streak-label { font-size: 0.6rem; }

    .progress-pill {
        padding: 4px 8px;
        gap: 5px;
    }
    .progress-text { font-size: 0.62rem; }
    .progress-bar-mini { width: 36px; }

    .celebration-emoji { font-size: 3rem; }
    .celebration-content h2 { font-size: 1.4rem; }
    .celebration-content p { font-size: 0.85rem; }
}

@media (max-width: 480px) {
    .progress-pill { display: none; }

    .streak-badge {
        padding: 3px 6px;
    }
    .streak-label { display: none; }
    .streak-count { font-size: 0.7rem; }

    .celebration-content h2 { font-size: 1.2rem; }
    .celebration-content p { font-size: 0.78rem; padding: 0 20px; }
    .confetti-particle { width: 6px; height: 6px; }
}
