/* Base styles */
@layer base {
    body {
        @apply antialiased;
    }

    ::selection {
        @apply bg-primary-500 text-white;
    }
}

/* Navigation */
.nav-link {
    @apply px-3 py-2 rounded-lg text-sm font-medium transition-colors duration-200 text-gray-700 hover:text-gray-900 hover:bg-gray-100 dark:text-gray-300 dark:hover:text-white dark:hover:bg-dark-700;
}

.mobile-nav-link {
    @apply flex items-center px-3 py-2 rounded-lg text-base font-medium transition-colors duration-200 text-gray-700 hover:text-gray-900 hover:bg-gray-100 dark:text-gray-300 dark:hover:text-white dark:hover:bg-dark-700;
}

/* Buttons */
.btn-primary {
    @apply inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-lg shadow-lg text-white 
           bg-gradient-to-r from-primary-600 to-purple-600 hover:from-primary-700 hover:to-purple-700
           focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 
           transition-all duration-200 transform hover:scale-105 hover:shadow-xl;
}

.btn-secondary {
    @apply inline-flex items-center px-4 py-2 text-sm font-medium rounded-lg transition-all duration-150 backdrop-blur-sm;
    @apply bg-gray-100 text-gray-900 hover:bg-gray-200;
    @apply dark:bg-dark-700/50 dark:text-white dark:hover:bg-dark-600/50;
}

/* Dropdown */
.dropdown-menu {
    @apply backdrop-blur-sm shadow-lg ring-1 ring-black ring-opacity-5 transition-all duration-200 py-1 z-50;
    @apply bg-white/95 border border-gray-200;
    @apply dark:bg-dark-800/95 dark:border-dark-700;
}

.dropdown-item {
    @apply block w-full px-4 py-2 text-sm text-left transition-colors duration-200;
    @apply text-gray-700 hover:text-gray-900 hover:bg-gray-50;
    @apply dark:text-gray-300 dark:hover:text-white dark:hover:bg-gray-800;
}

/* Cards */
.card {
    @apply backdrop-blur-sm rounded-lg shadow-xl overflow-hidden hover:shadow-2xl transition-all duration-300;
    @apply bg-white/50 border border-gray-200/50;
    @apply dark:bg-dark-800/50 dark:border-dark-700/50;
}

.card-header {
    @apply px-4 py-5 sm:px-6 transition-colors duration-200;
    @apply border-b border-gray-200/50 bg-gray-50/30;
    @apply dark:border-dark-700/50 dark:bg-dark-900/30;
}

.card-body {
    @apply px-4 py-5 sm:p-6;
}

.card-footer {
    @apply px-4 py-4 sm:px-6 transition-colors duration-200;
    @apply border-t border-gray-200/50 bg-gray-50/30;
    @apply dark:border-dark-700/50 dark:bg-dark-900/30;
}

/* Forms */
.form-label {
    @apply block text-sm font-medium mb-1 transition-colors duration-200;
    @apply text-gray-700 dark:text-gray-300;
}

.form-input {
    @apply mt-1 block w-full rounded-lg shadow-sm focus:ring-primary-500 sm:text-sm backdrop-blur-sm transition-all duration-150;
    @apply bg-white/50 border-gray-300 text-gray-900 placeholder-gray-500;
    @apply dark:bg-dark-800/50 dark:border-dark-700 dark:text-white dark:placeholder-gray-500;
}

.form-select {
    @apply mt-1 block w-full rounded-lg shadow-sm focus:ring-primary-500 sm:text-sm backdrop-blur-sm transition-all duration-150;
    @apply bg-white/50 border-gray-300 text-gray-900;
    @apply dark:bg-dark-800/50 dark:border-dark-700 dark:text-white;
}

/* Enhanced dropdown styling for better theme integration */
select {
    @apply cursor-pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

.dark select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%9ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
}

/* Option styling for better contrast */
select option {
    @apply py-2 px-3;
    background-color: white;
    color: #1f2937;
}

.dark select option {
    background-color: #1f2937 !important;
    color: white !important;
}

/* Specific styling for the plan type dropdown */
select[name="plan_type"],
select[id*="plan_type"] {
    @apply font-medium;
}

select[name="plan_type"] option,
select[id*="plan_type"] option {
    @apply font-medium py-3 px-4;
}

.form-checkbox {
    @apply h-4 w-4 rounded text-primary-600 focus:ring-primary-500 transition-all duration-150;
    @apply bg-white/50 border-gray-300;
    @apply dark:bg-dark-800/50 dark:border-dark-700;
}

.form-radio {
    @apply h-4 w-4 text-primary-600 focus:ring-primary-500 transition-all duration-150;
    @apply bg-white/50 border-gray-300;
    @apply dark:bg-dark-800/50 dark:border-dark-700;
}

/* Alerts - High specificity overrides */
main .alert,
main div.alert {
    width: auto !important;
    max-width: 400px !important;
    margin: 0 auto 1.5rem auto !important;
    padding: 0.875rem 1rem !important;
    border-radius: 1rem !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    position: relative !important;
    transition: all 0.3s ease !important;
}

.dark main .alert,
.dark main div.alert {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%) !important;
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
}

main .alert-success,
main div.alert-success {
    color: #374151 !important;
}

.dark main .alert-success,
.dark main div.alert-success {
    color: #d1d5db !important;
}

main .alert-success .fas.fa-check-circle,
main div.alert-success .fas.fa-check-circle {
    color: #3b82f6 !important;
}

.dark main .alert-success .fas.fa-check-circle,
.dark main div.alert-success .fas.fa-check-circle {
    color: #60a5fa !important;
}

main .alert-danger,
main div.alert-danger {
    color: #b91c1c !important;
}

.dark main .alert-danger,
.dark main div.alert-danger {
    color: #fca5a5 !important;
}

main .alert-danger .fas.fa-exclamation-circle,
main div.alert-danger .fas.fa-exclamation-circle {
    color: #ef4444 !important;
}

.dark main .alert-danger .fas.fa-exclamation-circle,
.dark main div.alert-danger .fas.fa-exclamation-circle {
    color: #f87171 !important;
}

/* Alert container styling */
main .mb-8.space-y-4 {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
}

/* Tables */
.table-container {
    @apply relative rounded-lg overflow-hidden backdrop-blur-sm transition-colors duration-200;
    @apply bg-white/50 dark:bg-dark-800/50;
}

.table {
    @apply min-w-full divide-y transition-colors duration-200;
    @apply divide-gray-200 dark:divide-dark-700;
}

.table th {
    @apply px-6 py-3 text-left text-xs font-medium uppercase tracking-wider backdrop-blur-sm transition-colors duration-200;
    @apply text-gray-500 bg-gray-50/50 dark:text-gray-400 dark:bg-dark-900/50;
}

.table td {
    @apply px-6 py-4 whitespace-nowrap text-sm transition-colors duration-200;
    @apply text-gray-900 dark:text-white;
}

.table tbody {
    @apply divide-y transition-colors duration-200;
    @apply divide-gray-200 dark:divide-dark-700;
}

.table tbody tr {
    @apply transition-colors duration-200;
    @apply hover:bg-gray-50/50 dark:hover:bg-dark-700/50;
}

/* Stats */
.stat-card {
    @apply px-6 py-5 backdrop-blur-sm rounded-lg overflow-hidden shadow-lg hover:shadow-xl transition-all duration-300;
    @apply bg-white/50 dark:bg-dark-800/50;
}

.stat-title {
    @apply text-sm font-medium truncate transition-colors duration-200;
    @apply text-gray-500 dark:text-gray-400;
}

.stat-value {
    @apply mt-2 text-3xl font-bold tracking-tight transition-colors duration-200;
    @apply text-gray-900 dark:text-white;
}

.stat-desc {
    @apply mt-2 text-sm transition-colors duration-200;
    @apply text-gray-500 dark:text-gray-400;
}

/* Progress bars */
.progress-bar {
    @apply overflow-hidden rounded-full backdrop-blur-sm transition-colors duration-200;
    @apply bg-gray-200 dark:bg-dark-700;
}

.progress-bar-fill {
    @apply bg-gradient-to-r from-primary-600 to-purple-600 h-2 rounded-full transition-all duration-300 shadow-lg shadow-primary-500/20;
}

/* Badges */
.badge {
    @apply inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium shadow-sm backdrop-blur-sm;
}

.badge-primary {
    @apply bg-gradient-to-r from-primary-50 to-purple-50 text-primary-800 border border-primary-200/20;
    @apply dark:from-primary-900/30 dark:to-purple-900/30 dark:text-primary-400 dark:border-primary-500/20;
}

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

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

.badge-danger {
    @apply bg-red-50/30 text-red-800 border border-red-200/20;
    @apply dark:bg-red-900/30 dark:text-red-400 dark:border-red-500/20;
}

/* Charts */
.chart-container {
    @apply backdrop-blur-sm rounded-lg p-4 shadow-lg transition-colors duration-200;
    @apply bg-white/50 dark:bg-dark-800/50;
}

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

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

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

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

/* Loading states */
.loading {
    @apply relative pointer-events-none opacity-75;
}

.loading::after {
    content: '';
    @apply absolute inset-0 flex items-center justify-center;
}

.loading::after {
    content: '';
    @apply h-5 w-5 animate-spin rounded-full border-2 border-r-transparent transition-colors duration-200;
    @apply border-gray-900 dark:border-white;
}

/* Mobile Optimizations */
@media (max-width: 640px) {
    .card {
        @apply rounded-none border-x-0;
    }

    .table-container {
        @apply -mx-4 rounded-none border-x-0;
    }
}

/* Custom Scrollbar */
@media (min-width: 640px) {
    ::-webkit-scrollbar {
        @apply w-2 h-2;
    }

    ::-webkit-scrollbar-track {
        @apply bg-gray-100 dark:bg-dark-800;
    }

    ::-webkit-scrollbar-thumb {
        @apply rounded-full bg-gray-300 hover:bg-gray-400 dark:bg-dark-600 dark:hover:bg-dark-500;
    }
}

/* Workout-specific Styles */
.exercise-card {
    @apply card hover:transform hover:scale-[1.02] transition-all duration-300;
}

.set-row {
    @apply flex items-center space-x-4 py-3 transition-colors duration-200 last:border-0;
    @apply border-b border-gray-200 dark:border-dark-700;
}

.weight-input {
    @apply form-input w-24;
}

.reps-input {
    @apply form-input w-20;
}

/* Calculator-specific Styles */
.plate-grid {
    @apply grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4;
}

.plate-item {
    @apply flex items-center justify-between p-4 backdrop-blur-sm rounded-lg transition-all duration-150;
    @apply bg-white/50 dark:bg-dark-800/50;
}

/* Progress Tracking Styles */
.chart-legend {
    @apply flex flex-wrap gap-4 mt-4;
}

.legend-item {
    @apply flex items-center space-x-2 text-sm;
    @apply text-gray-600 dark:text-gray-400;
}

.legend-color {
    @apply w-3 h-3 rounded-full;
}

/* Glass Effect */
.glass {
    @apply backdrop-blur-sm shadow-lg transition-colors duration-200;
    @apply bg-white/50 dark:bg-dark-800/50;
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 25%, #9333ea 75%, #7c3aed 100%);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: smooth-text-gradient 8s ease-in-out infinite;
}

.gradient-text-light {
    background: linear-gradient(135deg, #60a5fa 0%, #93c5fd 25%, #a855f7 75%, #c084fc 100%);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: smooth-text-gradient 10s ease-in-out infinite;
}

.gradient-text-subtle {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 20%, #6366f1 40%, #9333ea 60%, #7c3aed 80%, #2563eb 100%);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: ultra-smooth-text 12s ease-in-out infinite;
}

.gradient-bg {
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 50%, #9333ea 100%);
}

.gradient-bg-light {
    background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 25%, #faf5ff 75%, #fdf4ff 100%);
}

.dark .gradient-bg-light {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 25%, #581c87 75%, #4c1d95 100%);
}

.gradient-bg-subtle {
    background: linear-gradient(
        135deg,
        rgba(59, 130, 246, 0.12) 0%,
        rgba(99, 102, 241, 0.10) 25%,
        rgba(147, 51, 234, 0.08) 50%,
        rgba(99, 102, 241, 0.10) 75%,
        rgba(59, 130, 246, 0.12) 100%
    );
    background-size: 400% 400%;
    animation: gentle-bg-shift 15s ease-in-out infinite;
}

.gradient-border {
    @apply border border-transparent bg-gradient-to-r from-primary-500 to-purple-600;
    background-clip: padding-box;
}

.gradient-shadow {
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.3), 0 10px 10px -5px rgba(147, 51, 234, 0.1);
}

.dark .gradient-shadow {
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.4), 0 10px 10px -5px rgba(147, 51, 234, 0.2);
}

.gradient-animated {
    background: linear-gradient(90deg, #2563eb 0%, #9333ea 50%, #2563eb 100%);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: gradient-x 6s ease infinite;
}

.gradient-bg-animated {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(147, 51, 234, 0.05) 100%);
}

.gradient-border-animated {
    background: linear-gradient(90deg, #2563eb, #9333ea, #2563eb);
    background-size: 300% 300%;
    animation: gradient-x 6s ease infinite;
}

/* Icon gradient colors for consistent theming */
.icon-gradient {
    background: linear-gradient(135deg, #2563eb 0%, #9333ea 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* Button Gradients */
.btn-gradient {
    @apply inline-flex items-center justify-center text-sm font-medium text-white transition-all duration-300 transform hover:scale-105 backdrop-blur-sm border border-transparent focus:outline-none focus:ring-2 focus:ring-primary-300 focus:ring-offset-2 dark:focus:ring-offset-dark-800;
    padding: 0.5rem 1rem !important; /* Override any padding classes */
    background: linear-gradient(135deg, #2563eb 0%, #9333ea 100%) !important;
    border-radius: 0.75rem !important; /* 12px rounded-xl */
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.4), 0 4px 6px -2px rgba(37, 99, 235, 0.3);
    text-align: center;
    white-space: nowrap;
    /* Improve visibility in light mode */
    color: white !important;
}

.btn-gradient:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #7c3aed 100%) !important;
    box-shadow: 0 20px 25px -5px rgba(37, 99, 235, 0.5), 0 10px 10px -5px rgba(37, 99, 235, 0.4);
    transform: translateY(-2px) scale(1.05);
}

.btn-gradient:active {
    transform: translateY(-1px) scale(1.02);
}

.btn-gradient.btn-sm {
    @apply text-xs;
    padding: 0.375rem 0.75rem !important; /* Override any padding classes */
    border-radius: 0.5rem !important; /* 8px rounded-lg */
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3), 0 2px 4px -1px rgba(37, 99, 235, 0.2);
}

/* Subtle action buttons - Updated to match main gradient buttons better */
.btn-action-yellow {
    @apply inline-flex items-center justify-center text-sm font-medium transition-all duration-300 transform hover:scale-105 backdrop-blur-sm border border-transparent focus:outline-none focus:ring-2 focus:ring-yellow-300 focus:ring-offset-2 dark:focus:ring-offset-dark-800;
    padding: 0.375rem 0.75rem !important; /* Override any padding classes */
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important; /* More vibrant yellow gradient */
    border-radius: 0.75rem !important; /* 12px rounded-xl */
    text-align: center;
    white-space: nowrap;
    color: white !important;
    box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.3), 0 2px 4px -1px rgba(245, 158, 11, 0.2);
}

.btn-action-yellow:hover {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    box-shadow: 0 10px 15px -3px rgba(245, 158, 11, 0.4), 0 4px 6px -2px rgba(245, 158, 11, 0.3);
    transform: translateY(-1px) scale(1.05);
}

.btn-action-primary {
    @apply inline-flex items-center justify-center text-sm font-medium transition-all duration-300 transform hover:scale-105 backdrop-blur-sm border border-transparent focus:outline-none focus:ring-2 focus:ring-primary-300 focus:ring-offset-2 dark:focus:ring-offset-dark-800;
    padding: 0.375rem 0.75rem !important; /* Override any padding classes */
    background: linear-gradient(135deg, #2563eb 0%, #9333ea 100%) !important; /* Match main gradient */
    border-radius: 0.75rem !important; /* 12px rounded-xl */
    text-align: center;
    white-space: nowrap;
    color: white !important;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3), 0 2px 4px -1px rgba(37, 99, 235, 0.2);
}

.btn-action-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #7c3aed 100%) !important;
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.4), 0 4px 6px -2px rgba(37, 99, 235, 0.3);
    transform: translateY(-1px) scale(1.05);
}

.btn-gradient-outline {
    @apply inline-flex items-center justify-center text-sm font-medium border-2 border-transparent bg-gradient-to-r from-primary-600 to-purple-600;
    background-clip: padding-box;
    padding: 0.5rem 1rem !important; /* Override any padding classes */
    border-radius: 0.75rem !important; /* 12px rounded-xl */
    text-align: center;
    white-space: nowrap;
    @apply text-primary-600 hover:text-white hover:shadow-lg transition-all duration-300 transform hover:scale-105 backdrop-blur-sm;
}

/* Icon button styling for consistency */
.btn-icon {
    @apply inline-flex items-center justify-center transition-all duration-300 transform hover:scale-105 backdrop-blur-sm focus:outline-none focus:ring-2 focus:ring-primary-300 focus:ring-offset-2 dark:focus:ring-offset-dark-800;
    padding: 0.5rem !important;
    border-radius: 0.5rem !important; /* 8px rounded-lg */
    text-align: center;
}

.btn-icon-primary {
    @apply text-primary-600 hover:text-primary-500 dark:text-primary-400 dark:hover:text-primary-300;
    background: rgba(37, 99, 235, 0.1) !important;
    @apply hover:bg-primary-100 dark:hover:bg-primary-900/30;
}

.btn-icon-gray {
    @apply text-gray-600 hover:text-gray-500 dark:text-gray-400 dark:hover:text-gray-300;
    background: rgba(107, 114, 128, 0.1) !important;
    @apply hover:bg-gray-100 dark:hover:bg-gray-800/50;
}

/* Hover Effects */
.hover-lift {
    @apply transition-all duration-300 ease-out;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                filter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    @apply -translate-y-1 shadow-xl;
    filter: brightness(1.02) saturate(1.05);
}

.hover-glow {
    @apply transition-all duration-300 hover:shadow-lg;
    @apply hover:shadow-primary-500/20 dark:hover:shadow-primary-500/10;
}

.hover-interactive {
    @apply transition-all duration-300 ease-out;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                filter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-interactive:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 
                0 0 0 1px rgba(99, 102, 241, 0.1),
                0 0 20px rgba(59, 130, 246, 0.3);
    background: linear-gradient(
        135deg, 
        rgba(99, 102, 241, 0.08) 0%, 
        rgba(147, 51, 234, 0.06) 50%, 
        rgba(168, 85, 247, 0.08) 100%
    ) !important;
    border-color: rgba(99, 102, 241, 0.2) !important;
    filter: brightness(1.03) saturate(1.1);
}

.dark .hover-interactive:hover {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4), 
                0 0 0 1px rgba(99, 102, 241, 0.2),
                0 0 25px rgba(59, 130, 246, 0.4);
    background: linear-gradient(
        135deg, 
        rgba(99, 102, 241, 0.15) 0%, 
        rgba(147, 51, 234, 0.12) 50%, 
        rgba(168, 85, 247, 0.15) 100%
    ) !important;
    border-color: rgba(99, 102, 241, 0.3) !important;
}

/* Focus Styles */
.focus-ring {
    @apply focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500;
    @apply dark:focus:ring-offset-dark-900;
}

/* Dark Mode Overrides */
.dark .prose {
    @apply text-gray-300;
}

.dark .prose a {
    @apply text-primary-400;
}

.dark .prose strong {
    @apply text-white;
}

.dark .prose h1, 
.dark .prose h2, 
.dark .prose h3, 
.dark .prose h4 {
    @apply text-white;
}

/* Transitions */
.transition-base {
    @apply transition-all duration-200 ease-in-out;
}

/* Grid Layouts */
.grid-cards {
    @apply grid gap-4 sm:gap-6 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3;
}

.grid-stats {
    @apply grid gap-4 sm:gap-6 grid-cols-2 lg:grid-cols-4;
}

/* Custom styles */
@keyframes drift-across {
    0% {
        transform: translateX(-50vw) translateY(0vh) scale(0.8);
    }
    25% {
        transform: translateX(25vw) translateY(-30vh) scale(1.2);
    }
    50% {
        transform: translateX(100vw) translateY(20vh) scale(0.9);
    }
    75% {
        transform: translateX(75vw) translateY(-10vh) scale(1.1);
    }
    100% {
        transform: translateX(150vw) translateY(40vh) scale(0.7);
    }
}

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

@keyframes gradient {
    0%, 100% {
        background-size: 200% 200%;
        background-position: left center;
    }
    50% {
        background-size: 200% 200%;
        background-position: right center;
    }
}

@keyframes drift-slow {
    0%, 100% { 
        transform: translateX(0px) translateY(0px) rotate(var(--rotation, 0deg)) scale(1); 
    }
    25% { 
        transform: translateX(15px) translateY(-10px) rotate(calc(var(--rotation, 0deg) + 5deg)) scale(1.05); 
    }
    50% { 
        transform: translateX(-10px) translateY(-20px) rotate(calc(var(--rotation, 0deg) - 3deg)) scale(0.95); 
    }
    75% { 
        transform: translateX(-20px) translateY(10px) rotate(calc(var(--rotation, 0deg) + 8deg)) scale(1.02); 
    }
}

@keyframes shimmer {
    0%, 100% { 
        opacity: 0.1; 
        transform: translateY(0px) scale(1, 1); 
    }
    25% { 
        opacity: 0.3; 
        transform: translateY(-10px) scale(1, 1.1); 
    }
    50% { 
        opacity: 0.5; 
        transform: translateY(-15px) scale(1, 0.9); 
    }
    75% { 
        opacity: 0.2; 
        transform: translateY(-5px) scale(1, 1.05); 
    }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-drift-across {
    animation: drift-across 60s linear infinite;
}

.animate-gradient {
    animation: gradient 15s ease infinite;
}

.animate-drift-slow {
    animation: drift-slow 25s ease-in-out infinite;
}

.animate-shimmer {
    animation: shimmer 12s ease-in-out infinite;
}

/* Modal and Popup Base Styles */
.modal-overlay {
    @apply fixed inset-0 z-50 overflow-y-auto;
}

.modal-backdrop {
    @apply fixed inset-0 bg-gray-500 bg-opacity-75 dark:bg-gray-900 dark:bg-opacity-80 transition-opacity backdrop-blur-sm;
}

.modal-container {
    @apply flex items-center justify-center min-h-screen px-4 pt-4 pb-20 text-center sm:p-0;
}

.modal-content {
    @apply relative bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl shadow-xl max-w-2xl w-full overflow-hidden;
}

.modal-header {
    @apply px-6 py-4 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900;
}

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

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

.dropdown-overlay {
    @apply relative;
}

.dropdown-content {
    @apply absolute right-0 mt-2 bg-white dark:bg-gray-800 rounded-xl shadow-lg border border-gray-200 dark:border-gray-600 z-10 backdrop-blur-sm;
}

/* Consistent transitions for all popups */
.popup-enter {
    @apply transition ease-out duration-200;
}

.popup-enter-start {
    @apply opacity-0;
}

.popup-enter-end {
    @apply opacity-100;
}

.popup-leave {
    @apply transition ease-in duration-150;
}

.popup-leave-start {
    @apply opacity-100;
}

.popup-leave-end {
    @apply opacity-0;
}

.modal-enter {
    @apply transition ease-out duration-200;
}

.modal-enter-start {
    @apply opacity-0 transform scale-95;
}

.modal-enter-end {
    @apply opacity-100 transform scale-100;
}

.modal-leave {
    @apply transition ease-in duration-150;
}

.modal-leave-start {
    @apply opacity-100 transform scale-100;
}

.modal-leave-end {
    @apply opacity-0 transform scale-95;
}

/* App-style Tab Navigation */
.tab-link {
    @apply flex items-center space-x-2 px-4 py-2 rounded-xl text-sm font-medium;
    @apply text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-200;
    @apply hover:bg-gray-200/70 dark:hover:bg-dark-600/70 transition-all duration-200;
}

.tab-link.active {
    @apply bg-gradient-to-r from-primary-600 to-purple-600 text-white shadow-md;
}

.mobile-tab-link {
    @apply text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-200;
    @apply transition-all duration-200;
}

.mobile-tab-link.active {
    @apply text-primary-600 dark:text-primary-400;
}

.mobile-tab-link.active i {
    @apply bg-gradient-to-r from-primary-600 to-purple-600 bg-clip-text text-transparent;
}

/* Progress Bars */
.progress-gradient {
    background: linear-gradient(135deg, #2563eb 0%, #9333ea 100%);
}

.progress-animated {
    background: linear-gradient(
        90deg,
        #3b82f6 0%,
        #6366f1 25%,
        #9333ea 50%,
        #7c3aed 75%,
        #3b82f6 100%
    );
    background-size: 300% 300%;
    animation: smooth-progress 4s ease-in-out infinite;
}

@keyframes smooth-progress {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Card Enhancements */
.card-gradient {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.8) 100%);
    @apply border border-gray-200/50 dark:border-gray-700/50;
}

.dark .card-gradient {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.8) 100%);
}

.card-gradient-subtle {
    background: linear-gradient(
        135deg, 
        rgba(239, 246, 255, 0.90) 0%, 
        rgba(224, 242, 254, 0.95) 25%,
        rgba(238, 242, 255, 0.90) 50%, 
        rgba(224, 242, 254, 0.95) 75%,
        rgba(239, 246, 255, 0.90) 100%
    );
    @apply border border-blue-200/50 dark:border-blue-700/50;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.dark .card-gradient-subtle {
    background: linear-gradient(
        135deg, 
        rgba(30, 27, 75, 0.90) 0%, 
        rgba(49, 46, 129, 0.95) 25%,
        rgba(88, 28, 135, 0.90) 50%, 
        rgba(49, 46, 129, 0.95) 75%,
        rgba(30, 27, 75, 0.90) 100%
    );
}

.card-gradient-moving {
    position: relative;
    overflow: hidden;
    background: linear-gradient(
        135deg,
        rgba(239, 246, 255, 0.95) 0%,
        rgba(224, 242, 254, 0.98) 25%,
        rgba(238, 242, 255, 0.95) 50%,
        rgba(224, 242, 254, 0.98) 75%,
        rgba(239, 246, 255, 0.95) 100%
    );
    background-size: 400% 400%;
    @apply border border-blue-200/60 dark:border-blue-700/60;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: fluid-gradient 20s ease-in-out infinite;
}

.dark .card-gradient-moving {
    background: linear-gradient(
        135deg,
        rgba(30, 27, 75, 0.95) 0%,
        rgba(49, 46, 129, 0.98) 25%,
        rgba(88, 28, 135, 0.95) 50%,
        rgba(49, 46, 129, 0.98) 75%,
        rgba(30, 27, 75, 0.95) 100%
    );
    background-size: 400% 400%;
}

.card-gradient-moving > * {
    position: relative;
    z-index: 2;
}

.card-gradient-moving::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(
        135deg,
        rgba(59, 130, 246, 0.20) 0%,
        rgba(147, 51, 234, 0.15) 25%,
        rgba(99, 102, 241, 0.12) 50%,
        rgba(147, 51, 234, 0.15) 75%,
        rgba(59, 130, 246, 0.20) 100%
    );
    background-size: 600% 600%;
    border-radius: inherit;
    animation: ultra-smooth-gradient 25s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
    filter: blur(0.5px);
}

.dark .card-gradient-moving::before {
    background: linear-gradient(
        135deg,
        rgba(59, 130, 246, 0.25) 0%,
        rgba(147, 51, 234, 0.20) 25%,
        rgba(99, 102, 241, 0.15) 50%,
        rgba(147, 51, 234, 0.20) 75%,
        rgba(59, 130, 246, 0.25) 100%
    );
    background-size: 600% 600%;
}

/* Badge Gradients */
.badge-gradient {
    background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 25%, #faf5ff 75%, #fdf4ff 100%);
    color: #2563eb;
    border: 1px solid rgba(219, 234, 254, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.dark .badge-gradient {
    background: linear-gradient(135deg, rgba(30, 27, 75, 0.4) 0%, rgba(49, 46, 129, 0.3) 25%, rgba(88, 28, 135, 0.4) 75%, rgba(76, 29, 149, 0.3) 100%);
    color: #93c5fd;
    border: 1px solid rgba(30, 64, 175, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Ultra-smooth gradient utilities for special use cases */
.gradient-ultra-smooth {
    background: linear-gradient(
        135deg,
        rgba(59, 130, 246, 0.1) 0%,
        rgba(99, 102, 241, 0.08) 16.67%,
        rgba(139, 92, 246, 0.06) 33.33%,
        rgba(147, 51, 234, 0.08) 50%,
        rgba(124, 58, 237, 0.06) 66.67%,
        rgba(99, 102, 241, 0.08) 83.33%,
        rgba(59, 130, 246, 0.1) 100%
    );
    background-size: 800% 800%;
    animation: ultra-smooth-flow 40s ease-in-out infinite;
}

.gradient-whisper {
    background: linear-gradient(
        135deg,
        rgba(59, 130, 246, 0.02) 0%,
        rgba(147, 51, 234, 0.015) 50%,
        rgba(59, 130, 246, 0.02) 100%
    );
    background-size: 300% 300%;
    animation: whisper-flow 20s ease-in-out infinite;
}

.hover-gradient-smooth {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-gradient-smooth:hover {
    background-size: 150% 150%;
    filter: brightness(1.05);
}

@keyframes ultra-smooth-flow {
    0% { background-position: 0% 0%; }
    14.29% { background-position: 100% 25%; }
    28.57% { background-position: 75% 100%; }
    42.86% { background-position: 0% 75%; }
    57.14% { background-position: 100% 0%; }
    71.43% { background-position: 25% 100%; }
    85.71% { background-position: 100% 50%; }
    100% { background-position: 0% 0%; }
}

@keyframes whisper-flow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Animations */
@keyframes gradient-x {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes gradient-smooth {
    0% {
        background-position: 0% 0%;
    }
    25% {
        background-position: 100% 50%;
    }
    50% {
        background-position: 50% 100%;
    }
    75% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 0% 0%;
    }
}

@keyframes gradient-ultra-smooth {
    0% {
        background-position: 0% 50%;
    }
    10% {
        background-position: 20% 60%;
    }
    20% {
        background-position: 40% 70%;
    }
    30% {
        background-position: 60% 80%;
    }
    40% {
        background-position: 80% 70%;
    }
    50% {
        background-position: 100% 50%;
    }
    60% {
        background-position: 80% 30%;
    }
    70% {
        background-position: 60% 20%;
    }
    80% {
        background-position: 40% 30%;
    }
    90% {
        background-position: 20% 40%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes subtle-diagonal {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 100% 100%;
    }
}

@keyframes gradient-y {
    0%, 100% {
        background-position: 50% 0%;
    }
    50% {
        background-position: 50% 100%;
    }
}

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

.gradient-border-subtle {
    position: relative;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(147, 51, 234, 0.2) 100%);
    padding: 1px;
    border-radius: inherit;
}

.gradient-border-subtle > * {
    background: inherit;
    border-radius: inherit;
}

.gradient-border-animated {
    background: linear-gradient(90deg, #2563eb, #9333ea, #2563eb);
    background-size: 300% 300%;
    animation: gradient-x 6s ease infinite;
}

.gradient-outline {
    border: 1px solid transparent;
    background: linear-gradient(
        135deg,
        rgba(59, 130, 246, 0.2) 0%,
        rgba(99, 102, 241, 0.15) 25%,
        rgba(147, 51, 234, 0.2) 50%,
        rgba(99, 102, 241, 0.15) 75%,
        rgba(59, 130, 246, 0.2) 100%
    );
    background-size: 300% 300%;
    background-clip: border-box;
    animation: subtle-border-flow 20s ease-in-out infinite;
}

.gradient-outline-subtle {
    border: 1px solid transparent;
    background: linear-gradient(
        135deg,
        rgba(59, 130, 246, 0.25) 0%,
        rgba(99, 102, 241, 0.20) 25%,
        rgba(147, 51, 234, 0.25) 50%,
        rgba(99, 102, 241, 0.20) 75%,
        rgba(59, 130, 246, 0.25) 100%
    );
    background-size: 500% 500%;
    background-clip: border-box;
    animation: whisper-border 30s ease-in-out infinite;
}

.gradient-outline-animated {
    border: 1px solid transparent;
    background: linear-gradient(
        135deg,
        rgba(59, 130, 246, 0.15) 0%,
        rgba(99, 102, 241, 0.12) 20%,
        rgba(147, 51, 234, 0.15) 40%,
        rgba(124, 58, 237, 0.12) 60%,
        rgba(99, 102, 241, 0.15) 80%,
        rgba(59, 130, 246, 0.15) 100%
    );
    background-size: 600% 600%;
    background-clip: border-box;
    animation: flowing-border 25s ease-in-out infinite;
}

/* New fluid animations */
@keyframes fluid-gradient {
    0%, 100% {
        background-position: 0% 0%;
    }
    25% {
        background-position: 100% 50%;
    }
    50% {
        background-position: 50% 100%;
    }
    75% {
        background-position: 0% 50%;
    }
}

@keyframes ultra-smooth-gradient {
    0% {
        background-position: 0% 0%;
        filter: blur(0.5px);
    }
    20% {
        background-position: 100% 25%;
        filter: blur(0.3px);
    }
    40% {
        background-position: 75% 100%;
        filter: blur(0.8px);
    }
    60% {
        background-position: 25% 75%;
        filter: blur(0.4px);
    }
    80% {
        background-position: 100% 0%;
        filter: blur(0.6px);
    }
    100% {
        background-position: 0% 0%;
        filter: blur(0.5px);
    }
}

@keyframes smooth-text-gradient {
    0%, 100% {
        background-position: 0% 50%;
    }
    33% {
        background-position: 100% 25%;
    }
    66% {
        background-position: 50% 100%;
    }
}

@keyframes ultra-smooth-text {
    0% {
        background-position: 0% 0%;
    }
    16.67% {
        background-position: 100% 33%;
    }
    33.33% {
        background-position: 33% 100%;
    }
    50% {
        background-position: 100% 66%;
    }
    66.67% {
        background-position: 66% 0%;
    }
    83.33% {
        background-position: 0% 100%;
    }
    100% {
        background-position: 0% 0%;
    }
}

@keyframes gentle-bg-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes subtle-border-flow {
    0%, 100% {
        background-position: 0% 0%;
    }
    33% {
        background-position: 100% 50%;
    }
    66% {
        background-position: 50% 100%;
    }
}

@keyframes whisper-border {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes flowing-border {
    0% {
        background-position: 0% 0%;
    }
    20% {
        background-position: 100% 25%;
    }
    40% {
        background-position: 75% 100%;
    }
    60% {
        background-position: 25% 75%;
    }
    80% {
        background-position: 100% 0%;
    }
    100% {
        background-position: 0% 0%;
    }
} 