:root {
    /* Color Scheme */
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-primary-light: #dbeafe;
    --color-secondary: #525252;
    --color-accent: #3b82f6;
    --color-success: #16a34a;
    --color-warning: #f59e0b;
    --color-danger: #dc2626;
    --color-info: #0284c7;
    --color-background: #f8fafc;
    --color-background-alt: #f1f5f9;
    --color-border: #e2e8f0;
    --color-text: #1e293b;
    --color-text-secondary: #64748b;

    /* Grayscale */
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-400: #9ca3af;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;
    --color-gray-800: #1f2937;
    --color-gray-900: #111827;
    --color-white: #ffffff;
    --color-black: #000000;

    /* Social Colors */
    --color-google: #db4437;
    --color-microsoft: #0078d4;
    --color-facebook: #1877f2;
    
    /* UI Colors */
    --color-menu-bg: #1e1e2d;
    --color-menu-hover: #2a2a3a;
    --color-menu-border: #3a3a4a;
    --color-menu-text: rgba(255, 255, 255, 0.95);
    
    /* Dimensions */
    --size-menu-height: 3.5rem;
    --size-toolbar-height: 3rem;
    --size-sidebar-width: 17.5rem;
    
    /* Transitions */
    --transition-speed-fast: 0.15s;
    --transition-speed: 0.25s;
    --transition-speed-slow: 0.4s;
    --transition-easing: cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    
    /* Border Radius */
    --radius-xs: 0.125rem;
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    --radius-2xl: 1rem;
    --radius-full: 9999px;
    
    /* Z-index */
    --z-index-menu: 1000;
    --z-index-submenu: 1010;
    --z-index-modal: 1050;
}

@media (prefers-color-scheme: dark) {
    :root {
        --color-gray-50: #111827;
        --color-gray-100: #1f2937;
        --color-gray-200: #374151;
        --color-gray-300: #4b5563;
        --color-gray-400: #6b7280;
        --color-gray-500: #9ca3af;
        --color-gray-600: #d1d5db;
        --color-gray-700: #e5e7eb;
        --color-gray-800: #f3f4f6;
        --color-gray-900: #f9fafb;
        --color-white: #1e1e2d;
        --color-black: #ffffff;
        
        --color-background: #0f172a;
        --color-background-alt: #1e293b;
        --color-border: #334155;
        --color-text: #f8fafc;
        --color-text-secondary: #94a3b8;

        --color-menu-bg: #111827;
        --color-menu-hover: #1e293b;
        --color-menu-border: #334155;

        --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);        
    }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    display: none; /* Start hidden */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.loading-overlay.visible {
    display: flex;
    opacity: 1;
}

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

.loading-spinner {
    width: 3rem;
    height: 3rem;
    border: 4px solid var(--color-primary-light);
    border-top-color: var(--color-primary);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.loading-message {
    color: var(--color-text);
    font-size: 1.1rem;
    font-weight: 500;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Modern CSS Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    min-height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--color-gray-800);
    background-color: var(--color-white);
    line-height: 1.5;
    font-size: 0.875rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Accessibility classes */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Layout */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* Header */
.app-header {
    display: flex;
    align-items: center;
    background: var(--color-menu-bg);
    color: var(--color-menu-text);
    height: var(--size-menu-height);
    padding: 0 1rem;
    box-shadow: var(--shadow-md);
    z-index: var(--z-index-menu);
    user-select: none;
    position: relative;
}

.logo-image {
    height: 0.5rem;
    margin-right: 0.75rem;
}

.app-logo {
    display: flex;
    align-items: center;
    margin-right: 1.5rem;
    gap: 0.5rem;
}

.app-title {
    font-weight: 500;
    font-size: 0.9375rem;
    white-space: nowrap;
    letter-spacing: 0.015625rem;
    color: var(--color-white);
}

.app-version {
    font-size: 0.6875rem;
    opacity: 0.8;
    margin-left: 0.25rem;
    font-weight: 400;
}


/* Menu Bar - Enhanced hover states */
.menu-bar {
    display: flex;
    flex-grow: 1;
    height: 100%;
    position: relative;
}

.menu-item {
    position: relative;
    padding: 0 16px;
    height: 100%;
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 13px;
    transition: all var(--transition-speed) var(--transition-easing);
    font-weight: 500;
    letter-spacing: 0.15px;
}

.menu-item:hover {
    background-color: var(--color-menu-hover);
}

/* Submenu System - More polished appearance */
.submenu {
    position: absolute;
    min-width: 220px;
    background-color: var(--color-menu-bg);
    border: 1px solid var(--color-menu-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    display: none;
    z-index: var(--z-index-submenu);
    padding: 6px 0;
    animation: fadeIn var(--transition-speed) var(--transition-easing);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.menu-item > .submenu {
    top: 100%;
    left: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.submenu .submenu {
    left: 100%;
    top: 0;
    margin-left: 2px;
}

.has-submenu::after {
    content: "▸";
    margin-left: auto;
    padding-left: 20px;
}

.submenu-item {
    padding: 8px 16px;
    display: flex;
    gap: 12px;
    opacity: 1;
    cursor: pointer;
    align-items: center;
    transition: all var(--transition-speed) var(--transition-easing);
    position: relative;
    color: var(--color-menu-text);
    font-size: 13px;
}

.disabled, .toolbar-btn:disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

.submenu-item:hover {
    background-color: var(--color-menu-hover);
}


/* Show submenu on hover and focus */
.menu-item:hover > .submenu,
.menu-item:focus-within > .submenu,
.submenu-item.has-submenu:hover > .submenu,
.submenu-item.has-submenu:focus-within > .submenu {
    display: block;
}

/* Icons - Consistent icon sizing */
.menu-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: inherit;
}

.menu-separator {
    height: 1px;
    background-color: var(--color-menu-border);
    margin: 6px 0;
    border: none;
}

.shortcut {
    margin-left: auto;
    padding-left: 16px;
    color: var(--color-gray-400);
    font-size: 11px;
    font-family: 'Roboto Mono', monospace;
}

/* User Controls - More compact and aligned */
.user-controls {
    display: flex;
    align-items: center;
    margin-left: auto;
    gap: 12px;
    padding-left: 16px;
}

.user-status, .server-status {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--color-gray-300);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background-color: var(--color-success);
}

.server-status .status-indicator {
    background-color: var(--color-accent);
}

/* Button Styles - More modern buttons */
.btn {
    padding: 8px 16px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all var(--transition-speed) var(--transition-easing);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    line-height: 1;
    user-select: none;
}

.app-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.vtk-container {
    flex: 1;
    position: relative;
    min-height: 500px;
    background-color: white;
    overflow: hidden;
}

#vtkContainer {
    width: 100%;
    height: 100%;
    background-color: white;
    border-left: 2px solid #333;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background-color: var(--color-primary-dark);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--color-gray-300);
    color: var(--color-gray-700);
}

.btn-outline:hover {
    background-color: var(--color-gray-50);
    border-color: var(--color-gray-400);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

/* Toolbar Styles */
.toolbar-container {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    background-color: var(--white);
    border-bottom: 1px solid var(--medium-gray);
    z-index: var(--z-index-toolbar);
}

.toolbar-container::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    flex-wrap: wrap;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        rgba(0,0,0,0) 0%, 
        rgba(0,0,0,0.1) 20%, 
        rgba(0,0,0,0.1) 80%, 
        rgba(0,0,0,0) 100%);
    box-shadow: 0 1px 1px rgba(255,255,255,0.3);
}

.toolbar {
    display: flex;
    flex-wrap: wrap; 
    gap: 8px; /* Space between groups */
    padding: 8px;
    align-items: center;
    min-height: var(--toolbar-height);
}

.toolbar::-webkit-scrollbar {
    display: none;
}

.toolbar-group {
    display: flex;
    flex-wrap: wrap; 
    align-items: center;
    padding-right: 12px;
    border-right: 1px solid var(--medium-gray);
    gap: 4px; /* Space between buttons */
}

.toolbar-group img {
    width: 24px;
    height: 24px;
}

.toolbar-group:after {
    content: "";
    position: absolute;
    right: 0;
    top: 10%;
    height: 80%;
    width: 1px;
    background-color: var(--color-gray-200);
}

.toolbar-group:last-child {
    border-right: none;
}

.toolbar-group:last-child:after {
    display: none;
}

.toolbar-btn {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed) var(--transition-easing);
    color: var(--color-gray-700);
    position: relative;
}

.toolbar-btn:hover {
    background-color: var(--color-gray-100);
    color: var(--color-primary);
}

.toolbar-btn:active {
    transform: scale(0.95);
}

.toolbar-btn.active {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
}

.toolbar-btn img, .toolbar-btn svg {
    width: 18px;
    height: 18px;
}

.tooltip {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--color-gray-800);
    color: white;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    white-space: nowrap;
    visibility: hidden;
    opacity: 0;
    transition: opacity var(--transition-speed);
    z-index: var(--z-index-submenu);
    pointer-events: none;
    box-shadow: var(--shadow-sm);
}

.toolbar-btn:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

/* Main Content - Improved layout */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
    background-color: var(--color-white);
}

/* Sidebar Styles - More professional appearance */
.sidebar {
    width: var(--size-sidebar-width);
    background-color: var(--color-white);
    border-right: 1px solid var(--color-gray-200);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width var(--transition-speed) var(--transition-easing);
    z-index: 800;
}

.sidebar-collapsed {
    width: 48px;
}

.sidebar-header {
    padding: 12px 16px;
    font-weight: 600;
    border-bottom: 1px solid var(--color-gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--color-white);
    user-select: none;
    color: var(--color-gray-800);
}

.sidebar-controls {
    display: flex;
    gap: 4px;
}

.sidebar-btn {
    background: none;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-gray-600);
    font-size: 12px;
    transition: all var(--transition-speed) var(--transition-easing);
}

.sidebar-btn:hover {
    background-color: var(--color-gray-100);
    color: var(--color-gray-900);
}

.project-explorer {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.tree-view {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tree-item {
    padding: 6px 16px 6px 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all var(--transition-speed) var(--transition-easing);
    position: relative;
    user-select: none;
    color: var(--color-gray-700);
    font-size: 13px;
}

.tree-item:hover {
    background-color: var(--color-gray-50);
}

.tree-item.active {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    font-weight: 500;
}

.tree-item i {
    margin-right: 8px;
    color: var(--color-gray-500);
    font-size: 14px;
    width: 16px;
    text-align: center;
}

.tree-item.active i {
    color: var(--color-primary);
}

.tree-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tree-actions {
    display: none;
    margin-left: auto;
    gap: 4px;
}

.tree-item:hover .tree-actions {
    display: flex;
}

.tree-btn {
    background: none;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-gray-500);
    font-size: 12px;
    transition: all var(--transition-speed) var(--transition-easing);
}

.tree-btn:hover {
    background-color: var(--color-gray-200);
    color: var(--color-gray-700);
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--color-gray-200);
    font-size: 12px;
    color: var(--color-gray-600);
    background-color: var(--color-gray-50);
}

.disk-usage {
    margin-top: 8px;
}

.usage-bar {
    height: 6px;
    background-color: var(--color-gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 4px;
}

.usage-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

/* Auth Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
  
.modal.active {
    opacity: 1;
    visibility: visible;
}
  
.modal-content {
    background-color: var(--color-white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 450px;
    padding: 2rem;
    position: relative;
    box-shadow: var(--shadow-xl);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}
  
.modal.active .modal-content {
    transform: translateY(0);
}
  
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-gray-500);
}

/* Auth Container Styles */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
    background-color: var(--color-background);
    background-image: linear-gradient(135deg, var(--color-background) 0%, var(--color-background-alt) 100%);
}

.auth-wrapper {
    width: 100%;
    max-width: 28rem;
    background: var(--color-white);
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.auth-wrapper:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-2xl);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-tagline {
    color: var(--color-text-secondary);
    margin-top: 0.5rem;
    font-size: 1.1rem;
    font-weight: 400;
}

.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--color-gray-200);
    margin-bottom: 0.75rem; /* Reduced from 1.5rem */
}

.auth-tab {
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    font-weight: 500;
    color: var(--color-gray-500);
    cursor: pointer;
    position: relative;
    margin-bottom: -1px;
    font-size: 0.9rem;
}

.auth-tab.active {
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-primary);
}
 
.auth-tab.active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-primary);
}
  
.auth-form {
    display: none;
}
  
.auth-form.active {
    display: block;
}
  
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--color-gray-700);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-md);
    font-size: 1rem;
}
  
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.forgot-password {
    font-size: 0.875rem;
    color: var(--color-primary);
    text-decoration: none;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--color-gray-600);
}

.auth-footer a {
    color: var(--color-primary);
    text-decoration: none;
}

.user-dropdown {
    position: relative;
    display: inline-block;
    margin-left: 8px;
    cursor: pointer;
}

.user-dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: var(--color-white);
    min-width: 200px;
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-md);
    padding: 12px;
    z-index: var(--z-index-submenu);
    border: 1px solid var(--color-border);
}

.user-email, .user-organization, .user-plan {
    padding: 4px 0;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

#accountSettings {
    width: 100%;
    text-align: left;
    padding: 4px 0;
    margin-top: 8px;
    border-top: 1px solid var(--color-border);
}

.show-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-speed-fast);
}

.password-group {
    position: relative;
}

.password-input-container {
    position: relative;
}

.password-input-container input {
    padding-right: 2.5rem;
}


.show-password:hover {
    color: var(--color-primary);
    background-color: var(--color-background-alt);
}
  
.btn-block {
    width: 100%;
}
  
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
}

.wide-form {
    margin: 0 auto;
    padding: 2rem;
}

.auth-message-container {
    margin-bottom: 1.5rem;
    min-height: 3rem;
}

.auth-message {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    animation: slideIn 0.3s ease-out;
}

.auth-message.error {
    background-color: rgba(220, 38, 38, 0.1);
    color: var(--color-danger);
    border-left: 3px solid var(--color-danger);
    padding: 12px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease-out;
}

.auth-message.success {
    background-color: rgba(22, 163, 74, 0.1);
    color: var(--color-success);
    border-left: 3px solid var(--color-success);
}

.auth-message.warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
    border-left: 3px solid var(--color-warning);
}

.auth-message i {
    margin-right: 0.5rem;
}

/* Social Auth Buttons */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--color-text-secondary);
    font-size: 0.875rem;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background-color: var(--color-border);
    margin: 0 1rem;
}

.social-auth {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: all var(--transition-speed);
}

.btn-google {
    background-color: var(--color-google);
    color: white;
}

.btn-google:hover {
    background-color: #c1351d;
}

.btn-microsoft {
    background-color: var(--color-microsoft);
    color: white;
}

.btn-microsoft:hover {
    background-color: #106ebe;
}

/* Button Loading State */
.btn-spinner {
    display: none;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-full);
    border-top-color: white;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

.btn.loading .btn-text {
    opacity: 0;
}

.btn.loading .btn-spinner {
    display: block;
}

/* Animation */
@keyframes slideIn {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#registerForm {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 8px; /* Prevent scrollbar overlap */
}

#registerForm.wide-form {
    padding: 1rem;
    margin: 0 auto;
}

.form-error {
    color: var(--color-danger);
    font-size: 0.75rem;
    margin-top: 0.25rem;
    height: 1rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.form-error.show {
    opacity: 1;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-section {
    padding: 1rem;
    background: var(--color-background-alt);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}


.form-section-title {
    font-size: 1.1rem;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-border);
}

/* Enhanced Form Controls */
.custom-select {
    position: relative;
}

.custom-select select {
    appearance: none;
    width: 100%;
    padding: 0.8rem;
    border: 2px solid var(--color-border);
    border-radius: 6px;
    background-color: white;
}

.custom-select::after {
    content: "⌄";
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.password-strength {
    position: relative;
}

.strength-meter {
    height: 3px;
    background: var(--color-border);
    margin-top: 0.5rem;
    transition: all 0.3s ease;
}

.password-requirements {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
}

.password-requirements li {
    display: flex;
    align-items: center;
}

.password-requirements li::before {
    content: "◯";
    font-size: 0.8rem;
}

.password-requirements li[data-requirement="met"]::before {
    content: "✔";
    color: var(--color-success);
}

/* Terms Styling */
.terms-group {
    margin: 1rem 0;
    padding: 0.75rem;
    font-size: 0.875rem;
}

.terms-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.terms-link {
    color: var(--color-primary);
    text-decoration: underline;
    transition: color 0.2s ease;
}

.terms-link:hover {
    color: var(--color-primary-dark);
}


/* Responsive improvements */
@media (max-width: 768px) {
    .sidebar {
        position: absolute;
        left: 0;
        top: var(--size-menu-height);
        bottom: 0;
        z-index: var(--z-index-modal);
        box-shadow: var(--shadow-lg);
    }
    
    .sidebar-collapsed {
        transform: translateX(-100%);
    }

    .toolbar {
        gap: 4px;
        flex-wrap: wrap;
        padding: 4px;
    }
    .toolbar-group {
        padding-right: 8px;
        gap: 2px;
        flex-wrap: wrap;
    }    

    .wide-form {
        padding: 1rem;
        max-width: 95%;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }    
}



.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 1rem;
    position: relative;
}

.form-group label {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    display: block;
}

.form-group input,
.custom-select select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-light);
}

.show-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-gray-500);
    cursor: pointer;
    padding: 0.5rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.checkbox-container input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
}

.forgot-password {
    font-size: 0.875rem;
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-password:hover {
    text-decoration: underline;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--color-gray-600);
}

.auth-footer a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.auth-error {
    color: var(--color-danger);
    background-color: rgba(220, 38, 38, 0.1);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-align: center;
}

.auth-success {
    color: var(--color-success);
    background-color: rgba(22, 163, 74, 0.1);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-align: center;
}

@media (max-width: 480px) {
    .auth-container {
        padding: 1rem;
    }
    
    .auth-wrapper {
        padding: 1.5rem;
    }
    
    .auth-tab {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
}

@media (forced-colors: active) {
    .disabled {
        color: GrayText;
    }
}

/* Animation for smoother transitions */
@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}