/* ============================================================
   AI Settings — Kebab menu + AI Preferences modal
   Prefixes: .ais- (kebab menu), .aip- (preferences modal)
   ============================================================ */

/* --- Kebab Menu --- */
.ais-kebab-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.ais-kebab-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #ddd;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s;
    border: none;
    padding: 0;
}

.ais-kebab-btn:hover {
    background-color: #ccc;
}

.ais-kebab-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    display: none;
    z-index: 10001;
    min-width: 220px;
    padding: 6px 0;
    flex-direction: column;
}

.ais-kebab-dropdown.open {
    display: flex;
}

.ais-kebab-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    transition: background-color 0.15s;
    user-select: none;
}

.ais-kebab-item:hover {
    background-color: #f5f5f5;
}

.ais-kebab-item-icon {
    width: 20px;
    text-align: center;
    font-size: 15px;
    flex-shrink: 0;
}

.ais-kebab-divider {
    height: 1px;
    background-color: #e0e0e0;
    margin: 4px 0;
}

.ais-kebab-disabled {
    color: #999;
    cursor: default;
    position: relative;
}

.ais-kebab-disabled:hover {
    background-color: transparent;
}

.ais-kebab-coming-soon {
    margin-left: auto;
    font-size: 10px;
    font-weight: 600;
    color: #999;
    background-color: #f3f4f6;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* --- Account button + dropdown --- */
.ais-account-wrapper {
    position: relative;
    margin-left: 8px;
}

.ais-account-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #059669;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
    border: none;
    padding: 0;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: 0.5px;
}

.ais-account-btn:hover {
    background-color: #047857;
}

.ais-account-btn.ais-account-initials svg {
    display: none;
}

.ais-account-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    display: none;
    z-index: 10001;
    min-width: 200px;
    padding: 6px 0;
    flex-direction: column;
}

.ais-account-dropdown.open {
    display: flex;
}

.ais-acct-info {
    padding: 12px 16px 8px;
}

.ais-acct-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.ais-acct-email {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.ais-acct-signout:hover {
    background-color: #fef2f2 !important;
}

/* --- AI Preferences Modal --- */
.aip-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10010;
    justify-content: center;
    align-items: center;
}

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

.aip-container {
    background-color: white;
    border-radius: 10px;
    width: 820px;
    height: 580px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.aip-header {
    padding: 18px 28px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.aip-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    letter-spacing: -0.2px;
}

.aip-header-subtitle {
    font-size: 12px;
    color: #999;
    margin-left: 10px;
    font-weight: 400;
}

.aip-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    border-radius: 4px;
}

.aip-close-btn:hover {
    color: #333;
    background-color: #f5f5f5;
}

.aip-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* --- Sidebar --- */
.aip-sidebar {
    width: 180px;
    flex-shrink: 0;
    border-right: 1px solid #e0e0e0;
    background-color: #fafbfc;
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.aip-sidebar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.15s;
    border-left: 3px solid transparent;
    user-select: none;
}

.aip-sidebar-item:hover {
    color: #333;
    background-color: #f0f0f0;
}

.aip-sidebar-item.active {
    color: #059669;
    font-weight: 600;
    background-color: #f0fdf4;
    border-left-color: #059669;
}

.aip-sidebar-icon {
    font-size: 15px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

/* --- Content --- */
.aip-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
    min-width: 0;
}

.aip-content::-webkit-scrollbar { width: 5px; }
.aip-content::-webkit-scrollbar-track { background: transparent; }
.aip-content::-webkit-scrollbar-thumb { background: #d0d0d0; border-radius: 3px; }

.aip-section-title {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
}

.aip-section-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 20px;
}

/* --- Form groups --- */
.aip-field {
    margin-bottom: 18px;
}

.aip-field-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

/* --- Pill toggle group --- */
.aip-pill-group {
    display: flex;
    gap: 0;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    width: fit-content;
}

.aip-pill {
    padding: 7px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    background-color: white;
    border: none;
    border-right: 1px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.aip-pill:last-child {
    border-right: none;
}

.aip-pill:hover {
    background-color: #f5f5f5;
    color: #333;
}

.aip-pill.active {
    background-color: #059669;
    color: white;
}

.aip-pill.active:hover {
    background-color: #047857;
}

/* --- Checkbox rows --- */
.aip-checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

.aip-checkbox {
    width: 16px;
    height: 16px;
    accent-color: #059669;
    cursor: pointer;
    flex-shrink: 0;
}

.aip-checkbox-label {
    font-size: 13px;
    color: #333;
    cursor: pointer;
    line-height: 1.4;
}

.aip-checkbox-desc {
    font-size: 11px;
    color: #999;
    margin-left: 26px;
    margin-top: -4px;
    margin-bottom: 4px;
}

/* --- Textarea --- */
.aip-textarea-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 20px;
    margin-bottom: 8px;
}

.aip-textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px 12px;
    font-size: 13px;
    font-family: Arial, sans-serif;
    line-height: 1.5;
    color: #333;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.aip-textarea:focus {
    outline: none;
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
    background-color: white;
}

.aip-textarea-hint {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    line-height: 1.4;
}

/* --- Footer --- */
.aip-footer {
    padding: 14px 28px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    background-color: #fafbfc;
}

.aip-reset-btn {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    background-color: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.aip-reset-btn:hover {
    background-color: #f9fafb;
    color: #333;
}

.aip-save-btn {
    padding: 8px 24px;
    font-size: 13px;
    font-weight: 700;
    color: white;
    background-color: #059669;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.aip-save-btn:hover {
    background-color: #047857;
}

.aip-save-btn.saved {
    background-color: #2563eb;
}

/* --- Saved toast --- */
.aip-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(60px);
    background-color: #059669;
    color: white;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10020;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
}

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