/* Shared Sidebar Styles - Pixel Perfect from Result Page */

/* Body margin when sidebar is open */
body.sidebar-open {
    margin-left: 250px;
}

/* Smooth transition for page shift when opening/closing sidebar */
body {
    margin-left: 0;
    transition: margin-left 0.3s ease;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;   /* fallback */
    height: 100svh;  /* iOS small viewport */
    height: 100dvh;  /* dynamic viewport */
    background: #000;
    z-index: 1000;
    transition: left 0.3s ease;
    overflow: hidden;
    /* prevent whole sidebar scrolling */
    display: flex;
    flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom, 16px);
    box-sizing: border-box;
}
@media (max-width: 1024px) {
    .sidebar {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

.sidebar.expanded {
    left: 0;
}

/* Sidebar Trigger */
.sidebar-trigger {
    position: fixed;
    top: 16px;
    left: 12px;
    height: 24px;
    width: auto;
    padding: 0 10px;
    background: transparent;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
    border: none;
}

.sidebar-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
}

.trigger-labels {
    position: relative;
    display: flex;
    align-items: center;
}

/* Two-line menu indicator */
.menu-lines {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    margin-right: 8px;
}
.menu-lines .line { height: 2px; background: #000; transition: background 0.2s ease, width 0.2s ease; }
.menu-lines .line:first-child { width: 18px; }
.menu-lines .line:last-child { width: 14px; }
.sidebar-trigger.expanded .menu-lines .line {
    background: #fff; /* expanded: white */
}

.trigger-labels .label {
    font-family: inherit;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.trigger-labels .menu-label {
    font-size: 18px;
    color: #000;
    transition: all 0.2s ease;
}

.trigger-labels .close-label {
    display: none;
    color: #fff;
    font-size: 12px;
    transition: all 0.2s ease;
}

.sidebar.expanded .sidebar-trigger {
    left: 250px;
}

.sidebar-trigger.expanded .trigger-labels .menu-label { display: none; }
.sidebar-trigger.expanded .trigger-labels .menu-lines { display: none; }
.sidebar-trigger.expanded .trigger-labels .close-label { display: block; margin: -10px; }

.sidebar-trigger.expanded {
    left: 250px;
}

/* Sidebar sections */
.sidebar-section {
    padding: 16px 14px;
}

.company-section {
    height: 56px;
    display: flex;
    align-items: center;
}

.company-logo h2 {
    color: #fff;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

/* Navigation section */
.navigation-section {
    padding: 0px 10px 10px 0px;
    border-bottom: 1px solid #333;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.nav-item:hover {
    color: #fff;
}

.nav-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.nav-text {
    flex: 1;
}

.products-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 14px 14px;
    min-height: 0;
    /* allow inner list to scroll */
}

.products-list {
    flex: 1;
    overflow-y: auto;
    padding-top: 14px;
    padding-right: 5px;
    min-height: 0;
    /* ensure scroll works within flex */
}

.products-list::-webkit-scrollbar {
    width: 6px;
}

.products-list::-webkit-scrollbar-track {
    background: #000;
    border-radius: 3px;
}

.products-list::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

.products-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Firefox */
.products-list {
    scrollbar-color: #444 #000;
    scrollbar-width: thin;
}

.new-product-btn {
    width: 100%;
    background: transparent;
    /* no box */
    color: #eaeaea;
    border-radius: 8px;
    padding: 0px;
    height: 32px;
    margin-bottom: 6px;
    text-align: left;
    font-size: 13px;
    cursor: pointer;
    transition: color 0.2s ease;
    display: block;
    max-height: 2% !important;
    font-weight: bold;
    border: none;
    margin-top: 20px;
}

.new-product-btn:hover {
    color: #ffffff;
}

.new-product-btn:focus,
.new-product-btn:focus-visible,
.new-product-btn:active {
    outline: none;
    border: none;
    box-shadow: none;
}

.product-item {
    background: #000000;
    border-radius: 8px;
    padding: 2px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    position: relative;
}

.product-item:hover {
    background: #333;
}

.product-thumbnail {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    display: block;
}

.product-content {
    flex: 1;
    min-width: 0;
    padding: 4px 0;
}

.product-name {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.product-prompt {
    font-size: 10px;
    color: #ccc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
    line-height: 1.2;
}

.product-date {
    font-size: 9px;
    color: #888;
    line-height: 1.2;
}

.product-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.product-item:hover .product-delete {
    opacity: 1;
}

.user-section {
    height: 64px;
    display: flex;
    align-items: center;
    border-top: 1px solid #333;
    margin-top: auto;
    /* stick to bottom */
    padding: 12px 14px;
}

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

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-icon {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 10px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Modal styles for confirmation dialogs (support both .modal-* and .confirm-*) */
.modal-overlay,
.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-dialog,
.confirm-dialog {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 0;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    margin-left: 40%;
    margin-top: 15%;
}

/* Make the confirm backdrop not affect centering */
.confirm-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
}

.modal-header,
.confirm-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #333;
}

.modal-header h3,
.confirm-header h3 {
    margin: 0;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
}

.modal-body,
.confirm-body {
    padding: 20px 24px;
    color: #ccc;
    line-height: 1.5;
}

.modal-actions,
.confirm-actions {
    padding: 16px 24px 20px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-actions button,
.confirm-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.modal-actions .modal-cancel,
.confirm-actions .confirm-cancel {
    background: #444;
    color: #fff;
}

.modal-actions .modal-cancel:hover,
.confirm-actions .confirm-cancel:hover {
    background: #555;
}

.modal-actions .modal-confirm,
.confirm-actions .confirm-ok {
    background: #ff4444;
    color: #fff;
}

.modal-actions .modal-confirm:hover,
.confirm-actions .confirm-ok:hover {
    background: #ff6666;
}

/* Topbar container for the Bespoken trigger */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    display: flex;
    align-items: center;
    background: transparent;
    z-index: 1000;
    background: rgba(248, 249, 250, 1);
    transition: background 0.1s ease;
}

/* When sidebar is open, make the topbar transparent */
body.sidebar-open .topbar {
    background: rgba(248, 249, 250, 0) !important;
    
}
