/* apps/web-front/css/style.css */

/* --- DESIGN SYSTEM & TOKENS --- */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --font-primary: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Harmonious HSL Colors */
    --bg-primary: hsl(222, 47%, 6%);
    --bg-secondary: hsl(222, 47%, 10%);
    --accent-blue: hsl(210, 100%, 56%);
    --accent-purple: hsl(265, 89%, 65%);
    --accent-cyan: hsl(180, 100%, 50%);
    
    /* Glassmorphism Tokens */
    --glass-bg: hsla(222, 47%, 12%, 0.45);
    --glass-border: hsla(222, 100%, 100%, 0.08);
    --glass-glow: hsla(210, 100%, 56%, 0.15);
    
    /* Text Colors */
    --text-primary: hsl(210, 40%, 98%);
    --text-secondary: hsl(215, 20%, 75%);
    --text-muted: hsl(215, 15%, 50%);
    
    /* Status Colors */
    --status-new: hsl(190, 90%, 50%);
    --status-transcribing: hsl(280, 80%, 65%);
    --status-processing: hsl(35, 100%, 50%);
    --status-review: hsl(330, 90%, 60%);
    --status-approved: hsl(145, 80%, 45%);
    
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: var(--font-primary);
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(at 0% 0%, hsla(265, 89%, 65%, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, hsla(210, 100%, 56%, 0.15) 0px, transparent 50%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* --- GLASSMORPHISM COMPONENTS --- */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: var(--transition-smooth);
}

.glass-card:hover {
    border-color: hsla(210, 100%, 56%, 0.25);
    box-shadow: 0 8px 32px 0 var(--glass-glow);
}

.glass-input {
    background: hsla(222, 47%, 4%, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 1rem;
    transition: var(--transition-smooth);
    width: 100%;
}

.glass-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 12px hsla(210, 100%, 56%, 0.2);
}

.glass-button {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border: none;
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    padding: 12px 24px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.glass-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px hsla(265, 89%, 65%, 0.4);
}

.glass-button:active {
    transform: translateY(0);
}

.glass-button.secondary {
    background: hsla(222, 47%, 20%, 0.5);
    border: 1px solid var(--glass-border);
}

.glass-button.secondary:hover {
    background: hsla(222, 47%, 25%, 0.7);
    box-shadow: none;
}

.glass-button.danger {
    background: linear-gradient(135deg, hsl(350, 80%, 50%), hsl(350, 80%, 60%));
}

.glass-button.warning {
    background: linear-gradient(135deg, hsl(35, 90%, 45%), hsl(35, 90%, 55%));
}

.glass-button.success {
    background: linear-gradient(135deg, hsl(145, 80%, 40%), hsl(145, 80%, 50%));
}

/* --- APP LAYOUT (SPA) --- */
#auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-box h2 {
    font-size: 2rem;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-box p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

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

#main-app {
    display: none; /* Pokazywane po zalogowaniu */
    grid-template-columns: auto 1fr;
    min-height: 100vh;
    position: relative; /* Pozwala na pozycjonowanie pływającego przycisku toggle */
}

/* --- SIDEBAR --- */
aside {
    position: relative;
    background: hsla(222, 47%, 4%, 0.4);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    width: 260px;
    transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), padding 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

.brand-logo {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    opacity: 1;
    max-width: 200px;
    transition: opacity 0.2s ease, max-width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    font-weight: 500;
    transition: var(--transition-smooth);
    white-space: nowrap;
}

.nav-item.active a, .nav-item a:hover {
    color: var(--text-primary);
    background: hsla(222, 100%, 100%, 0.05);
    border-left: 3px solid var(--accent-blue);
}

.nav-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.nav-label {
    margin-left: 12px;
    opacity: 1;
    max-width: 150px;
    transition: opacity 0.2s ease, max-width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), margin-left 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
}

.user-info {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-top: 1px solid var(--glass-border);
    padding-top: 24px;
    white-space: nowrap;
}

.user-details {
    font-size: 0.9rem;
    color: var(--text-secondary);
    opacity: 1;
    max-width: 200px;
    transition: opacity 0.2s ease, max-width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: padding 0.3s ease, width 0.3s ease;
}

.logout-text {
    opacity: 1;
    max-width: 100px;
    transition: opacity 0.2s ease, max-width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.logout-icon {
    flex-shrink: 0;
}

/* --- REKOMENDOWANY PŁYWAJĄCY PRZYCISK SIDEBAR-TOGGLE --- */
.sidebar-toggle-btn {
    position: absolute;
    top: 36px;
    left: 248px; /* 260px (szerokość aside) - 12px (połowa szerokości przycisku) */
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: hsl(222, 47%, 10%);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000; /* Zapewnia widoczność nad wszystkimi elementami */
    transition: left 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    padding: 0;
}

.sidebar-toggle-btn:hover {
    background: hsl(222, 47%, 15%);
    color: var(--text-primary);
    border-color: var(--accent-blue);
    box-shadow: 0 0 8px var(--glass-glow);
}

.sidebar-toggle-btn .toggle-icon {
    font-size: 0.7rem;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: inline-block;
}

/* --- STAN ZŁOŻONY (COLLAPSED) --- */
.sidebar-collapsed aside {
    width: 72px;
    padding: 32px 12px;
}

.sidebar-collapsed .sidebar-toggle-btn {
    left: 60px; /* 72px (szerokość aside collapsed) - 12px (połowa szerokości przycisku) */
}

.sidebar-collapsed .brand-title,
.sidebar-collapsed .nav-label,
.sidebar-collapsed .user-details,
.sidebar-collapsed .logout-text {
    opacity: 0;
    max-width: 0;
    margin-left: 0;
    pointer-events: none;
}

.sidebar-collapsed .logout-btn {
    padding: 8px;
    width: 48px;
    height: 40px;
}

.sidebar-collapsed .nav-item a {
    justify-content: center;
    padding: 12px 0;
}

.sidebar-collapsed .sidebar-toggle-btn .toggle-icon {
    transform: rotate(180deg);
}

/* --- MAIN CONTENT & VIEWS --- */
main {
    padding: 40px;
    overflow-y: auto;
    max-height: 100vh;
}

.view-section {
    display: none;
}

.view-section.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

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

.view-header {
    margin-bottom: 32px;
}

.view-header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.view-header p {
    color: var(--text-secondary);
}

/* --- DASHBOARD VIEW (Puls Systemu) --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

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

.stat-card .value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-top: 8px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-card .label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.recent-notes-section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.notes-table-container {
    overflow-x: auto;
}

.notes-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.notes-table th {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 16px;
    border-bottom: 1px solid var(--glass-border);
}

.notes-table td {
    padding: 16px;
    border-bottom: 1px solid var(--glass-border);
}

.notes-table tr:hover td {
    background: hsla(222, 100%, 100%, 0.02);
}

/* --- STATUS PILLS --- */
.status-pill {
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
}

.status-pill.new { background: hsla(190, 90%, 50%, 0.15); color: var(--status-new); }
.status-pill.transcribing { background: hsla(280, 80%, 65%, 0.15); color: var(--status-transcribing); }
.status-pill.llm_processing { background: hsla(35, 100%, 50%, 0.15); color: var(--status-processing); }
.status-pill.waiting_for_review { background: hsla(330, 90%, 60%, 0.15); color: var(--status-review); }
.status-pill.approved { background: hsla(145, 80%, 45%, 0.15); color: var(--status-approved); }

/* --- INBOX & REVIEW VIEW --- */
/* --- INBOX & REVIEW VIEW --- */
.inbox-container {
    display: grid;
    grid-template-columns: 300px 1fr !important;
    gap: 28px;
    align-items: start;
}

.inbox-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 80vh;
    overflow-y: auto;
    padding-right: 6px;
}

.inbox-item {
    cursor: pointer;
    border: 1px solid var(--glass-border);
    transition: var(--transition-smooth);
    padding: 16px;
    border-radius: 12px;
    background: var(--glass-bg);
    position: relative;
    overflow: hidden;
}

.inbox-item:hover {
    transform: translateY(-2px);
    border-color: hsla(210, 100%, 56%, 0.25);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.inbox-item.selected {
    border-color: var(--accent-blue);
    background: hsla(210, 100%, 56%, 0.08);
    box-shadow: 0 0 15px hsla(210, 100%, 56%, 0.15);
}

.inbox-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: transparent;
    transition: var(--transition-smooth);
}

.inbox-item.selected::before {
    background: var(--accent-blue);
}

.inbox-item h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.35;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-primary);
}

.inbox-item .meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.inbox-item-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.inbox-item-badge.youtube { background: rgba(255, 0, 0, 0.12); color: #ff4a4a; border: 1px solid rgba(255, 0, 0, 0.2); }
.inbox-item-badge.tool { background: rgba(0, 255, 170, 0.12); color: var(--accent-cyan); border: 1px solid rgba(0, 255, 170, 0.2); }
.inbox-item-badge.link { background: rgba(0, 170, 255, 0.12); color: var(--accent-blue); border: 1px solid rgba(0, 170, 255, 0.2); }
.inbox-item-badge.voice { background: rgba(165, 55, 255, 0.12); color: var(--status-transcribing); border: 1px solid rgba(165, 55, 255, 0.2); }
.inbox-item-badge.text { background: rgba(255, 255, 255, 0.08); color: var(--text-secondary); border: 1px solid rgba(255, 255, 255, 0.15); }

.inbox-item-category {
    font-size: 0.75rem;
    color: var(--accent-cyan);
    font-weight: 500;
}

.inbox-item-snippet {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
    max-height: 2.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
    margin-bottom: 8px;
}

.review-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.review-panel-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: var(--text-secondary);
    border: 1px dashed var(--glass-border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.01);
}

.review-actions-bar {
    display: flex;
    gap: 12px;
    justify-content: flex-start;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 16px;
    margin-bottom: 4px;
}

.review-actions-bar .glass-button {
    font-size: 0.9rem;
    padding: 10px 18px;
    height: 40px;
    border: 1px solid transparent;
}

.review-actions-bar .glass-button.success {
    background: linear-gradient(135deg, hsl(145, 80%, 40%), hsl(145, 80%, 30%));
    border-color: hsl(145, 80%, 35%);
}
.review-actions-bar .glass-button.success:hover {
    box-shadow: 0 4px 15px hsla(145, 80%, 40%, 0.4);
}

.review-actions-bar .glass-button.warning {
    background: linear-gradient(135deg, hsl(35, 90%, 45%), hsl(35, 90%, 35%));
    border-color: hsl(35, 90%, 40%);
}
.review-actions-bar .glass-button.warning:hover {
    box-shadow: 0 4px 15px hsla(35, 90%, 45%, 0.4);
}

.review-actions-bar .glass-button.danger {
    background: linear-gradient(135deg, hsl(350, 80%, 50%), hsl(350, 80%, 40%));
    border-color: hsl(350, 80%, 45%);
}
.review-actions-bar .glass-button.danger:hover {
    box-shadow: 0 4px 15px hsla(350, 80%, 50%, 0.4);
}

.review-actions-bar .glass-button.secondary {
    background: linear-gradient(135deg, hsl(222, 20%, 25%), hsl(222, 20%, 18%));
    border-color: var(--glass-border);
}
.review-actions-bar .glass-button.secondary:hover {
    background: linear-gradient(135deg, hsl(222, 20%, 30%), hsl(222, 20%, 22%));
}

.metadata-editor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
}

.star-rating-container {
    display: flex;
    gap: 6px;
    font-size: 1.4rem;
    cursor: pointer;
    padding-top: 4px;
}

.star-btn {
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.star-btn:hover {
    transform: scale(1.25);
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.82rem;
    border-radius: 20px;
    background: rgba(0, 255, 170, 0.08);
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 255, 170, 0.15);
    transition: var(--transition-smooth);
}

.tag-chip:hover {
    background: rgba(0, 255, 170, 0.15);
    border-color: rgba(0, 255, 170, 0.3);
}

.tag-chip .remove-btn {
    cursor: pointer;
    font-weight: bold;
    color: var(--text-muted);
    transition: color 0.2s;
    font-size: 1rem;
    line-height: 1;
}

.tag-chip .remove-btn:hover {
    color: hsl(350, 80%, 60%);
}

.content-tabs-container {
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.01);
}

.content-tabs-header {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--glass-border);
    padding: 6px;
    gap: 6px;
}

.content-tabs-header button.tab-btn {
    background: transparent;
    border: none;
    padding: 8px 16px;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-smooth);
}

.content-tabs-header button.tab-btn:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.content-tabs-header button.tab-btn.active {
    background: rgba(255, 255, 255, 0.08);
    color: var(--accent-cyan);
    font-weight: 600;
}

.content-tab-panels {
    padding: 16px;
}

.markdown-editor-textarea {
    width: 100%;
    height: 380px;
    font-family: 'Fira Code', Consolas, Monaco, monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 14px;
    color: var(--text-primary);
    resize: vertical;
    outline: none;
    transition: var(--transition-smooth);
}

.markdown-editor-textarea:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 10px hsla(210, 100%, 56%, 0.15);
}

.record-pulse {
    animation: mic-pulse 1.5s infinite alternate;
}

@keyframes mic-pulse {
    0% {
        background: hsla(350, 80%, 50%, 0.4);
        box-shadow: 0 0 5px hsla(350, 80%, 50%, 0.5);
    }
    100% {
        background: hsla(350, 80%, 65%, 1);
        box-shadow: 0 0 18px hsla(350, 80%, 65%, 0.8);
    }
}


/* --- ADD NOTE VIEW --- */
.add-form-container {
    max-width: 800px;
}

.add-form-container .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 24px;
}

/* --- PREMIUM MARKDOWN PREVIEW --- */
.markdown-preview {
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 0.95rem;
}

.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3,
.markdown-preview h4 {
    margin-top: 20px;
    margin-bottom: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.markdown-preview h1 {
    font-size: 1.6rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 8px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.markdown-preview h2 {
    font-size: 1.3rem;
    color: var(--accent-cyan);
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
    padding-bottom: 6px;
}

.markdown-preview h3 {
    font-size: 1.15rem;
    color: var(--text-primary);
}

.markdown-preview p {
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.markdown-preview strong {
    color: var(--accent-cyan);
    font-weight: 600;
}

.markdown-preview ul {
    margin-left: 20px;
    margin-bottom: 16px;
    list-style-type: square;
    color: var(--text-secondary);
}

.markdown-preview li {
    margin-bottom: 6px;
}

.markdown-preview em {
    color: var(--accent-purple);
    font-style: italic;
}

/* Adjust inbox layout to allow wide review panel */
.inbox-container {
    grid-template-columns: 280px 1fr !important;
    transition: grid-template-columns 0.3s ease;
}

.inbox-container.inbox-list-collapsed {
    grid-template-columns: 1fr !important;
}

.inbox-container.inbox-list-collapsed .inbox-list {
    display: none !important;
}

/* --- QUICK ADD TABS & MODERN INPUTS --- */
.quick-add-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 12px;
    flex-wrap: wrap;
}

.quick-add-tabs .tab-btn {
    background: transparent;
    border: 1px solid transparent;
    padding: 10px 16px;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 8px;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-add-tabs .tab-btn:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.quick-add-tabs .tab-btn.active {
    background: hsla(210, 100%, 56%, 0.12);
    color: var(--accent-cyan);
    border-color: hsla(180, 100%, 50%, 0.2);
    box-shadow: 0 0 15px hsla(180, 100%, 50%, 0.1);
}

.quick-add-content {
    min-height: 240px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeInTab 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

/* Link Preview Card */
.input-with-button {
    display: flex;
    gap: 12px;
}

.input-with-button .glass-input {
    flex: 1;
}

.glass-button.mini {
    padding: 8px 16px;
    font-size: 0.85rem;
    white-space: nowrap;
}

.link-preview-box {
    margin-top: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    transition: var(--transition-smooth);
}

.link-preview-box.hidden {
    display: none;
}

.preview-loader {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
}

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

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

.preview-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.preview-content.hidden {
    display: none;
}

.preview-content h4 {
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 600;
}

.preview-content p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
}

.preview-badge {
    align-self: flex-start;
    padding: 2px 8px;
    background: hsla(210, 100%, 56%, 0.15);
    border: 1px solid hsla(210, 100%, 56%, 0.25);
    color: var(--accent-blue);
    font-size: 0.75rem;
    border-radius: 4px;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Category Pills & Textarea */
.textarea-container {
    position: relative;
}

.textarea-footer {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 6px 12px;
    background: hsla(222, 47%, 4%, 0.25);
    border: 1px solid var(--glass-border);
    border-top: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.textarea-container .glass-input {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.category-pills {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.category-pills .pill {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    color: var(--text-secondary);
    user-select: none;
}

.category-pills .pill:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.15);
}

.category-pills .pill.active {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: var(--text-primary);
    border-color: transparent;
    box-shadow: 0 4px 12px hsla(265, 89%, 65%, 0.25);
}

/* Drag and Drop Zone */
.drag-drop-zone {
    border: 2px dashed var(--glass-border);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.01);
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.drag-drop-zone.dragover {
    border-color: var(--accent-cyan);
    background: hsla(180, 100%, 50%, 0.04);
    box-shadow: 0 0 20px hsla(180, 100%, 50%, 0.15);
    transform: scale(1.01);
}

.drag-drop-icon {
    font-size: 2.5rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.drag-drop-text {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-primary);
}

.drag-drop-text .browse-link {
    color: var(--accent-cyan);
    text-decoration: underline;
    font-weight: 600;
}

.drag-drop-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* File list visualization */
.file-list {
    margin-top: 16px;
}

.file-list.hidden {
    display: none;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.file-icon {
    font-size: 2rem;
    color: var(--accent-cyan);
}

.file-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    word-break: break-all;
}

.file-size {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.file-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
}

.file-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 8px var(--accent-cyan);
}

.file-status {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent-cyan);
    margin-top: 2px;
}

.btn-remove-file {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: var(--transition-smooth);
}

.btn-remove-file:hover {
    color: hsl(350, 80%, 60%);
    background: rgba(255, 0, 0, 0.08);
}

.pdf-extraction-preview {
    margin-top: 16px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
}

.pdf-extraction-preview.hidden {
    display: none;
}

.pdf-extraction-preview h5 {
    color: var(--accent-cyan);
    font-size: 0.9rem;
    margin-bottom: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.extracted-text-box {
    max-height: 150px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: pre-wrap;
    background: rgba(255, 255, 255, 0.01);
    padding: 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

/* Tools tab layout */
.tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.tool-card {
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-align: left;
}

.tool-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15);
}

.tool-card.active {
    background: hsla(265, 89%, 65%, 0.1);
    border-color: hsla(265, 89%, 65%, 0.3);
    box-shadow: 0 0 15px hsla(265, 89%, 65%, 0.08);
}

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

.tool-icon {
    font-size: 1.3rem;
}

.tool-header h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.tool-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin: 0;
}

.tool-panel {
    display: none;
    padding: 16px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
}

.tool-panel.active {
    display: block;
    animation: fadeInTab 0.3s ease;
}

/* Voice recorder styles */
.voice-recorder-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px 10px;
}

.voice-record-btn {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, hsl(350, 80%, 50%), hsl(280, 80%, 50%));
    border: none;
    cursor: pointer;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(255, 0, 80, 0.3);
    transition: var(--transition-smooth);
}

.voice-record-btn .record-icon {
    color: white;
    font-size: 1.6rem;
    line-height: 1;
    transition: var(--transition-smooth);
}

.voice-record-btn.recording {
    background: hsl(350, 80%, 50%);
    box-shadow: 0 0 25px rgba(255, 0, 50, 0.6);
}

.voice-record-btn.recording .record-icon {
    transform: scale(0.8);
    border-radius: 4px; /* morph to square */
}

.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid hsl(350, 80%, 55%);
    top: 0;
    left: 0;
    opacity: 0;
    box-sizing: border-box;
}

.voice-record-btn.recording .pulse-ring {
    animation: pulseRing 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulseRing {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

.voice-status {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.voice-visualizer {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    max-width: 100%;
}

.voice-transcript-box {
    width: 100%;
    margin-top: 16px;
    border-top: 1px dashed var(--glass-border);
    padding-top: 16px;
    text-align: left;
}

.voice-transcript-box h5 {
    color: var(--accent-cyan);
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.quick-add-footer {
    border-top: 1px solid var(--glass-border);
    margin-top: 24px;
    padding-top: 16px;
}

.margin-top-20 {
    margin-top: 20px;
}

