/* Custom CSS for Member Portal */

/* ==========================================================================
   Base Styles
   ========================================================================== */

/* Smooth transitions for all interactive elements */
* {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom focus styles for accessibility */
:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

/* Link transitions */
a {
    transition: color 0.2s ease, background-color 0.2s ease;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

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

.bg-gradient-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.bg-gradient-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* ==========================================================================
   Component Overrides
   ========================================================================== */

/* Better table hover states */
tbody tr:hover {
    background-color: rgba(249, 250, 251, 0.5);
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f3f4f6;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ==========================================================================
   Animations
   ========================================================================== */

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

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

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.slide-down {
    animation: slideDown 0.3s ease-out;
}

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

.spinner {
    animation: spin 1s linear infinite;
}

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

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

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

.form-loading {
    opacity: 0.6;
    pointer-events: none;
}

.skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

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

/* ==========================================================================
   Toast Notifications
   ========================================================================== */

.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    min-width: 300px;
    max-width: 500px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    animation: slideInRight 0.3s ease-out;
}

.toast-success {
    border-left: 4px solid #10b981;
}

.toast-error {
    border-left: 4px solid #ef4444;
}

.toast-warning {
    border-left: 4px solid #f59e0b;
}

.toast-info {
    border-left: 4px solid #3b82f6;
}

.toast-close {
    float: right;
    font-size: 1.25rem;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    margin-left: 0.75rem;
}

.toast-close:hover {
    color: #6b7280;
}

/* ==========================================================================
   Modal & Dialog Improvements
   ========================================================================== */

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    animation: fadeIn 0.3s ease-out, slideDown 0.3s ease-out;
}

.confirm-dialog {
    max-width: 500px;
    margin: 0 auto;
}

/* ==========================================================================
   Form Enhancements
   ========================================================================== */

.form-field-error {
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

input:user-invalid,
textarea:user-invalid,
select:user-invalid {
    border-color: #ef4444;
}

input:user-valid,
textarea:user-valid,
select:user-valid {
    border-color: #10b981;
}

.file-upload-zone {
    border: 2px dashed #d1d5db;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.2s ease;
}

.file-upload-zone.dragover {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

.file-upload-zone:hover {
    border-color: #9ca3af;
}

/* ==========================================================================
   Navigation Active States
   ========================================================================== */

.nav-link-active {
    border-bottom-color: #3b82f6 !important;
    color: #3b82f6 !important;
}

/* Mobile menu active state */
.mobile-nav-link-active {
    border-left-color: #3b82f6 !important;
    background-color: #eff6ff !important;
    color: #3b82f6 !important;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    nav, footer, .no-print {
        display: none !important;
    }

    body {
        background: white;
    }

    .print-full-width {
        max-width: 100% !important;
    }
}
