/* Editor Dark Glassmorphism Styles */

#editor .container {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 1px;
    padding: 1px;
    background: rgba(255, 255, 255, 0.01);
}

/* Documents Sidebar */
.documents-sidebar {
    width: 280px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px 0 0 16px;
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 5;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
    margin: 6px 0 6px 6px;
    position: relative;
    overflow: hidden;
}

.documents-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.005);
    pointer-events: none;
    z-index: -1;
}

.documents-sidebar.collapsed {
    width: 0;
    min-width: 0;
    overflow: hidden;
    margin-left: 0;
    border-radius: 0;
    box-shadow: none;
}

.sidebar-header {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    border-radius: 16px 0 0 0;
}

.sidebar-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.08) 50%, 
        transparent 100%
    );
    border-radius: 16px 0 0 0;
}

/* Space Selector Styles */
.space-selector-container {
    position: relative;
    width: 100%;
}

.space-selector {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.space-selector::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    transition: left 0.5s ease;
}

.space-selector:hover::before {
    left: 100%;
}

.space-selector:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.space-chevron {
    transition: transform 0.3s ease;
    opacity: 0.6;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.space-selector:hover .space-chevron {
    opacity: 1;
}

.space-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    box-shadow: 
        0 15px 30px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
    z-index: 99999999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.space-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.space-dropdown-header {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.space-dropdown-header h4 {
    margin: 0;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.space-action-btn {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.space-action-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.12);
    transform: scale(1.05);
}

.space-action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #ff6b6b;
    border-color: rgba(239, 68, 68, 0.15);
}

.spaces-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 8px 0;
}

.spaces-list::-webkit-scrollbar {
    width: 4px;
}

.spaces-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.01);
    border-radius: 2px;
    margin: 6px;
}

.spaces-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.space-item {
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    position: relative;
    margin: 2px 8px;
    border-radius: 6px;
    border: 1px solid transparent;
}

.space-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
}

.space-item.active {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.space-info {
    flex: 1;
    cursor: pointer;
    padding: 4px 0;
}

.space-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.space-description {
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.8;
    line-height: 1.3;
}

.space-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.space-item:hover .space-actions {
    opacity: 1;
}

.sidebar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    background: transparent;
}

.sidebar-content::-webkit-scrollbar {
    width: 4px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.01);
    border-radius: 2px;
    margin: 6px;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.12);
}

.category-group {
    margin-bottom: 8px;
    position: relative;
}

.category-header {
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background: rgba(255, 255, 255, 0.015);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    margin: 0 8px 4px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.category-header .category-title {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.category-header .category-count {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px);
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 12px;
    min-width: 18px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.category-header:hover {
    background: rgba(255, 255, 255, 0.025);
    color: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.category-header:hover .category-count {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.1);
}

.category-chevron {
    transition: transform 0.3s ease;
    color: var(--text-tertiary);
    opacity: 0.6;
    margin-left: 6px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.category-header.collapsed .category-chevron {
    transform: rotate(-90deg);
}

.category-documents {
    padding: 4px 8px 8px;
    transition: all 0.3s ease;
}

.category-documents.collapsed {
    max-height: 0;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}

.document-item {
    padding: 8px 12px;
    margin: 2px 0;
    font-size: 12px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.015);
    backdrop-filter: blur(10px);
    border-radius: 6px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.document-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    transform: translateX(2px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.06);
}

.document-name {
    cursor: pointer;
    color: inherit;
    transition: all 0.3s ease;
    flex: 1;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 400;
    position: relative;
    line-height: 1.3;
    font-size: 12px;
}

.document-name:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.document-actions {
    opacity: 0;
    display: flex;
    gap: 4px;
    transition: all 0.3s ease;
    position: relative;
}

.document-item:hover .document-actions {
    opacity: 1;
}

.document-action {
    padding: 4px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.document-action:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #ff6b6b;
    border-color: rgba(239, 68, 68, 0.15);
    transform: scale(1.05);
}

.document-action:first-child:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Action Buttons - Much Smaller and Minimal */
.action-btn {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 11px;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 4px;
    gap: 4px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    transition: left 0.5s ease;
}

.action-btn:hover::before {
    left: 100%;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.action-btn.save {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.15);
    color: #10d876;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.08);
}

.action-btn.save:hover {
    background: rgba(16, 185, 129, 0.12);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.25);
}

.action-btn.clear {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.15);
    color: #ff6b6b;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.08);
}

.action-btn.clear:hover {
    background: rgba(239, 68, 68, 0.12);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.25);
}

.action-btn.copy {
    background: rgba(168, 85, 247, 0.08);
    border-color: rgba(168, 85, 247, 0.15);
    color: #a855f7;
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.08);
}

.action-btn.copy:hover {
    background: rgba(168, 85, 247, 0.12);
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.25);
}

.action-btn.secondary {
    background: rgba(107, 114, 128, 0.08);
    border-color: rgba(107, 114, 128, 0.15);
    color: var(--text-secondary);
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.08);
}

.action-btn.secondary:hover {
    background: rgba(107, 114, 128, 0.12);
    box-shadow: 0 4px 20px rgba(107, 114, 128, 0.15);
    border-color: rgba(107, 114, 128, 0.25);
    color: var(--text-primary);
}

/* Dropdown Styles */
.dropdown-container {
    position: relative;
    display: inline-block;
    z-index: 9999;
}

.dropdown-toggle {
    padding: 6px 8px 6px 10px !important;
}

.dropdown-arrow {
    margin-left: 3px;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.dropdown-toggle:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    box-shadow: 
        0 15px 30px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
    min-width: 160px;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 4px;
    overflow: hidden;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dropdown-item {
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.dropdown-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    transition: left 0.5s ease;
}

.dropdown-item:hover::before {
    left: 100%;
}

.dropdown-item:first-child {
    border-radius: 10px 10px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 10px 10px;
}

.dropdown-item:only-child {
    border-radius: 10px;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.dropdown-item svg {
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

/* Header Layout Updates - Smaller and Minimal */
.pane-header {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--text-secondary);
    padding: 10px 16px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 10000;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 9999;
}

/* Authentication Styles */
.auth-section {
    margin-left: auto;
}

.auth-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* User Profile Styles - Smaller */
.user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 6px 10px;
    transition: all 0.3s ease;
    position: relative;
    height: auto;
}

.user-profile:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.user-avatar {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.user-email {
    font-size: 11px;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.user-status {
    font-size: 9px;
    color: #10d876;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.user-actions {
    position: relative;
}

.user-menu-btn {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-menu-btn:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.12);
    transform: scale(1.05);
}

/* User Menu Dropdown */
.user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    box-shadow: 
        0 15px 30px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
    min-width: 220px;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.user-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.user-menu-header {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.user-menu-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.user-menu-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.user-menu-name {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.user-menu-email {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 0;
}

.user-menu-item {
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.user-menu-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    transition: left 0.5s ease;
}

.user-menu-item:hover::before {
    left: 100%;
}

.user-menu-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.user-menu-item.sign-out {
    color: #ff6b6b;
}

.user-menu-item.sign-out:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #ff5555;
}

/* Auth Button Styles - Smaller */
.auth-btn {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 11px;
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.auth-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    transition: left 0.5s ease;
}

.auth-btn:hover::before {
    left: 100%;
}

.auth-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.12);
}

.auth-btn.signed-in {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.15);
    color: #ff6b6b;
}

.auth-btn.signed-in:hover {
    background: rgba(239, 68, 68, 0.12);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.15);
}

.auth-tabs {
    display: flex;
    margin-bottom: 20px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-tab {
    flex: 1;
    padding: 8px 14px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 400;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-tab.active {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.auth-divider {
    text-align: center;
    margin: 16px 0;
    position: relative;
    color: var(--text-tertiary);
    font-size: 11px;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    z-index: 1;
}

.auth-divider span {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    padding: 0 12px;
    position: relative;
    z-index: 2;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-demo {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(15px);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn-demo::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    transition: left 0.5s ease;
}

.btn-demo:hover::before {
    left: 100%;
}

.btn-demo:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.connection-status {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 14px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 400;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.connection-status.online {
    background: rgba(16, 185, 129, 0.08);
    color: #10d876;
    border-color: rgba(16, 185, 129, 0.15);
}

.connection-status.offline {
    background: rgba(239, 68, 68, 0.08);
    color: #ff6b6b;
    border-color: rgba(239, 68, 68, 0.15);
}

.connection-status.syncing {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.08);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s infinite;
    box-shadow: 0 0 6px currentColor;
}

/* Modals - Smaller */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-header {
    padding: 16px 20px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.modal-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.modal-close {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 18px;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.12);
    transform: scale(1.05);
}

.modal-body {
    padding: 20px;
    background: rgba(255, 255, 255, 0.005);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 400;
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    font-size: 12px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
}

.form-group input::placeholder {
    color: var(--text-tertiary);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 
        0 0 0 2px rgba(255, 255, 255, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.03);
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn.primary {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn.primary:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.btn.secondary:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Category Input Container */
.category-input-container {
    display: flex;
    gap: 8px;
    align-items: center;
}

.category-input-container select {
    flex: 1;
}

.btn-new-category {
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    position: relative;
    overflow: hidden;
}

.btn-new-category::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    transition: left 0.5s ease;
}

.btn-new-category:hover::before {
    left: 100%;
}

.btn-new-category:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.new-category-input {
    margin-top: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    animation: slideDown 0.3s ease;
}

.new-category-input input {
    width: 100%;
    margin-bottom: 8px;
}

.new-category-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.btn-mini {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-mini::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    transition: left 0.5s ease;
}

.btn-mini:hover::before {
    left: 100%;
}

.btn-mini.primary {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-mini.primary:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.btn-mini.secondary {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.btn-mini.secondary:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 100px;
    }
}

.editor-pane, .preview-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    margin: 6px 0;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
    position: relative;
    overflow: hidden;
}

.editor-pane {
    margin-right: 2px;
    border-radius: 16px 0 0 16px;
}

.preview-pane {
    margin-left: 2px;
    margin-right: 6px;
    border-radius: 0 16px 16px 0;
}

.preview-pane.mobile {
    background: rgba(255, 255, 255, 0.015);
    backdrop-filter: blur(25px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.phone-frame {
    background: linear-gradient(145deg, 
        rgba(45, 55, 72, 0.9) 0%, 
        rgba(26, 32, 44, 0.9) 100%
    );
    backdrop-filter: blur(20px);
    border-radius: 40px;
    padding: 10px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    position: relative;
}

.phone-screen {
    width: 340px;
    height: 720px;
    border-radius: 35px;
    overflow: hidden;
    position: relative;
    background: #000;
    box-shadow: 
        inset 0 0 0 2px rgba(255, 255, 255, 0.03),
        0 0 15px rgba(0, 0, 0, 0.6);
}

.phone-screen iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 35px;
    transition: background-color 0.3s ease;
}

.phone-frame::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 110px;
    height: 32px;
    background: linear-gradient(135deg, #1a1a1a, #000);
    border-radius: 16px;
    z-index: 10;
    box-shadow: 
        inset 0 0 8px rgba(0, 0, 0, 0.8),
        0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Monaco Editor Dark Glassmorphism Styling */
#editor-container {
    flex: 1;
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    border-radius: 0 0 16px 0;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

/* Core Monaco Editor Background */
#editor-container .monaco-editor,
#editor-container .monaco-editor .monaco-editor-background,
#editor-container .monaco-editor .editor-container {
    background: rgba(0, 0, 0, 0.4) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}

/* Editor Scrollable Element */
#editor-container .monaco-editor .monaco-scrollable-element {
    background: transparent !important;
}

/* Main Text Area */
#editor-container .monaco-editor .view-overlays,
#editor-container .monaco-editor .view-lines,
#editor-container .monaco-editor .view-line {
    background: transparent !important;
}

/* Line Numbers Margin */
#editor-container .monaco-editor .margin,
#editor-container .monaco-editor .margin-view-overlays {
    background: rgba(0, 0, 0, 0.3) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

/* Current Line Highlight */
#editor-container .monaco-editor .current-line,
#editor-container .monaco-editor .view-overlays .current-line {
    background: rgba(255, 255, 255, 0.06) !important;
    border: none !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08) !important;
}

/* Text Selection */
#editor-container .monaco-editor .selected-text,
#editor-container .monaco-editor .view-overlays .selected-text {
    background: rgba(96, 165, 250, 0.25) !important;
    backdrop-filter: blur(3px) !important;
    -webkit-backdrop-filter: blur(3px) !important;
    border-radius: 2px !important;
    box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.3) !important;
}

/* Cursor */
#editor-container .monaco-editor .cursor,
#editor-container .monaco-editor .view-cursors .cursor {
    color: #ffffff !important;
    background: #ffffff !important;
    box-shadow: 0 0 2px rgba(255, 255, 255, 0.8) !important;
    width: 2px !important;
}

/* Line Numbers */
#editor-container .monaco-editor .line-numbers {
    color: rgba(255, 255, 255, 0.5) !important;
    font-weight: 400 !important;
}

/* Scrollbars */
#editor-container .monaco-editor .decorationsOverviewRuler,
#editor-container .monaco-editor .scroll-decoration {
    background: rgba(255, 255, 255, 0.05) !important;
}

#editor-container .monaco-scrollable-element > .scrollbar {
    background: rgba(0, 0, 0, 0.2) !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
}

#editor-container .monaco-scrollable-element > .scrollbar > .slider {
    background: rgba(255, 255, 255, 0.15) !important;
    border-radius: 4px !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

#editor-container .monaco-scrollable-element > .scrollbar > .slider:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

#editor-container .monaco-scrollable-element > .scrollbar > .slider:active {
    background: rgba(255, 255, 255, 0.35) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

/* Minimap */
#editor-container .monaco-editor .minimap,
#editor-container .monaco-editor .minimap-slider {
    background: rgba(0, 0, 0, 0.4) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
}

/* Minimap Decorations Layer - Fix white background */
#editor-container .monaco-editor .minimap .minimap-decorations-layer,
#editor-container .monaco-editor .minimap-decorations-layer {
    background: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
}

/* Minimap Canvas Background */
#editor-container .monaco-editor .minimap canvas {
    background: rgba(0, 0, 0, 0.3) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    opacity: 0.9 !important;
}

/* Minimap Slider (viewport indicator) */
#editor-container .monaco-editor .minimap-slider .minimap-slider-horizontal {
    background: rgba(96, 165, 250, 0.2) !important;
    border: 1px solid rgba(96, 165, 250, 0.4) !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
    border-radius: 2px !important;
}

/* Suggestions/Autocomplete */
#editor-container .monaco-editor .suggest-widget {
    background: rgba(0, 0, 0, 0.9) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 10px !important;
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.8),
        inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

/* Context Menu */
#editor-container .monaco-editor .context-view .monaco-menu {
    background: rgba(0, 0, 0, 0.9) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 10px !important;
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.8),
        inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

/* Find Widget */
#editor-container .monaco-editor .find-widget {
    background: rgba(0, 0, 0, 0.9) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 10px !important;
    box-shadow: 
        0 8px 30px rgba(0, 0, 0, 0.8),
        inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

/* Text Color - Make sure text is visible */
#editor-container .monaco-editor .view-line span {
    color: #f1f5f9 !important;
}

/* Enhanced Syntax Highlighting Colors for Better Visibility */
#editor-container .monaco-editor .token.tag {
    color: #7dd3fc !important;
    font-weight: 500 !important;
}

#editor-container .monaco-editor .token.attribute.name {
    color: #fcd34d !important;
    font-weight: 400 !important;
}

#editor-container .monaco-editor .token.attribute.value,
#editor-container .monaco-editor .token.string {
    color: #6ee7b7 !important;
}

#editor-container .monaco-editor .token.comment {
    color: rgba(255, 255, 255, 0.5) !important;
    font-style: italic !important;
}

#editor-container .monaco-editor .token.keyword {
    color: #f472b6 !important;
    font-weight: 500 !important;
}

#editor-container .monaco-editor .token.number {
    color: #fb7185 !important;
}

#editor-container .monaco-editor .token.punctuation {
    color: #cbd5e1 !important;
}

/* Word Highlighting (when selecting all occurrences) */
#editor-container .monaco-editor .wordHighlight {
    background: rgba(96, 165, 250, 0.15) !important;
    border: 1px solid rgba(96, 165, 250, 0.3) !important;
    border-radius: 2px !important;
}

#editor-container .monaco-editor .wordHighlightStrong {
    background: rgba(96, 165, 250, 0.25) !important;
    border: 1px solid rgba(96, 165, 250, 0.4) !important;
    border-radius: 2px !important;
}

/* Find Match Highlighting */
#editor-container .monaco-editor .findMatch {
    background: rgba(251, 191, 36, 0.3) !important;
    border: 1px solid rgba(251, 191, 36, 0.5) !important;
    border-radius: 2px !important;
}

#editor-container .monaco-editor .currentFindMatch {
    background: rgba(251, 191, 36, 0.4) !important;
    border: 2px solid rgba(251, 191, 36, 0.7) !important;
    border-radius: 2px !important;
}

/* Bracket Matching */
#editor-container .monaco-editor .bracket-match {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* Error and Warning Squiggles */
#editor-container .monaco-editor .squiggly-error {
    border-bottom: 2px wavy #ff6b6b !important;
}

#editor-container .monaco-editor .squiggly-warning {
    border-bottom: 2px wavy #fbbf24 !important;
}

#editor-container .monaco-editor .squiggly-info {
    border-bottom: 2px wavy #60a5fa !important;
}



#preview {
    flex: 1;
    width: 100%;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    transition: background-color 0.3s ease;
    border-radius: 0 0 16px 16px;
}

#preview.dark-background {
    background: #1a1a2e;
}

/* Resizer Divider - Smaller */
.divider {
    width: 1px;
    min-width: 1px;
    max-width: 1px;
    background: linear-gradient(180deg, 
        transparent 0%,
        rgba(255, 255, 255, 0.08) 25%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.08) 75%,
        transparent 100%
    );
    cursor: col-resize;
    position: relative;
    transition: all 0.3s ease;
    user-select: none;
    flex-shrink: 0;
    z-index: 10;
    margin: 6px 0;
    border-radius: 1px;
}

.divider::before {
    content: '';
    position: absolute;
    top: 0;
    left: -8px;
    right: -8px;
    bottom: 0;
    cursor: col-resize;
}

.divider:hover {
    background: linear-gradient(180deg, 
        transparent 0%,
        rgba(255, 255, 255, 0.15) 25%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 100%
    );
    width: 2px;
    min-width: 2px;
    max-width: 2px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.divider.dragging {
    background: linear-gradient(180deg, 
        transparent 0%,
        rgba(255, 255, 255, 0.2) 25%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        transparent 100%
    );
    width: 3px;
    min-width: 3px;
    max-width: 3px;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.container.resizing {
    cursor: col-resize;
}

.container.resizing * {
    pointer-events: none;
    user-select: none;
}

.container.resizing .divider {
    pointer-events: auto;
}

/* Click-to-Highlight Styles */
.element-highlight {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 4px !important;
    animation: highlightPulse 0.8s ease-in-out;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.15) !important;
}

@keyframes highlightPulse {
    0% {
        background: rgba(255, 255, 255, 0.12);
        transform: scale(1);
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
    }
    50% {
        background: rgba(255, 255, 255, 0.08);
        transform: scale(1.01);
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
    }
    100% {
        background: rgba(255, 255, 255, 0.08);
        transform: scale(1);
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.15);
    }
}

.preview-element-hover {
    outline: 2px solid rgba(255, 255, 255, 0.2) !important;
    outline-offset: 2px !important;
    cursor: pointer !important;
    transition: outline 0.3s ease !important;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.08) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        gap: 1px;
        padding: 1px;
    }
    
    .divider {
        height: 1px;
        width: 100%;
        cursor: row-resize;
        margin: 0 6px;
        border-radius: 1px;
        background: linear-gradient(90deg, 
            transparent 0%,
            rgba(255, 255, 255, 0.08) 25%,
            rgba(255, 255, 255, 0.15) 50%,
            rgba(255, 255, 255, 0.08) 75%,
            transparent 100%
        );
    }
    
    .divider:hover {
        height: 2px;
        background: linear-gradient(90deg, 
            transparent 0%,
            rgba(255, 255, 255, 0.15) 25%,
            rgba(255, 255, 255, 0.3) 50%,
            rgba(255, 255, 255, 0.15) 75%,
            transparent 100%
        );
    }
    
    .editor-pane, .preview-pane {
        margin: 0 6px;
        border-radius: 16px;
    }
    
    .pane-header {
        padding: 8px 14px;
    }
    
    .header-controls {
        flex-direction: column;
        gap: 4px;
    }
    
    .documents-sidebar {
        margin: 6px;
        border-radius: 16px;
        width: auto;
    }
    
    .user-profile {
        padding: 4px 8px;
        gap: 6px;
    }
    
    .user-avatar {
        width: 20px;
        height: 20px;
    }
    
    .user-email {
        font-size: 10px;
        max-width: 80px;
    }
    
    .user-status {
        font-size: 8px;
    }
    
    .user-menu {
        min-width: 180px;
        right: -10px;
    }
    
    .auth-btn {
        padding: 6px 12px;
        font-size: 10px;
    }
}

/* === DRAG AND DROP STYLES === */

/* Document item drag states */
.document-item[draggable="true"] {
    cursor: grab;
    transition: all 0.3s ease;
}

.document-item[draggable="true"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.document-item.dragging {
    opacity: 0.5;
    transform: rotate(2deg) scale(1.05);
    cursor: grabbing;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Drop zone states */
.category-header.drop-zone-visible {
    position: relative;
    transition: all 0.3s ease;
}

.category-header.drop-zone-visible::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, rgba(168, 85, 247, 0.1), rgba(59, 130, 246, 0.1));
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.category-header.drop-zone-active {
    background: rgba(168, 85, 247, 0.08);
    border: 2px dashed rgba(168, 85, 247, 0.4);
    border-radius: 8px;
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.2);
}

.category-header.drop-zone-active::before {
    opacity: 1;
}

.category-header.drop-zone-active .category-title {
    color: rgba(168, 85, 247, 1);
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Drop zone animations */
@keyframes dropZonePulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(168, 85, 247, 0.2);
    }
    50% {
        box-shadow: 0 4px 20px rgba(168, 85, 247, 0.4);
    }
}

.category-header.drop-zone-active {
    animation: dropZonePulse 1.5s infinite;
}

/* Enhanced document item hover effects */
.document-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.document-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.02), transparent);
    border-radius: 6px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.document-item:hover::before {
    opacity: 1;
}

/* Drag handle indicator */
.document-item[draggable="true"]::after {
    content: '⋮⋮';
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.2);
    font-size: 12px;
    line-height: 0.5;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.document-item[draggable="true"]:hover::after {
    opacity: 1;
}

/* === AI ASSISTANT STYLES === */

/* AI Assistant Toggle Button */
.ai-assistant-toggle {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: rgba(96, 165, 250, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(96, 165, 250, 0.15);
    border-radius: 12px;
    padding: 12px 8px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: 
        0 8px 25px rgba(96, 165, 250, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #60a5fa;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 50px;
    position: relative;
    overflow: hidden;
}

.ai-assistant-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.1), transparent);
    transition: left 0.6s ease;
}

.ai-assistant-toggle:hover::before {
    left: 100%;
}

.ai-assistant-toggle:hover {
    background: rgba(96, 165, 250, 0.12);
    border-color: rgba(96, 165, 250, 0.25);
    transform: translateY(-50%) scale(1.05);
    box-shadow: 
        0 12px 35px rgba(96, 165, 250, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    color: #7dd3fc;
}

.ai-assistant-toggle.active {
    background: rgba(96, 165, 250, 0.15);
    border-color: rgba(96, 165, 250, 0.3);
    color: #7dd3fc;
    box-shadow: 
        0 15px 40px rgba(96, 165, 250, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.ai-toggle-text {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* AI Assistant Panel */
.ai-assistant-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    display: flex;
    flex-direction: column;
    box-shadow: 
        -10px 0 40px rgba(0, 0, 0, 0.3),
        inset 1px 0 0 rgba(255, 255, 255, 0.03);
}

.ai-assistant-panel.open {
    transform: translateX(0);
}

.ai-panel-header {
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.ai-panel-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(96, 165, 250, 0.15) 50%, 
        transparent 100%
    );
}

.ai-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-icon {
    color: #60a5fa;
    filter: drop-shadow(0 2px 4px rgba(96, 165, 250, 0.3));
}

.ai-header-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    background: linear-gradient(135deg, #60a5fa 0%, #7dd3fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ai-panel-close {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.ai-panel-close:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #ff6b6b;
    border-color: rgba(239, 68, 68, 0.15);
    transform: scale(1.05);
}

.ai-panel-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Quick Actions */
.ai-quick-actions {
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.01);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-quick-btn {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    text-align: left;
}

.ai-quick-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    transition: left 0.5s ease;
}

.ai-quick-btn:hover::before {
    left: 100%;
}

.ai-quick-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.ai-quick-btn[data-action="explain-code"]:hover {
    background: rgba(96, 165, 250, 0.08);
    border-color: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}

.ai-quick-btn[data-action="debug-code"]:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.15);
    color: #ff6b6b;
}

.ai-quick-btn[data-action="improve-code"]:hover {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.15);
    color: #10d876;
}

/* Chat Interface */
.ai-chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.005);
}

.ai-chat-messages::-webkit-scrollbar {
    width: 4px;
}

.ai-chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.01);
    border-radius: 2px;
    margin: 6px;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.ai-welcome-message,
.ai-message {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    animation: slideInFromRight 0.5s ease-out;
}

.ai-user-message {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-direction: row-reverse;
    animation: slideInFromLeft 0.5s ease-out;
}

.ai-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1), rgba(59, 130, 246, 0.05));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #60a5fa;
    flex-shrink: 0;
    border: 1px solid rgba(96, 165, 250, 0.15);
    box-shadow: 0 4px 15px rgba(96, 165, 250, 0.1);
}

.ai-user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.ai-message-content {
    flex: 1;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.5;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.ai-user-message-content {
    flex: 1;
    background: rgba(96, 165, 250, 0.08);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(96, 165, 250, 0.15);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.5;
    box-shadow: 0 2px 10px rgba(96, 165, 250, 0.1);
}

.ai-message-content p {
    margin: 0 0 8px 0;
}

.ai-message-content p:last-child {
    margin-bottom: 0;
}

.ai-message-content ul,
.ai-message-content ol {
    margin: 8px 0;
    padding-left: 16px;
}

.ai-message-content li {
    margin-bottom: 4px;
}

.ai-message-content code {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
    font-size: 11px;
    color: #7dd3fc;
}

.ai-message-content pre {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 12px;
    margin: 8px 0;
    overflow-x: auto;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
    font-size: 12px;
    color: #f1f5f9;
}

/* Chat Input */
.ai-chat-input-container {
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ai-context-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    padding: 6px 10px;
    background: rgba(96, 165, 250, 0.08);
    border: 1px solid rgba(96, 165, 250, 0.15);
    border-radius: 6px;
    font-size: 11px;
    color: #60a5fa;
    animation: slideInFromBottom 0.3s ease-out;
}

.ai-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

#aiChatInput {
    flex: 1;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.4;
    resize: none;
    transition: all 0.3s ease;
    font-family: inherit;
    min-height: 40px;
    max-height: 120px;
}

#aiChatInput::placeholder {
    color: var(--text-tertiary);
}

#aiChatInput:focus {
    outline: none;
    border-color: rgba(96, 165, 250, 0.15);
    box-shadow: 
        0 0 0 2px rgba(96, 165, 250, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.03);
}

.ai-send-btn {
    background: rgba(96, 165, 250, 0.08);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(96, 165, 250, 0.15);
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    color: #60a5fa;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    position: relative;
    overflow: hidden;
}

.ai-send-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.1), transparent);
    transition: left 0.5s ease;
}

.ai-send-btn:hover::before {
    left: 100%;
}

.ai-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.06);
    color: var(--text-tertiary);
}

.ai-send-btn:enabled:hover {
    background: rgba(96, 165, 250, 0.12);
    border-color: rgba(96, 165, 250, 0.25);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(96, 165, 250, 0.15);
}

/* AI Loading Overlay */
.ai-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.ai-loading-content {
    text-align: center;
    color: var(--text-primary);
}

.ai-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(96, 165, 250, 0.2);
    border-top: 3px solid #60a5fa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 12px;
}

.ai-loading-content p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

/* AI Explain Tooltip */
.ai-explain-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(96, 165, 250, 0.15);
    border-radius: 8px;
    padding: 4px;
    z-index: 10000;
    animation: fadeInScale 0.2s ease-out;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.ai-tooltip-btn {
    background: rgba(96, 165, 250, 0.08);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(96, 165, 250, 0.15);
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 11px;
    color: #60a5fa;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    white-space: nowrap;
}

.ai-tooltip-btn:hover {
    background: rgba(96, 165, 250, 0.12);
    border-color: rgba(96, 165, 250, 0.25);
    transform: scale(1.05);
}

/* Animations */
@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive Design for AI Assistant */
@media (max-width: 768px) {
    .ai-assistant-panel {
        width: 100%;
        max-width: 350px;
    }
    
    .ai-assistant-toggle {
        right: 15px;
        padding: 10px 6px;
        min-width: 45px;
    }
    
    .ai-quick-actions,
    .ai-chat-input-container {
        padding: 12px 16px;
    }
    
    .ai-chat-messages {
        padding: 12px 16px;
    }
    
    .ai-panel-header {
        padding: 12px 16px;
    }
}

/* AI Setup Components */
.ai-setup-notice {
    padding: 16px;
    background: rgba(96, 165, 250, 0.05);
    border: 1px solid rgba(96, 165, 250, 0.1);
    border-radius: 8px;
    margin: 8px 0;
}

.ai-setup-notice h4 {
    margin: 0 0 8px 0;
    color: #60a5fa;
    font-size: 14px;
    font-weight: 600;
}

.ai-setup-notice p {
    margin: 8px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.ai-setup-notice ul {
    margin: 8px 0;
    padding-left: 16px;
}

.ai-setup-notice li {
    margin-bottom: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.ai-setup-notice a {
    color: #60a5fa;
    text-decoration: none;
    transition: color 0.3s ease;
}

.ai-setup-notice a:hover {
    color: #7dd3fc;
    text-decoration: underline;
}

.ai-setup-btn {
    background: rgba(96, 165, 250, 0.08);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(96, 165, 250, 0.15);
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 12px;
    color: #60a5fa;
    transition: all 0.3s ease;
    font-weight: 500;
    margin-top: 12px;
}

.ai-setup-btn:hover {
    background: rgba(96, 165, 250, 0.12);
    border-color: rgba(96, 165, 250, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(96, 165, 250, 0.15);
}

/* AI Assistant Styles */
.ai-assistant-panel {
    position: fixed;
    right: -450px;
    top: 80px;
    width: 450px;
    height: calc(100vh - 100px);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px 0 0 12px;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
    transition: right 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ai-assistant-panel.open {
    right: 0;
}

.ai-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
}

.ai-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-header-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.ai-icon {
    color: #6366f1;
}

.ai-header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-settings-btn {
    background: transparent;
    border: none;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-settings-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #374151;
}

.ai-settings-btn.active {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.ai-panel-close {
    background: transparent;
    border: none;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-panel-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* AI Settings Section */
.ai-settings-section {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(248, 250, 252, 0.8);
}

.ai-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.ai-settings-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.ai-connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9ca3af;
    transition: background-color 0.2s ease;
}

.status-indicator.connected {
    background: #10b981;
}

.status-indicator.error {
    background: #ef4444;
}

.status-text {
    color: #6b7280;
    font-weight: 500;
}

.ai-settings-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-provider-select label,
.ai-api-key-section label,
.ai-custom-endpoint-section label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.ai-provider-select select,
.ai-custom-endpoint-section input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ai-provider-select select:focus,
.ai-custom-endpoint-section input:focus,
.api-key-input-group input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.api-key-input-group {
    display: flex;
    align-items: center;
    position: relative;
}

.api-key-input-group input {
    flex: 1;
    padding: 10px 12px;
    padding-right: 44px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: monospace;
}

.api-key-toggle {
    position: absolute;
    right: 8px;
    background: transparent;
    border: none;
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.api-key-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #374151;
}

.ai-help-text {
    color: #6b7280;
    font-size: 12px;
    margin-top: 4px;
}

.ai-help-text a {
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
}

.ai-help-text a:hover {
    text-decoration: underline;
}

.ai-custom-endpoint-section {
    transition: all 0.3s ease;
}

.ai-settings-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.ai-save-btn,
.ai-test-btn,
.ai-clear-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
}

.ai-save-btn {
    background: #6366f1;
    color: white;
    flex: 1;
}

.ai-save-btn:hover {
    background: #5855eb;
}

.ai-save-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.ai-test-btn {
    background: #10b981;
    color: white;
    flex: 1;
}

.ai-test-btn:hover {
    background: #059669;
}

.ai-test-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.ai-clear-btn {
    background: transparent;
    color: #6b7280;
    border: 1px solid #d1d5db;
    padding: 8px 12px;
}

.ai-clear-btn:hover {
    background: rgba(239, 68, 68, 0.05);
    color: #ef4444;
    border-color: #ef4444;
}

.ai-settings-info {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-radius: 6px;
    padding: 12px;
    margin-top: 16px;
}

.ai-settings-info p {
    margin: 0 0 8px 0;
    font-size: 12px;
    color: #1e40af;
    font-weight: 500;
}

.ai-settings-info ul {
    margin: 0;
    padding-left: 16px;
    font-size: 12px;
    color: #1e40af;
}

.ai-settings-info li {
    margin-bottom: 2px;
}

.ai-panel-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ai-quick-actions {
    display: flex;
    gap: 8px;
    padding: 20px 24px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.ai-quick-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
    font-size: 11px;
    font-weight: 500;
    text-align: center;
}

.ai-quick-btn:hover {
    background: rgba(99, 102, 241, 0.05);
    border-color: rgba(99, 102, 241, 0.2);
    color: #6366f1;
}

.ai-quick-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ai-chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ai-chat-messages {
    flex: 1;
    padding: 20px 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-welcome-message,
.ai-message {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.ai-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.ai-message-content {
    flex: 1;
    background: rgba(248, 250, 252, 0.8);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
}

.ai-message-content p {
    margin: 0 0 8px 0;
}

.ai-message-content p:last-child {
    margin-bottom: 0;
}

.ai-message-content ul {
    margin: 8px 0;
    padding-left: 16px;
}

.ai-message-content li {
    margin-bottom: 4px;
}

.user-message {
    justify-content: flex-end;
}

.user-message .ai-message-content {
    background: #6366f1;
    color: white;
    max-width: 80%;
}

.ai-chat-input-container {
    padding: 16px 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.9);
}

.ai-context-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6366f1;
    margin-bottom: 8px;
    padding: 4px 8px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 4px;
    width: fit-content;
}

.ai-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.ai-input-wrapper textarea {
    flex: 1;
    min-height: 40px;
    max-height: 120px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    resize: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ai-input-wrapper textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.ai-send-btn {
    width: 40px;
    height: 40px;
    background: #6366f1;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.ai-send-btn:hover {
    background: #5855eb;
    transform: translateY(-1px);
}

.ai-send-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.ai-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.ai-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.ai-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ai-loading-content p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
}

/* AI Assistant Toggle Button */
.ai-assistant-toggle {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
    transition: all 0.3s ease;
    z-index: 999;
    font-size: 0;
}

.ai-assistant-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(99, 102, 241, 0.5);
}

.ai-assistant-toggle.panel-open {
    background: #ef4444;
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

.ai-assistant-toggle.panel-open:hover {
    box-shadow: 0 12px 35px rgba(239, 68, 68, 0.5);
}

.ai-toggle-text {
    font-size: 12px;
    font-weight: 600;
    margin-left: 4px;
}

/* AI Explain Tooltip */
.ai-explain-tooltip {
    position: absolute;
    background: #1f2937;
    color: white;
    padding: 8px;
    border-radius: 6px;
    font-size: 12px;
    z-index: 2000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

.ai-tooltip-btn {
    background: #6366f1;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    pointer-events: auto;
}

.ai-tooltip-btn:hover {
    background: #5855eb;
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .ai-assistant-panel {
        width: 100%;
        right: -100%;
        border-radius: 0;
        top: 60px;
        height: calc(100vh - 60px);
    }
    
    .ai-assistant-toggle {
        bottom: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
    }
    
    .ai-settings-actions {
        flex-direction: column;
    }
    
    .ai-save-btn,
    .ai-test-btn {
        flex: none;
    }
}

/* Animation for settings section */
.ai-settings-section {
    transition: all 0.3s ease;
    max-height: 500px;
    overflow: hidden;
}

.ai-settings-section.collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}