/* new-sidebar.css - Google-Style Sidebar Styles */
/* This file contains all styles for the new sidebar design */

/* Left Sidebar Container */
.sidebar-left {
    width: 280px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e8eaed;
    transition: margin-left 0.3s ease;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 300;
}

.sidebar-left.collapsed {
    margin-left: -280px;
}

/* Sidebar Branding/Header */
.sidebar-branding {
    padding: 12px 16px;
    border-bottom: 1px solid #e8eaed;
    min-height: 64px;
    display: flex;
    align-items: center;
    transition: opacity 0.3s ease;
}

.sidebar-left.collapsed .sidebar-branding {
    opacity: 0;
    pointer-events: none;
}

.sidebar-branding-text {
    font-size: 18px;
    font-weight: 500;
    color: #202124;
}

/* Sidebar Sections */
.sidebar-section {
    padding: 16px;
    border-bottom: 1px solid #e8eaed;
    flex-shrink: 0;
}

/* Start Chat Button */
.start-chat-btn {
    width: 100%;
    padding: 10px 14px;
    background: #1a73e8;
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.start-chat-btn:hover {
    background: #1765cc;
}

.start-chat-btn svg {
    stroke: currentColor;
}

/* Navigation Items */
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    color: #5f6368;
    font-size: 14px;
    margin-bottom: 1px;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.5;
    flex-shrink: 0;
}

.nav-item:hover {
    background: #e8eaed;
}

.nav-item.active {
    background: #e8f0fe;
    color: #1a73e8;
}

/* Library Section */
.library-section {
    margin-bottom: 4px;
}

.library-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    color: #202124;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.library-header:hover {
    background: #e8eaed;
}

.library-header svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
    transition: transform 0.2s;
}

.library-header.collapsed svg {
    transform: rotate(-90deg);
}

.library-items {
    margin-left: 12px;
    border-left: 2px solid #e8eaed;
    padding-left: 8px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.library-items.collapsed {
    max-height: 0 !important;
    opacity: 0;
}

.library-items:not(.collapsed) {
    max-height: 500px;
    opacity: 1;
}

.nav-item.sub-item {
    font-size: 13px;
    padding: 6px 12px;
}

/* Search Box */
.search-box {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.search-box:focus {
    border-color: #1a73e8;
}

/* Sidebar Content (Scrollable Chat List) */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px;
    min-height: 0;
}

/* Section Labels (Pinned, Recent, Starred) */
.section-label {
    font-size: 11px;
    font-weight: 600;
    color: #5f6368;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 12px 12px 8px 12px;
    margin-top: 8px;
}

/* Chat Items */
.chat-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
    margin-bottom: 2px;
    border-left: 3px solid transparent;
}

.chat-item:hover {
    background: #f1f3f4;
    border-left-color: transparent;
    border-image: linear-gradient(to bottom, #1a73e8, #00bcd4) 1;
}

.chat-item:hover .chat-item-menu {
    opacity: 1;
}

.chat-item-most-recent {
    background-color: #e8f0fe; /* A light blue to signify it's the latest */
}

.chat-item-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-item-icon svg {
    stroke: #5f6368;
}

.chat-item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-item-title {
    font-size: 13px;
    font-weight: 500;
    color: #202124;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-time {
    font-size: 11px;
    color: #5f6368;
    white-space: nowrap;
}

/* Chat Item Menu (3-dot menu) */
.chat-item-menu {
    opacity: 0;
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    border-radius: 4px;
    cursor: pointer;
    color: #202124;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    position: relative;
}

.chat-item-menu:hover {
    background: #e8eaed;
}

.chat-item-menu:focus {
    outline: none;
}

/* Chat Menu Dropdown */
.chat-menu-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    border: 1px solid #dadce0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    z-index: 1000;
    min-width: 180px;
    margin-top: 4px;
    padding: 4px 0;
}

.chat-menu-dropdown.show {
    display: block;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    text-align: left;
    font-size: 14px;
    color: #202124;
    cursor: pointer;
    transition: background 0.2s;
}

.menu-item:hover {
    background: #f1f3f4;
}

.menu-item:first-child {
    border-radius: 8px 8px 0 0;
}

.menu-item:last-child {
    border-radius: 0 0 8px 8px;
}

.menu-item svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.menu-item.danger {
    color: #d32f2f;
}

.menu-item.danger:hover {
    background: #ffebee;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid #e8eaed;
    flex-shrink: 0;
}

/* Campaign Card */
.campaign-card {
    background: linear-gradient(135deg, #f1f3f4 0%, #e8eaed 100%);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #dadce0;
}

.campaign-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.campaign-title {
    font-size: 13px;
    font-weight: 600;
    color: #202124;
    margin-bottom: 2px;
    line-height: 1.2;
}

.campaign-description {
    font-size: 11px;
    color: #5f6368;
    line-height: 1.3;
}

.campaign-progress-bar {
    height: 4px;
    background: #dadce0;
    border-radius: 2px;
    overflow: hidden;
}

.campaign-progress-fill {
    height: 100%;
    background: linear-gradient(to right, #1a73e8, #00bcd4);
    border-radius: 2px;
    transition: width 0.3s;
}

.campaign-progress-text {
    font-size: 11px;
    font-weight: 600;
    color: #5f6368;
    white-space: nowrap;
}

.campaign-action-btn {
    width: 100%;
    margin-top: 8px;
    padding: 6px 12px;
    background: #1a73e8;
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.campaign-action-btn:hover {
    background: #1765cc;
}

/* Adjust main content for new sidebar */
.main-content {
    margin-left: 280px;
    transition: margin-left 0.3s ease;
}

body.sidebar-collapsed .main-content,
.main-content.sidebar-collapsed {
    margin-left: 0;
}

/* Chat Item Tags (for tooltips) */
.chat-item-tags-tooltip {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 8px;
    background: white;
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 8px 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 10000;
    white-space: nowrap;
    display: flex;
    gap: 6px;
    align-items: center;
}

.chat-item:hover .chat-item-tags-tooltip {
    opacity: 1;
    visibility: visible;
}

.chat-tag {
    font-size: 9px;
    padding: 4px 8px;
    border-radius: 10px;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.chat-tag.emergency { background: #FFEBEE; color: #C62828; }
.chat-tag.design { background: #F3E5F5; color: #6A1B9A; }
.chat-tag.technical { background: #E1F5FE; color: #01579B; }
.chat-tag.weather { background: #E3F2FD; color: #0D47A1; }
.chat-tag.planning { background: #FFF8E1; color: #E65100; }
.chat-tag.travel { background: #E8F5E9; color: #1B5E20; }
.chat-tag.work { background: #E0F2F1; color: #004D40; }
.chat-tag.safety { background: #FFF9C4; color: #F57C00; }
.chat-tag.food { background: #FCE4EC; color: #AD1457; }
.chat-tag.learning { background: #F3E5F5; color: #6A1B9A; }
.chat-tag.health { background: #FFF3E0; color: #E65100; }
.chat-tag.creative { background: #F1F8E9; color: #33691E; }
.chat-tag.family { background: #FBE9E7; color: #BF360C; }
.chat-tag.development { background: #E8EAF6; color: #283593; }

/* Responsive Design */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 299; /* Below the sidebar */
}

.menu-btn {
    display: none; /* Hidden by default */
}

@media (max-width: 768px) {
    .sidebar-left {
        width: 80%;
        max-width: 320px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 0 0 20px rgba(0,0,0,0.2);
    }

    .sidebar-left.open-mobile {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: none; /* Hide desktop toggle on mobile */
    }

    .menu-btn {
        display: block; /* Show mobile menu button */
    }
}
