/* QuickSum-inspired Dashboard Styles */

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

html {
    scroll-behavior: smooth;
}

:root {
    --primary-color: #4f46e5; /* Indigo */
    --primary-hover: #4338ca;
    --success-color: #10b981; /* Emerald */
    --success-hover: #059669;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.5;
}

/* ===== TWO-COLUMN LAYOUT ===== */

.app-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: 100vh;
    overflow: hidden;
}

/* ===== LEFT SIDEBAR ===== */

.sidebar-left {
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
}

/* Hide scrollbar but keep functionality */
.sidebar-left::-webkit-scrollbar {
    width: 0;
    background: transparent;
}

.sidebar-left {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1001;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.mobile-menu-toggle:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.hamburger-icon {
    font-size: 24px;
    line-height: 1;
}

.brand {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-light);
}

.brand h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

/* Navigation Menu */

.nav-menu {
    padding: 16px 12px;
    border-bottom: 1px solid var(--border-light);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background: #eef2ff;
    color: var(--primary-color);
}

.nav-icon {
    font-size: 18px;
}

/* Submit Content Box */

.submit-content {
    padding: 20px;
    margin: 16px 12px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
}

.submit-content h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.submit-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.forwarding-address-wrapper {
    position: relative;
    margin-bottom: 8px;
}

.forwarding-input {
    width: 100%;
    padding: 8px 40px 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 13px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.btn-copy-overlay {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: all 0.2s;
}

.btn-copy-overlay:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary-color);
}

.btn-copy-overlay svg {
    width: 16px;
    height: 16px;
}

.submit-note {
    font-size: 11px;
    color: var(--text-light);
    margin-bottom: 12px;
    line-height: 1.4;
}

.btn-check-emails {
    width: 100%;
    padding: 10px;
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-check-emails:hover {
    background: var(--success-hover);
}

/* Sidebar Footer */

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

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

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.user-details {
    flex: 1;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-logout {
    font-size: 12px;
    color: var(--text-secondary);
    text-decoration: none;
}

.user-logout:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* ===== MAIN CONTENT ===== */

.main-content {
    overflow-y: auto;
    padding: 24px 32px;
    background: var(--bg-secondary);
}

/* Dashboard Header */

.dashboard-header {
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
}

.dashboard-header h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.header-filters {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.header-actions {
    flex-shrink: 0;
}

.search-box {
    position: relative;
    width: 280px;
}

.search-box input {
    width: 100%;
    padding: 10px 40px 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: border-color 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: var(--text-light);
}

/* Tag Filter Bar */

.tag-filter-bar {
    background: white;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.filter-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-tag {
    padding: 6px 14px;
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.filter-tag:hover {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

.filter-tag.active {
    background: #eef2ff;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Summary Cards Section */

.summary-cards {
    margin-bottom: 24px;
}

.section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Individual Summary Card */

.summary-card {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.03) 0%, rgba(79, 70, 229, 0) 50%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.summary-card:hover {
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.1);
    border-color: #dbeafe;
    transform: translateY(-2px);
}

.summary-card:hover::before {
    opacity: 1;
}

.card-header {
    display: flex;
    gap: 14px;
    margin-bottom: 14px;
    align-items: flex-start;
}

.card-icon {
    font-size: 28px;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 2px;
}

.card-title-area {
    flex: 1;
    min-width: 0; /* Allow text truncation */
}

.card-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    gap: 6px;
    font-size: 12px;
    color: var(--text-light);
    flex-wrap: wrap;
    align-items: center;
}

.card-meta .meta-item {
    display: inline-flex;
    align-items: center;
}

.card-meta .meta-separator {
    opacity: 0.5;
}

/* Tags inline with header */

.card-tags-inline {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-left: auto;
    align-items: flex-start;
}

/* Key Takeaway */

.card-takeaway {
    background: linear-gradient(135deg, #fef3c7 0%, #fef9e7 100%);
    border-left: 4px solid #f59e0b;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    box-shadow: 0 1px 3px rgba(245, 158, 11, 0.1);
}

.takeaway-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.takeaway-content {
    flex: 1;
}

.takeaway-content p {
    margin: 0;
    color: #1f2937;
}

.takeaway-content strong {
    font-weight: 600;
    color: #92400e;
}

.view-full-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.view-full-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.view-full-link svg {
    flex-shrink: 0;
}

/* Card Footer - Actions inline */

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

/* Card Tags */

.card-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.card-tag {
    display: inline-block;
    padding: 4px 10px;
    background: #eff6ff;
    color: var(--primary-color);
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
    border: 1px solid #dbeafe;
    transition: all 0.2s;
}

.card-tag:hover {
    background: #dbeafe;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

/* Card Actions */

.card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: auto;
}

.btn-action {
    padding: 7px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    color: var(--text-secondary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.btn-action svg {
    flex-shrink: 0;
}

.btn-action:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #f5f7ff;
}

.btn-view {
    color: var(--primary-color);
    border-color: #dbeafe;
    background: #eff6ff;
}

.btn-view:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-delete {
    color: var(--danger-color);
    border-color: #fecaca;
    background: #fef2f2;
    padding: 7px 10px;
}

.btn-delete:hover {
    background: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
}

/* Empty State */

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-light);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 16px;
    color: var(--text-light);
}


/* ===== MODAL ===== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-tabs {
    display: flex;
    gap: 0;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-light);
}

.modal-tab {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.modal-tab:hover {
    color: var(--text-primary);
}

.modal-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-content {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.tab-content strong {
    font-weight: 600;
}

.tab-content ul {
    margin-left: 20px;
    margin-top: 8px;
    margin-bottom: 8px;
}

.tab-content li {
    margin-bottom: 4px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
}

.btn-modal-close {
    padding: 10px 20px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s;
}

.btn-modal-close:hover {
    background: var(--border-color);
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 1200px) {
    .app-container {
        grid-template-columns: 260px 1fr;
    }
}

@media (max-width: 992px) {
    .app-container {
        grid-template-columns: 1fr;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .sidebar-left {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 280px;
        z-index: 1000;
        transition: left 0.3s ease-in-out;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .sidebar-left.mobile-open {
        left: 0;
    }

    /* Hide Submit Content section on mobile */
    .submit-content {
        display: none;
    }

    .main-content {
        padding: 72px 16px 16px 16px;
        grid-column: 1;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 16px;
    }

    .search-box {
        width: 100%;
    }

    /* Overlay for mobile menu */
    .mobile-menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .mobile-menu-overlay.active {
        display: block;
    }
}

@media (max-width: 640px) {
    .header-filters {
        flex-wrap: wrap;
    }

    .filter-btn {
        font-size: 12px;
        padding: 6px 12px;
    }

    .summary-card {
        padding: 16px;
    }
    
    .card-header {
        flex-wrap: wrap;
    }
    
    .card-tags-inline {
        margin-left: 0;
        width: 100%;
        margin-top: 8px;
    }
    
    .card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .card-actions {
        margin-left: 0;
        width: 100%;
    }

    .modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .brand h1 {
        font-size: 20px;
    }

    .dashboard-header h2 {
        font-size: 18px;
    }
}

/* ===== LOADING OVERLAY ===== */

.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    background: white;
    padding: 40px 60px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 500px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-content h3 {
    margin: 0 0 10px 0;
    color: var(--text-primary);
    font-size: 20px;
}

.loading-content p {
    margin: 0 0 20px 0;
    color: var(--text-secondary);
}

.loading-status {
    margin-top: 20px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
}

.loading-status.success {
    background: #d1fae5;
    color: #065f46;
}

.loading-status.error {
    background: #fee2e2;
    color: #991b1b;
}

.loading-result {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.loading-result-icon {
    font-size: 24px;
}

.btn-close-overlay {
    margin-top: 20px;
    padding: 10px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-close-overlay:hover {
    background: var(--primary-hover);
}
