/* IMS.UI - Enhanced Common Styles */

/* Root Variables */
:root {
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-300: #93c5fd;
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-800: #1e40af;
    --primary-900: #1e3a8a;
    
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    /* Enhanced spacing and sizing */
    --border-radius: 0.75rem;
    --border-radius-lg: 1rem;
    --border-radius-xl: 1.5rem;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

/* Dark Mode Variables */
.dark {
    --gray-50: #111827;
    --gray-100: #1f2937;
    --gray-200: #374151;
    --gray-300: #4b5563;
    --gray-400: #6b7280;
    --gray-500: #9ca3af;
    --gray-600: #d1d5db;
    --gray-700: #e5e7eb;
    --gray-800: #f3f4f6;
    --gray-900: #f9fafb;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.4);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.4), 0 8px 10px -6px rgb(0 0 0 / 0.4);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.5);
}

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--gray-900);
    background-color: var(--gray-50);
    transition: color 0.3s ease, background-color 0.3s ease;
}

.dark body {
    color: var(--gray-100);
    background-color: var(--gray-900);
}

/* Glass Effect */
.glass-effect {
    backdrop-filter: blur(16px) saturate(180%);
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.125);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-2xl);
    position: relative;
    overflow: hidden;
}

.glass-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.dark .glass-effect {
    background: rgba(17, 24, 39, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dark .glass-effect::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

/* Background Patterns */
.bg-pattern {
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(147, 51, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
    background-size: 400px 400px, 300px 300px, 500px 500px;
    background-position: 0% 0%, 100% 100%, 50% 50%;
    animation: bgFloat 20s ease-in-out infinite;
}

@keyframes bgFloat {
    0%, 100% { background-position: 0% 0%, 100% 100%, 50% 50%; }
    50% { background-position: 100% 100%, 0% 0%, 25% 75%; }
}

.dark .bg-pattern {
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(147, 51, 234, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.03) 0%, transparent 50%);
}

/* Gradient Backgrounds */
.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-primary {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
}

.gradient-hero {
    background: linear-gradient(135deg, 
        rgba(59, 130, 246, 0.1) 0%, 
        rgba(147, 51, 234, 0.1) 50%, 
        rgba(16, 185, 129, 0.1) 100%);
}

.dark .gradient-hero {
    background: linear-gradient(135deg, 
        rgba(59, 130, 246, 0.05) 0%, 
        rgba(147, 51, 234, 0.05) 50%, 
        rgba(16, 185, 129, 0.05) 100%);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes bounceSubtle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

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

.animate-fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.animate-slide-up {
    animation: slideUp 0.5s ease-out;
}

.animate-bounce-subtle {
    animation: bounceSubtle 0.6s ease-in-out;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Form Styles */
.form-input {
    display: block !important;
    width: 100% !important;
    padding: 0.875rem 1rem !important;
    border: 1px solid var(--gray-300) !important;
    border-radius: var(--border-radius) !important;
    background-color: white !important;
    color: var(--gray-900) !important;
    font-size: 0.875rem !important;
    line-height: 1.25rem !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: var(--shadow-sm) !important;
    position: relative !important;
}

/* Validation State Transitions */
.form-input.error,
.form-input.success {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Icon styles removed - will be added back later */

.form-input::placeholder {
    color: var(--gray-500) !important;
}

.form-input:focus {
    outline: none !important;
    border-color: var(--primary-500) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
    transform: translateY(-1px) !important;
}

.form-input:focus-visible {
    outline: 2px solid var(--primary-500) !important;
    outline-offset: 2px !important;
}

.form-input.error {
    border-color: var(--error) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
    background-color: rgba(239, 68, 68, 0.02) !important;
}

.form-input.error:focus {
    border-color: var(--error) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
    background-color: rgba(239, 68, 68, 0.03) !important;
}

.form-input.success {
    border-color: var(--success) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
    background-color: rgba(16, 185, 129, 0.02) !important;
}

.form-input.success:focus {
    border-color: var(--success) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
    background-color: rgba(16, 185, 129, 0.03) !important;
}

.dark .form-input.error {
    background-color: rgba(239, 68, 68, 0.05) !important;
    border-color: #f87171 !important;
}

.dark .form-input.error:focus {
    background-color: rgba(239, 68, 68, 0.08) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

.dark .form-input.success {
    background-color: rgba(16, 185, 129, 0.05) !important;
    border-color: #34d399 !important;
}

.dark .form-input.success:focus {
    background-color: rgba(16, 185, 129, 0.08) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2) !important;
}

.dark .form-input {
    background-color: var(--gray-800) !important;
    border-color: var(--gray-600) !important;
    color: var(--gray-100) !important;
}

.dark .form-input::placeholder {
    color: var(--gray-400) !important;
}

.dark .form-input:focus {
    border-color: var(--primary-400) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    line-height: 1.25rem;
}

.dark .form-label {
    color: var(--gray-300);
}

.form-error {
    color: var(--error);
    font-size: 0.75rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    background-color: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.1);
    border-radius: var(--border-radius);
    animation: slideDown 0.3s ease-out;
}

.form-error::before {
    content: '⚠';
    font-size: 0.875rem;
    color: var(--error);
    flex-shrink: 0;
}

.form-success {
    color: var(--success);
    font-size: 0.75rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    background-color: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.1);
    border-radius: var(--border-radius);
    animation: slideDown 0.3s ease-out;
}

.form-success::before {
    content: '✓';
    font-size: 0.875rem;
    color: var(--success);
    flex-shrink: 0;
}

.dark .form-error {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.dark .form-success {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 100px;
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

.form-input.error {
    animation: shake 0.5s ease-in-out;
}

/* Enhanced Focus States for Validation */
.form-input.error:focus {
    transform: translateY(-1px) scale(1.01);
}

.form-input.success:focus {
    transform: translateY(-1px) scale(1.01);
}

/* Loading State */
.form-input.loading {
    background-image: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
    color: white;
    border-color: var(--primary-600);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-700) 0%, var(--primary-800) 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background-color: white;
    color: var(--gray-700);
    border-color: var(--gray-300);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--gray-50);
    border-color: var(--gray-400);
    transform: translateY(-1px);
}

.dark .btn-secondary {
    background-color: var(--gray-800);
    color: var(--gray-300);
    border-color: var(--gray-600);
}

.dark .btn-secondary:hover:not(:disabled) {
    background-color: var(--gray-700);
    border-color: var(--gray-500);
}

.btn-danger {
    background-color: var(--error);
    color: white;
    border-color: var(--error);
}

.btn-danger:hover:not(:disabled) {
    background-color: #dc2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

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

.btn-success:hover:not(:disabled) {
    background-color: #059669;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-full {
    width: 100%;
}

/* Card Styles */
.card {
    @apply bg-white dark:bg-gray-800 rounded-lg shadow-lg border border-gray-200 dark:border-gray-700;
}

.card-header {
    @apply px-6 py-4 border-b border-gray-200 dark:border-gray-700;
}

.card-body {
    @apply px-6 py-4;
}

.card-footer {
    @apply px-6 py-4 border-t border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900;
}

/* Navigation Styles */
.navbar {
    @apply bg-white dark:bg-gray-800 shadow-lg border-b border-gray-200 dark:border-gray-700;
}

.navbar-brand {
    @apply text-xl font-bold text-gray-900 dark:text-white hover:text-primary-600 transition-colors duration-200;
}

.navbar-nav {
    @apply flex space-x-8;
}

.navbar-link {
    @apply text-gray-500 dark:text-gray-300 hover:text-primary-600 dark:hover:text-primary-400 px-3 py-2 rounded-md text-sm font-medium transition-colors duration-200;
}

.navbar-link.active {
    @apply text-primary-600 dark:text-primary-400 bg-primary-50 dark:bg-primary-900/20;
}

/* Alert Styles */
.alert {
    @apply px-4 py-3 rounded-lg border;
}

.alert-success {
    @apply alert bg-green-50 dark:bg-green-900/20 border-green-200 dark:border-green-800 text-green-800 dark:text-green-200;
}

.alert-error {
    @apply alert bg-red-50 dark:bg-red-900/20 border-red-200 dark:border-red-800 text-red-800 dark:text-red-200;
}

.alert-warning {
    @apply alert bg-yellow-50 dark:bg-yellow-900/20 border-yellow-200 dark:border-yellow-800 text-yellow-800 dark:text-yellow-200;
}

.alert-info {
    @apply alert bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800 text-blue-800 dark:text-blue-200;
}

/* Sidebar Styles */
.sidebar-link {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.75rem 1rem;
    margin-bottom: 0.25rem;
    border-radius: var(--border-radius);
    color: var(--gray-600);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    position: relative;
}

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

.sidebar-link.active {
    background-color: var(--primary-50);
    color: var(--primary-600);
    font-weight: 600;
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: var(--primary-600);
    border-radius: 0 2px 2px 0;
}

.sidebar-link i {
    width: 1.25rem;
    margin-right: 0.75rem;
    text-align: center;
}

.dark .sidebar-link {
    color: var(--gray-300);
}

.dark .sidebar-link:hover {
    background-color: var(--gray-700);
    color: var(--gray-100);
}

.dark .sidebar-link.active {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--primary-400);
}

/* Sidebar Groups */
.sidebar-group {
    margin-bottom: 0.5rem;
}

.group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.75rem 1rem;
    margin-bottom: 0.25rem;
    border-radius: var(--border-radius);
    color: var(--gray-600);
    background: none;
    border: none;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.group-toggle:hover {
    background-color: var(--gray-100);
    color: var(--gray-900);
}

.group-arrow {
    transition: transform 0.2s ease-in-out;
    font-size: 0.75rem;
}

.group-arrow.rotate-180 {
    transform: rotate(180deg);
}

.dark .group-toggle {
    color: var(--gray-300);
}

.dark .group-toggle:hover {
    background-color: var(--gray-700);
    color: var(--gray-100);
}

/* Sidebar Submenu */
.sidebar-submenu {
    margin-left: 1rem;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
}

.sidebar-sublink {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.5rem 1rem;
    margin-bottom: 0.125rem;
    border-radius: var(--border-radius);
    color: var(--gray-500);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 400;
    transition: all 0.2s ease-in-out;
    position: relative;
}

.sidebar-sublink:hover {
    background-color: var(--gray-100);
    color: var(--gray-700);
}

.sidebar-sublink i {
    width: 1rem;
    margin-right: 0.5rem;
    text-align: center;
    font-size: 0.75rem;
}

.dark .sidebar-sublink {
    color: var(--gray-400);
}

.dark .sidebar-sublink:hover {
    background-color: var(--gray-700);
    color: var(--gray-200);
}

.sidebar-sublink.active {
    background-color: var(--primary-50);
    color: var(--primary-600);
    font-weight: 600;
}

.sidebar-sublink.active::before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 60%;
    background-color: var(--primary-600);
    border-radius: 2px;
}

.dark .sidebar-sublink.active {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--primary-400);
}

.dark .sidebar-sublink.active::before {
    background-color: var(--primary-400);
}

/* Active parent group when child is active */
.group-toggle.has-active-child {
    color: var(--primary-600);
    font-weight: 600;
}

.dark .group-toggle.has-active-child {
    color: var(--primary-400);
}

/* Search Input */
.search-input {
    width: 16rem;
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    background-color: white;
    color: var(--gray-900);
    font-size: 0.875rem;
    transition: all 0.2s ease-in-out;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.dark .search-input {
    background-color: var(--gray-800);
    border-color: var(--gray-600);
    color: var(--gray-100);
}

.dark .search-input:focus {
    border-color: var(--primary-400);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Responsive Sidebar */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .search-input {
        width: 12rem;
    }
}

@media (max-width: 640px) {
    .search-input {
        width: 8rem;
    }
}

/* Toast Styles */
.toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    max-width: 400px;
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    color: white;
    font-weight: 500;
    font-size: 0.875rem;
    line-height: 1.25rem;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.8);
}

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

.toast.hide {
    transform: translateX(100%);
}

.toast.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.9), rgba(5, 150, 105, 0.9));
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.toast.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.9), rgba(220, 38, 38, 0.9));
    border-color: rgba(239, 68, 68, 0.3);
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.3);
}

.toast.warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.9), rgba(217, 119, 6, 0.9));
    border-color: rgba(245, 158, 11, 0.3);
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.3);
}

.toast.info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.9), rgba(2, 132, 199, 0.9));
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

/* Loading Spinner */
.spinner {
    @apply animate-spin rounded-full border-2 border-gray-300 border-t-primary-600;
}

.spinner-sm {
    @apply spinner h-4 w-4;
}

.spinner-md {
    @apply spinner h-6 w-6;
}

.spinner-lg {
    @apply spinner h-8 w-8;
}

/* Password Strength Indicator */
.password-strength {
    @apply flex space-x-1 mt-2;
}

.password-strength-bar {
    @apply h-1 w-full rounded transition-colors duration-200;
}

.password-strength-bar.weak {
    @apply bg-red-500;
}

.password-strength-bar.fair {
    @apply bg-yellow-500;
}

.password-strength-bar.good {
    @apply bg-green-500;
}

.password-strength-bar.strong {
    @apply bg-green-600;
}

/* Theme Toggle */
.theme-toggle {
    @apply p-2 rounded-lg bg-gray-100 dark:bg-gray-700 text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-all duration-300 hover:scale-110;
}

/* Responsive Utilities */
@media (max-width: 640px) {
    .mobile-hidden {
        display: none;
    }
    
    .mobile-full {
        width: 100%;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}

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

.focus-visible {
    @apply focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2;
}

/* Code and Keyboard Elements */
code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    background-color: var(--gray-100);
    color: var(--gray-800);
    border: 1px solid var(--gray-200);
}

.dark code {
    background-color: var(--gray-800);
    color: var(--gray-200);
    border-color: var(--gray-600);
}

kbd {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.75rem;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    background-color: var(--gray-200);
    color: var(--gray-800);
    border: 1px solid var(--gray-300);
    box-shadow: inset 0 -1px 0 var(--gray-300);
}

.dark kbd {
    background-color: var(--gray-700);
    color: var(--gray-200);
    border-color: var(--gray-600);
    box-shadow: inset 0 -1px 0 var(--gray-600);
}

/* Enhanced Input Icons */
.input-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 1rem;
    pointer-events: none;
    transition: color 0.2s ease;
}

.form-input:focus + .input-icon,
.form-input:focus ~ .input-icon {
    color: var(--primary-500);
}

.dark .input-icon {
    color: var(--gray-500);
}

.dark .form-input:focus + .input-icon,
.dark .form-input:focus ~ .input-icon {
    color: var(--primary-400);
}

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

::-webkit-scrollbar-track {
    background-color: var(--gray-100);
}

.dark ::-webkit-scrollbar-track {
    background-color: var(--gray-800);
}

::-webkit-scrollbar-thumb {
    background-color: var(--gray-300);
    border-radius: 9999px;
}

.dark ::-webkit-scrollbar-thumb {
    background-color: var(--gray-600);
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--gray-400);
}

.dark ::-webkit-scrollbar-thumb:hover {
    background-color: var(--gray-500);
}

/* Sidebar Scrollbar */
#sidebar nav::-webkit-scrollbar {
    width: 6px;
}

#sidebar nav::-webkit-scrollbar-track {
    background-color: transparent;
}

#sidebar nav::-webkit-scrollbar-thumb {
    background-color: var(--gray-300);
    border-radius: 9999px;
}

.dark #sidebar nav::-webkit-scrollbar-thumb {
    background-color: var(--gray-600);
}

#sidebar nav::-webkit-scrollbar-thumb:hover {
    background-color: var(--gray-400);
}

.dark #sidebar nav::-webkit-scrollbar-thumb:hover {
    background-color: var(--gray-500);
}

/* Smooth scrolling for sidebar */
#sidebar nav {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--gray-300) transparent;
    position: relative;
}

.dark #sidebar nav {
    scrollbar-color: var(--gray-600) transparent;
}

/* Sidebar fade effects */
#sidebar nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
    pointer-events: none;
    z-index: 10;
}

#sidebar nav::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to top, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
    pointer-events: none;
    z-index: 10;
}

.dark #sidebar nav::before {
    background: linear-gradient(to bottom, rgba(31, 41, 55, 1), rgba(31, 41, 55, 0));
}

.dark #sidebar nav::after {
    background: linear-gradient(to top, rgba(31, 41, 55, 1), rgba(31, 41, 55, 0));
}

/* Override Tailwind validation styles */
input.form-input.error,
input.form-input.success,
input.form-input.loading {
    border-width: 1px !important;
    border-style: solid !important;
}

/* Ensure our validation styles take precedence */
.form-input.error {
    border-color: #ef4444 !important;
    background-color: rgba(239, 68, 68, 0.02) !important;
}

.form-input.success {
    border-color: #10b981 !important;
    background-color: rgba(16, 185, 129, 0.02) !important;
}

.dark .form-input.error {
    border-color: #f87171 !important;
    background-color: rgba(239, 68, 68, 0.05) !important;
}

.dark .form-input.success {
    border-color: #34d399 !important;
    background-color: rgba(16, 185, 129, 0.05) !important;
}
