body {
    background-color: #0d0d0d;
    color: #d1d1d1;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
}

.toast {
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.show {
    transform: translateX(0);
}

.serif-font {
    font-family: 'Playfair Display', serif;
}

.frontier-span {
    position: relative;
    color: #0d0d0d;
    font-weight: 500;
    font-style: italic;
    z-index: 1;
    display: inline-block;
    transition: all 0.2s;
}

.frontier-span::before {
    content: '';
    position: absolute;
    inset: -1px -6px;
    background: linear-gradient(135deg, #a5b4fc 0%, #d8b4fe 33%, #fde68a 66%, #bbf7d0 100%);
    background-size: 200% 200%;
    animation: gradientFlow 10s ease infinite;
    border-radius: 4px;
    z-index: -1;
}

.input-container {
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
    box-shadow: 0 4px 30px -5px rgba(0,0,0,0.6);
    position: relative;
    z-index: 10;
    border-radius: 12px;
}

.glow-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140%;
    height: 200%;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    z-index: -1;
    filter: blur(80px);
    pointer-events: none;
    background: radial-gradient(circle at 50% 50%, 
        rgba(255, 255, 255, 0.1), 
        rgba(200, 200, 200, 0.1), 
        rgba(150, 150, 150, 0.1), 
        rgba(100, 100, 100, 0.1),
        transparent 70%);
    background-size: 200% 200%;
    animation: auroraFlow 15s ease infinite;
}

@keyframes auroraFlow {
    0% { background-position: 0% 50%; transform: translate(-50%, -50%) scale(1); }
    33% { background-position: 100% 70%; transform: translate(-50%, -50%) scale(1.1) rotate(5deg); }
    66% { background-position: 50% 100%; transform: translate(-50%, -50%) scale(0.9) rotate(-5deg); }
    100% { background-position: 0% 50%; transform: translate(-50%, -50%) scale(1); }
}

.cursor {
    display: inline-block;
    width: 2.5px;
    height: 38px;
    background-color: #f2f2f2;
    margin-left: 4px;
    animation: blink 0.8s infinite;
    vertical-align: middle;
    transform: translateY(-2px);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.modal-gradient {
    background: linear-gradient(135deg, #a5b4fc 0%, #d8b4fe 33%, #fde68a 66%, #bbf7d0 100%);
    background-size: 200% 200%;
    animation: gradientFlow 10s ease infinite;
}

/* Pricing Modal */
.pricing-plus-gradient {
    background: linear-gradient(135deg, #a5b4fc 0%, #d8b4fe 33%, #fde68a 66%, #bbf7d0 100%);
    background-size: 200% 200%;
    animation: gradientFlow 10s ease infinite;
}

.pricing-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pricing-card:hover {
    transform: translateY(-4px);
    border-color: #444;
}

.pricing-card.plus-highlight {
    border-color: rgba(165, 180, 252, 0.3);
    box-shadow: 0 0 40px rgba(165, 180, 252, 0.1);
}

.comparison-table th {
    font-weight: 500;
    color: #888;
}

.comparison-table td {
    border-bottom: 1px solid #1a1a1a;
}

.comparison-table tr:hover td {
    background-color: rgba(255,255,255,0.02);
}

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #2a2a2a;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #333;
}

.get-plus-pill {
    background: linear-gradient(135deg, #a5b4fc 0%, #d8b4fe 33%, #fde68a 66%, #bbf7d0 100%);
    background-size: 200% 200%;
    animation: gradientFlow 10s ease infinite;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.image-loading-placeholder {
    background: linear-gradient(135deg, #a5b4fc 0%, #d8b4fe 33%, #fde68a 66%, #bbf7d0 100%);
    background-size: 200% 200%;
    animation: gradientFlow 4s ease-in-out infinite;
    max-width: 100%;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 10px 0;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    transition: width 0.5s ease, height 0.5s ease;
}

/* Force image to fill block while maintaining aspect ratio */
.attachment-image-container img {
    width: auto !important;
    height: auto !important;
    max-width: 320px;
    max-height: 480px;
    border-radius: 20px;
    display: block;
}

/* Or if you want them exactly 320px wide regardless of height */
.message-image-scaled {
    width: 320px !important;
    height: auto !important;
    max-height: 480px;
    object-fit: contain;
    border-radius: 20px;
}

/* Glass Orb Loader */
.orb-container {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.orb-core {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.8);
    animation: orbPulse 2s ease-in-out infinite;
}

.orb-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 38% 62% 63% 37% / 41% 44% 56% 59%;
    animation: orbRotate 6s linear infinite;
}

.orb-ring:nth-child(2) {
    width: 90%;
    height: 90%;
    border-color: rgba(255, 255, 255, 0.2);
    animation: orbRotate 4s linear reverse infinite;
}

@keyframes orbRotate {
    0% { transform: rotate(0deg); border-radius: 38% 62% 63% 37% / 41% 44% 56% 59%; }
    100% { transform: rotate(360deg); border-radius: 38% 62% 63% 37% / 41% 44% 56% 59%; }
}

@keyframes orbPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(255, 255, 255, 0.6); }
    50% { transform: scale(1.1); box-shadow: 0 0 40px rgba(255, 255, 255, 0.9); }
}

.image-loading-placeholder::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.2), transparent);
    animation: scanLine 3s linear infinite;
}

@keyframes scanLine {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

.image-loading-text {
    display: none; /* Removed as requested */
}

.image-loading-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,0.1) 0%, transparent 70%);
}

/* Minimal Spinner */
.btn-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top: 2px solid #000;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.btn-spinner-white {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.btn-spinner-red {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(220, 38, 38, 0.2);
    border-top: 2px solid #dc2626;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.btn-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.btn-loader.hidden {
    display: none !important;
}

/* AI Status Indicators */
@keyframes soft-blink {
    0%, 100% { opacity: 0.3; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1); }
}

.status-circle {
    width: 10px;
    height: 10px;
    background-color: white;
    border-radius: 50%;
    animation: soft-blink 1.2s ease-in-out infinite;
    display: inline-block;
    vertical-align: middle;
}

@keyframes flow-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.analyzing-text, .thinking-text, .searching-text {
    font-size: 13px;
    font-weight: 500;
    background: linear-gradient(90deg, #4b5563 0%, #d1d5db 50%, #4b5563 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: flow-shimmer 2s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-left: 8px;
}

@keyframes action-fade-in {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.message-actions-fade {
    animation: action-fade-in 0.5s ease forwards;
}

@keyframes typing-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.typing-cursor {
    display: inline-block;
    width: 6px;
    height: 14px;
    background-color: #666;
    margin-left: 2px;
    vertical-align: middle;
    animation: typing-blink 0.8s infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

button:disabled .btn-spinner {
    opacity: 0.5;
}

.btn-content.hidden {
    display: none;
}

@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Modal Animations */
.modal-overlay {
    opacity: 0;
    backdrop-filter: blur(0px);
    transition: all 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    backdrop-filter: blur(4px);
}

.modal-content {
    transform: scale(0.98) translateY(5px);
    opacity: 0;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.active .modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Dropdown - ChatGPT style */
.dropdown-content {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.98) translateY(-4px);
    pointer-events: none;
    transition: all 0.1s ease-out;
    transform-origin: top left;
}

.dropdown-content.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

/* Custom Checkbox */
.custom-checkbox {
    appearance: none;
    width: 18px;
    height: 18px;
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    margin-top: 1px;
}

.custom-checkbox:checked {
    background-color: #fff;
    border-color: #fff;
}

.custom-checkbox:checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid #000;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-checkbox:hover {
    border-color: #555;
    background-color: #222;
}

.custom-checkbox:checked:hover {
    background-color: #eee;
}

.icon-btn {
    color: #666;
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.icon-btn:hover {
    color: #fff;
    background-color: rgba(255,255,255,0.05);
}

/* Sidebar */
.sidebar {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #0d0d0d;
    border-right: 1px solid #1a1a1a;
    width: 52px;
    overflow: visible;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar.expanded {
    width: 210px; /* Reduced for smaller scale/strict look */
}

.sidebar-item {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Ensure left alignment for icons/text */
    height: 34px;
    margin: 1px 4px; 
    padding: 0 8px; 
    border-radius: 6px;
    cursor: pointer;
    color: #ececec;
    transition: all 0.2s;
    white-space: nowrap;
    text-decoration: none;
    position: relative;
    border: 1px solid transparent;
    text-align: left; /* Ensure text starts from the left */
}

.sidebar-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-item.active {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.05);
}

.sidebar-label {
    margin-left: 0;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    display: none;
    text-align: left; /* Force left alignment */
}

.sidebar-item div + .sidebar-label {
    margin-left: 10px;
}

.sidebar.expanded .sidebar-label {
    opacity: 1;
    pointer-events: auto;
    display: inline-block; /* Changed from block for better flex behavior */
}

/* Chat items refinements */
.sidebar-item .sidebar-label.flex-1 {
    flex: 1;
    min-width: 0;
}

.options-chat-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    color: #666;
    transition: all 0.2s;
}

.options-chat-btn:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Tooltip/Shortcut Label */
.sidebar-tooltip {
    position: absolute;
    left: 100%;
    margin-left: 12px;
    padding: 6px 10px;
    background-color: #000;
    color: #fff;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 110;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    border: 1px solid #2a2a2a;
}

.sidebar-tooltip span {
    color: #888;
    font-size: 11px;
    display: flex;
    gap: 2px;
}

.sidebar-tooltip kbd {
    background: #1a1a1a;
    border-radius: 3px;
    padding: 0 4px;
    color: #ccc;
    font-family: inherit;
}

.sidebar-item:hover .sidebar-tooltip {
    opacity: 1;
    transform: translateX(0);
}

.sidebar.expanded .sidebar-tooltip {
    display: none;
}

.sidebar-toggle-container {
    height: 48px; /* More compact height */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.sidebar.expanded .sidebar-toggle-container {
    justify-content: space-between;
    padding: 0 12px; /* Reduced padding */
}

.sidebar-controls {
    display: flex;
    flex-direction: column;
    padding: 6px 4px; /* Tight padding */
    gap: 2px;
}

.sidebar.expanded .sidebar-controls {
    flex-direction: column;
    padding: 6px 4px; /* Tight padding */
}

.sidebar-controls .sidebar-item {
    margin: 0;
    width: 100%;
    justify-content: center;
    height: 34px; /* Even smaller height */
}

.sidebar.expanded .sidebar-controls .sidebar-item {
    justify-content: flex-start;
}

.sidebar-controls .sidebar-item .sidebar-label {
    display: none;
    font-size: 13px; /* Smaller font */
}

.sidebar.expanded .sidebar-controls .sidebar-item .sidebar-label {
    display: block;
    margin-left: 6px; /* slight adjustment */
}

#chats-list {
    display: none;
}

.sidebar.expanded #chats-list {
    display: block;
}

.chat-group-title {
    padding: 16px 8px 4px 12px; /* Aligned with icon/label start (4px margin + 8px padding) */
    font-size: 10px; 
    font-weight: 600;
    color: #555; 
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: none;
}

/* Removed the automatic display block on expansion */
/*.sidebar.expanded .chat-group-title {
    display: block;
}*/

.main-wrapper {
    transition: padding-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding-left: 52px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

body.no-sidebar .main-wrapper {
    padding-left: 0 !important;
}

body.no-sidebar .main-wrapper header {
    left: 0 !important;
}

.sidebar.expanded + .main-wrapper {
    padding-left: 210px;
}

.main-wrapper header {
    left: 60px; /* Added margin to avoid overlap with sidebar toggle */
    padding-left: 8px; /* Corrected padding */
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.expanded + .main-wrapper header {
    left: 218px; /* 210 sidebar width + 8px gap */
}

.sidebar-header-title {
    display: none;
    align-items: center;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.sidebar.expanded .sidebar-header-title {
    display: flex;
}

.pill-notice {
    background-color: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
}

textarea::placeholder {
    color: #4a4a4a;
}

/* Context Menu (Three Dots) & Input Dropdowns */
.chat-options-dropdown, .add-dropdown-menu {
    position: fixed;
    background-color: #171717;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 4px;
    z-index: 1000;
    width: 154px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transform: scale(0.97) translateY(-5px);
    transition: opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1), transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.chat-options-dropdown.active, .add-dropdown-menu.active {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

.chat-options-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 7px;
    color: #ececec;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    user-select: none;
}

.chat-options-item:hover {
    background-color: #242424;
    color: #fff;
}

.chat-options-item svg {
    width: 15px;
    height: 15px;
    color: #888;
    transition: color 0.15s;
}

.chat-options-item:hover svg {
    color: #fff;
}

.chat-options-item.delete {
    color: #ef4444;
}

.chat-options-item.delete:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ff5555;
}

/* Personalization specific */
.pers-item-title {
    font-size: 14px;
    font-weight: 500;
}

.pers-item-desc {
    font-size: 11.5px;
    color: #888;
    line-height: 1.3;
}

.personalization-dropdown .chat-options-item {
    align-items: flex-start;
    padding: 8px 12px;
}

.personalization-dropdown .chat-options-item svg {
    margin-top: 4px;
}

.chat-options-item.delete svg {
    color: #f87171;
}

.chat-options-divider {
    height: 1px;
    background-color: #2a2a2a;
    margin: 4px 6px;
}

/* Custom Modal */
.custom-modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.custom-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.custom-modal {
    background-color: #0d0d0d;
    border: 1px solid #2a2a2a;
    width: 90%;
    max-width: 340px;
    border-radius: 12px; /* Matching rounded-xl */
    overflow: hidden;
    transform: scale(0.98) translateY(5px);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0;
    display: flex;
    flex-direction: column;
    padding: 16px; /* Matching p-4 of main modals */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    position: relative;
}

.custom-modal-overlay.active .custom-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.custom-modal-header {
    margin-bottom: 8px; /* Matching mb-2 of main title */
    text-align: center;
}

.custom-modal-header h3 {
    font-size: 20px; /* Kept slightly smaller for compact look, but same font */
    font-weight: 500;
    color: #fff;
    font-family: 'Playfair Display', serif;
}

.custom-modal-body {
    margin-bottom: 24px; /* Matching mb-6 of main desc */
    text-align: center;
    padding: 0 8px; /* Matching px-2 */
}

.custom-modal-body p {
    font-size: 13px;
    line-height: 1.6;
    color: #999;
}

.custom-modal-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.custom-modal-btn {
    width: 100%;
    padding: 8px 16px; /* Matching py-2 */
    border-radius: 6px; /* Matching rounded-md */
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.custom-modal-btn.cancel {
    background-color: transparent;
    color: #aaa;
    border: none;
    font-size: 13px;
    font-weight: 400;
}

.custom-modal-btn.cancel:hover {
    color: #fff;
    background-color: rgba(255,255,255,0.05);
}

.custom-modal-btn.confirm {
    background-color: #fff;
    color: #000;
    border: none;
}

.custom-modal-btn.confirm:hover {
    background-color: #eee;
}

.custom-modal-btn.danger {
    background-color: #ef4444;
    color: white;
    border: none;
}

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

/* Sidebar User Section */
#user-profile-section {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 6px;
    margin-top: auto;
}

.sidebar-user-item {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#user-avatar {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.sidebar-user-item:hover #user-avatar {
    transform: scale(1.05);
}

.upgrade-pill-btn {
    background-color: #1a1a1a;
    border-color: #333;
    line-height: normal;
    white-space: nowrap;
}

/* Settings Modal Specifics */
.settings-tab-btn {
    text-align: left;
    color: #999;
}

.settings-tab-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.settings-tab-btn.active {
    background-color: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.settings-tab-btn svg {
    opacity: 0.7;
}

.settings-tab-btn.active svg {
    opacity: 1;
}

.settings-tab-content {
    animation: fadeInTab 0.2s ease-out;
}

.settings-tab-btn.active {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: #fff !important;
}

.settings-tab-btn:not(.active) {
    background-color: transparent !important;
    color: #9ca3af !important;
}

.settings-tab-btn:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: #fff !important;
}

@keyframes fadeInTab {
    from { opacity: 0; transform: translateY(2px); }
    to { opacity: 1; transform: translateY(0); }
}

.sidebar.expanded #user-profile-section .sidebar-label {
    display: block;
    opacity: 1;
}

.sidebar:not(.expanded) .sidebar-user-item {
    justify-content: center;
    padding: 6px 0;
}

.sidebar:not(.expanded) .sidebar-user-item .sidebar-label {
    display: none;
}

.custom-modal-body {
    padding: 24px;
}

.custom-modal-actions {
    padding: 12px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background-color: #1a1a1a;
    border-top: 1px solid #2a2a2a;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0d0d0d;
}

::-webkit-scrollbar-thumb {
    background: #2a2a2a;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3a3a3a;
}

.dropdown-item {
    color: #d1d1d1;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background-color: #2a2a2a;
    color: #fff;
}

#web-search-btn, #image-btn, #video-btn {
    transition: color 0.2s, background-color 0.2s, border-color 0.2s;
}

#web-search-btn.active {
    width: auto !important;
    padding: 0 8px 0 6px;
    background-color: #222;
    border-color: #333;
    color: #fff;
    justify-content: flex-start;
    gap: 6px;
}

#web-search-btn.active .icon-close {
    display: none;
}

#web-search-btn.active:hover .icon-globe {
    display: none;
}

#web-search-btn.active:hover .icon-close {
    display: block;
}

#image-btn.active {
    width: auto !important;
    padding: 0 8px 0 6px;
    background-color: #222;
    border-color: #333;
    color: #fff;
    justify-content: flex-start;
    gap: 6px;
}

#image-btn.active .icon-close {
    display: none;
}

#image-btn.active:hover .icon-image {
    display: none;
}

#image-btn.active:hover .icon-close {
    display: block;
}

#video-btn.active {
    width: auto !important;
    padding: 0 8px 0 6px;
    background-color: #222;
    border-color: #333;
    color: #fff;
    justify-content: flex-start;
    gap: 6px;
}

#video-btn.active .icon-close {
    display: none;
}

#video-btn.active:hover .icon-video {
    display: none;
}

#video-btn.active:hover .icon-close {
    display: block;
}

/* Custom Tooltips */
.icon-btn {
    position: relative;
}

.icon-btn[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background-color: #fff;
    color: #1a1a1a;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    z-index: 100;
}

.icon-btn[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    border-width: 5px;
    border-style: solid;
    border-color: #fff transparent transparent transparent;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

.icon-btn[data-tooltip]:hover:not(.active)::after,
.icon-btn[data-tooltip]:hover:not(.active)::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Attachment Styles */
#attachments-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 6px 0 6px;
}

.attachment-preview {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
}

.image-preview {
    width: 60px;
    height: 60px;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.2s;
}

.attachment-preview:hover img {
    filter: brightness(0.7);
}

.file-preview {
    padding: 6px 10px;
    min-width: 90px;
    display: flex;
    align-items: center;
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
    height: 60px;
}

.file-icon {
    width: 28px;
    height: 28px;
    background-color: #2a2a2a;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    flex-shrink: 0;
}

.remove-attachment {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    background-color: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0;
    transition: opacity 0.2s;
    cursor: pointer;
    z-index: 10;
}

.attachment-preview:hover .remove-attachment {
    opacity: 1;
}

/* Override for file previews to ensure same position */
.file-preview .remove-attachment {
    top: 4px;
    right: 4px;
    left: auto;
    transform: none;
}

.file-extension {
    font-weight: 700;
    font-size: 9px;
    color: #888;
    text-transform: uppercase;
}

.file-info {
    display: flex;
    flex-direction: column;
    margin-right: 14px;
}

.file-name {
    font-size: 12px;
    font-weight: 500;
    color: #ddd;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    font-size: 10px;
    color: #555;
}

/* Markdown Content Styling */
.markdown-content p {
    margin-bottom: 0.75rem;
}

.markdown-content p:last-child {
    margin-bottom: 0;
}

/* Custom Code blocks */
.code-block-container {
    background-color: #1e1e1e;
}

.markdown-content pre {
    background-color: transparent;
    border-radius: 0;
    padding: 0;
    margin: 0;
    overflow-x: auto;
    border: none;
}

.markdown-content code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.9em;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

.markdown-content pre code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
}

.markdown-content ul, .markdown-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.markdown-content ul {
    list-style-type: disc;
}

.markdown-content ol {
    list-style-type: decimal;
}

.markdown-content li {
    margin-bottom: 0.25rem;
}

.markdown-content h1, .markdown-content h2, .markdown-content h3, .markdown-content h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #fff;
}

.markdown-content blockquote {
    border-left: 4px solid rgba(255, 255, 255, 0.2);
    padding-left: 1rem;
    margin-left: 0;
    font-style: italic;
    color: #aaa;
}

.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.markdown-content th, .markdown-content td {
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem;
    text-align: left;
}

.markdown-content th {
    background-color: rgba(255, 255, 255, 0.05);
}

.markdown-content a {
    color: #60a5fa;
    text-decoration: underline;
}

.markdown-content a:hover {
    color: #93c5fd;
}

@keyframes voicePulse {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}

.voice-blob {
    animation: voicePulse 2s infinite ease-in-out;
}

/* Voice Overlay */
#voice-overlay {
    backdrop-filter: blur(10px);
    transition: opacity 0.3s ease;
}

#voice-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Pricing Modal */
.pricing-modal-content {
    background-color: #0d0d0d;
    border: 1px solid #2a2a2a;
    border-radius: 16px;
    width: 100%;
    max-width: 1100px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 24px;
}

@media (max-width: 1024px) {
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .pricing-grid {
        grid-template-columns: 1fr;
    }
}

.pricing-card {
    background: #0d0d0d;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
}

.pricing-card:hover {
    border-color: #444;
    transform: translateY(-2px);
}

.pricing-card.featured {
    border-color: rgba(255, 255, 255, 0.1);
    background: #0d0d0d;
}

.plus-gradient-text {
    background: linear-gradient(135deg, #a5b4fc 0%, #d8b4fe 33%, #fde68a 66%, #bbf7d0 100%);
    background-size: 200% 200%;
    animation: gradientFlow 10s ease infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.plus-gradient-btn {
    background: linear-gradient(135deg, #a5b4fc 0%, #d8b4fe 33%, #fde68a 66%, #bbf7d0 100%);
    background-size: 200% 200%;
    animation: gradientFlow 10s ease infinite;
    color: #000 !important;
    font-weight: 700;
}

.comparison-table-container {
    padding: 0 24px 24px 24px;
    overflow-x: auto;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    color: #d1d1d1;
    font-size: 13px;
}

.comparison-table th, .comparison-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #2a2a2a;
    text-align: left;
}

.comparison-table th {
    font-weight: 600;
    color: #fff;
    background: #0d0d0d;
    position: sticky;
    top: 0;
}

.comparison-table .category-header {
    background: #0d0d0d;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.05em;
}

.comparison-table tr:last-child td {
    border-bottom: none;
}

.comparison-table .check-icon {
    color: #fff;
}

.comparison-table .dash-icon {
    color: #444;
}

.comparison-table td:not(:first-child) {
    text-align: center;
}

.pricing-modal-scroll {
    overflow-y: auto;
    flex: 1;
}

#settings-modal .modal-content > div {
    zoom: 0.9;
    height: 111.11% !important;
}

@media (max-width: 768px) {
    #settings-modal .modal-content > div {
        zoom: 1;
        height: 100% !important;
    }
}

.pricing-modal-scroll::-webkit-scrollbar {
    width: 6px;
}

.pricing-modal-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.pricing-modal-scroll::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
}
