/* Enhanced CSS with better organization and new features */

:root {
    /* Enhanced 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;
    
    /* Social Colors */
    --color-google: #db4437;
    --color-microsoft: #0078d4;
    --color-facebook: #1877f2;
    
    /* New UI Colors */
    --color-background: #f8fafc;
    --color-background-alt: #f1f5f9;
    --color-border: #e2e8f0;
    --color-text: #1e293b;
    --color-text-secondary: #64748b;
    
    /* Enhanced Dimensions */
    --size-menu-height: 3.5rem;
    --size-toolbar-height: 3rem;
    --size-sidebar-width: 17.5rem;
    
    /* New 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);
    
    /* New 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);
    
    /* New 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;
}

/* Dark mode enhancements */
@media (prefers-color-scheme: dark) {
    :root {
        --color-background: #0f172a;
        --color-background-alt: #1e293b;
        --color-border: #334155;
        --color-text: #f8fafc;
        --color-text-secondary: #94a3b8;
        
        --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);
    }
}

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

.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); }
}

/* Enhanced Auth Container */
.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);
}

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

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

/* Enhanced Form Styles */
.password-group {
    position: relative;
}

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

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

.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);
}

.show-password:hover {
    color: var(--color-primary);
    background-color: var(--color-background-alt);
}

/* Enhanced Error Handling */
.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;
}

.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);
}

.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;
    }
}

/* Responsive Improvements */
@media (max-width: 640px) {
    .auth-wrapper {
        padding: 1.5rem;
        border-radius: var(--radius-lg);
    }
    
    .social-auth {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    .auth-container, .app-header, .sidebar, .toolbar, .logger {
        display: none !important;
    }
    
    .app-content {
        display: block !important;
    }
    
    .vtk-container {
        height: auto !important;
        page-break-after: always;
    }
}