/* components.css - Buttons, cards, pills, chips, toggles, toasts, modals, badges, inputs */

/* Input Components */
.input-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.input-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.input-group input {
    padding: 12px 16px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 16px;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: all 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-purple);
    background: white;
}

/* Buttons */
.btn-primary {
    padding: 14px 24px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-pill);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-ghost {
    padding: 8px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ghost:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.btn-sm {
    padding: 8px 16px;
    background: var(--bg-primary);
    border: none;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-sm:hover {
    background: var(--accent-purple);
    color: white;
}

.btn-sm.btn-copy {
    background: var(--accent-gradient);
    color: white;
}

.btn-sm.btn-used {
    background: var(--bg-primary);
}

.btn-sm.btn-used.is-used {
    background: var(--text-muted);
    color: white;
    opacity: 0.7;
}

.btn-sm.btn-save {
    background: var(--bg-primary);
    color: var(--text-secondary);
}

.btn-sm.btn-save.saved {
    background: #ffd700;
    color: #2d2640;
}

.btn-approve {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.btn-approve:hover {
    background: #2e7d32;
    color: white;
}

.btn-disapprove {
    background: #fce4ec;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.btn-disapprove:hover {
    background: #c62828;
    color: white;
}

.btn-signout {
    width: 100%;
    padding: 14px 24px;
    background: transparent;
    color: #c41e3a;
    border: 2px solid #c41e3a;
    border-radius: var(--radius-pill);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-signout:hover {
    background: #c41e3a;
    color: white;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 100px;
    color: var(--accent-purple);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-back:hover {
    background: var(--border-light);
}

.briefing-back-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 100px;
    color: var(--accent-purple);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 16px;
    transition: all 0.2s ease;
}

.briefing-back-btn:hover {
    background: var(--border-light);
}

.briefing-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    color: var(--accent-purple);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.briefing-nav-btn:hover:not(:disabled) {
    background: var(--accent-purple);
    color: white;
}

.briefing-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.briefing-launch-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 20px;
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-md);
    text-align: left;
}

.briefing-launch-btn:hover {
    border-color: var(--accent-purple);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.briefing-launch-btn:active {
    transform: scale(0.98);
}

.show-all-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-purple);
    cursor: pointer;
    text-align: center;
    margin-top: var(--spacing-md);
    transition: all 0.2s;
}

.show-all-btn:hover {
    background: var(--accent-purple);
    color: white;
}

.btn-note-submit {
    padding: 12px 24px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-pill);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-note-submit:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

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

.btn-undo {
    padding: 10px 24px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.btn-danger {
    background: #ef4444;
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: var(--radius-pill);
    font-weight: 600;
}

.btn-danger:hover {
    background: #dc2626;
}

.view-research-btn {
    background: var(--accent-gradient);
    color: white;
}

/* Pills */
.pill-btn {
    padding: 8px 20px;
    background: var(--bg-primary);
    border: 2px solid transparent;
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.pill-btn:hover {
    background: var(--accent-purple);
    color: white;
}

.pill-btn.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--shadow-sm);
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-md);
}

.item {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.item:hover {
    box-shadow: var(--shadow-md);
}

.item.used {
    opacity: 0.5;
}

.item.saved {
    border: 2px solid #ffd700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

.item.disapproved-pending {
    opacity: 0.3;
    position: relative;
}

.item.ai-pick {
    position: relative;
}

.item-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    flex-wrap: wrap;
}

.item-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto;
}

.item-content {
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
    line-height: 1.5;
}

.item-actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: var(--spacing-xs);
}

/* Badges */
.badge {
    padding: 4px 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.badge.verified {
    background: #e0f7e0;
    color: #2d7030;
}

.badge.approved {
    background: #e0f0ff;
    color: #1e5a9e;
}

.approved-badge {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.beta-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--accent-gradient);
    color: white;
    font-size: 10px;
    font-weight: 700;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wip-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #ff9800;
    color: white;
    font-size: 10px;
    font-weight: 700;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.onboarding-progress {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-purple);
    background: var(--bg-card);
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--glass-border);
}

.goal-badge {
    margin-top: var(--spacing-xs);
    display: inline-block;
    padding: 4px 12px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
}

html[data-theme="dark"] .goal-badge {
    background: #1b5e20;
    color: #a5d6a7;
}

/* Chips */
.filter-chip {
    padding: 6px 16px;
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.filter-chip:hover {
    border-color: var(--accent-purple);
}

.filter-chip.active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
}

.filter-chips {
    display: flex;
    gap: 10px;
    padding: 4px 0;
    min-width: min-content;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-light);
    transition: 0.3s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent-gradient);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-sm {
    transform: scale(0.8);
    transform-origin: right center;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + var(--spacing-md));
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    background: var(--text-primary);
    color: white;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(245, 240, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-light);
    border-top-color: var(--accent-purple);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-secondary);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.empty-state-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 280px;
    margin: 0 auto;
}

.empty-briefing-icon {
    font-size: 64px;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.empty-briefing-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.empty-briefing-subtext {
    font-size: 14px;
    color: var(--text-secondary);
}

.empty-notes {
    text-align: center;
    padding: var(--spacing-lg);
    color: var(--text-muted);
    font-size: 14px;
}

/* Links */
.view-all-link {
    color: var(--accent-purple);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.view-all-link:hover {
    text-decoration: underline;
}

.memory-link {
    font-size: 13px;
    color: var(--accent-purple);
    text-decoration: none;
    font-weight: 600;
}

.memory-link:hover {
    text-decoration: underline;
}

.alert-source {
    font-size: 12px;
    color: var(--accent-purple);
    text-decoration: none;
}

.alert-source:hover {
    text-decoration: underline;
}

.news-source {
    font-size: 13px;
    color: var(--accent-purple);
    text-decoration: none;
    font-weight: 600;
}

.news-source:hover {
    text-decoration: underline;
}

/* Error Message */
.error-message {
    padding: 12px;
    background: #ffe0e0;
    color: #c41e3a;
    border-radius: var(--radius-sm);
    font-size: 14px;
    text-align: center;
}

/* Undo Overlay */
.undo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(245, 240, 255, 0.8);
    border-radius: var(--radius-lg);
    z-index: 5;
}

html[data-theme="dark"] .undo-overlay {
    background: rgba(26, 26, 46, 0.8);
}

/* Scroll to Top Button */
.scroll-top-btn {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 28px);
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    color: var(--accent-purple);
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    z-index: 99;
    transition: opacity 0.2s, transform 0.2s;
    display: none;
}

.scroll-top-btn:hover {
    background: var(--accent-purple);
    color: white;
    transform: scale(1.1);
}

.scroll-top-btn.visible {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* AI Pick Heart Indicator */
.ai-pick-heart {
    position: absolute;
    bottom: 12px;
    right: 12px;
    font-size: 20px;
    cursor: help;
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 2;
}

.ai-pick-heart:hover {
    opacity: 1;
    transform: scale(1.2);
}

.ai-pick-heart::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    right: 0;
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-bottom: 6px;
}

.ai-pick-heart:hover::after {
    opacity: 1;
}

/* Onboarding Task */
.onboarding-task {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    transition: opacity 0.5s, transform 0.5s, max-height 0.5s;
    max-height: 120px;
    overflow: hidden;
}

.onboarding-task.task-completing {
    opacity: 0;
    transform: translateX(40px);
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
}

.onboarding-done-msg {
    font-size: 15px;
    color: var(--text-secondary);
    text-align: center;
    padding: var(--spacing-lg);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
}

/* What's New Card */
.whats-new-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink, #d4a0d0));
    border-radius: var(--radius-lg);
    color: #fff;
}

.whats-new-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.whats-new-content {
    flex: 1;
}

.whats-new-text {
    font-size: 14px;
    margin-bottom: var(--spacing-sm);
    opacity: 0.95;
}

.whats-new-btn {
    background: rgba(255,255,255,0.2) !important;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,0.4) !important;
    font-size: 13px;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    backdrop-filter: blur(4px);
}

.whats-new-btn:active {
    background: rgba(255,255,255,0.35) !important;
}

/* Desktop Responsive */
@media (min-width: 768px) {
    .toast {
        bottom: var(--spacing-lg);
    }
    
    .card, .item {
        padding: var(--spacing-xl);
    }
    
    .filter-chips {
        flex-wrap: wrap;
    }
    
    .item-content {
        font-size: 15px;
    }
}
