/* ============================================
   JETSET Pilates CRM - Global Styles
   ============================================ */

/* Prevent layout shift on Alpine.js load */
[x-cloak] { 
    display: none !important; 
}

/* ============================================
   Form Styling
   ============================================ */

/* Disable default HTML5 validation tooltips completely */
input,
select,
textarea {
    box-shadow: none !important;
}

input:invalid,
select:invalid,
textarea:invalid {
    box-shadow: none !important;
}

input:focus:invalid,
select:focus:invalid,
textarea:focus:invalid {
    box-shadow: none !important;
}

/* Fix select dropdown arrow alignment */
select {
    background-position: right 1.25rem center !important;
    padding-right: 3rem !important;
}

/* Show red border on invalid fields when they've been interacted with */
input:invalid:not(:placeholder-shown),
select:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown) {
    border-color: #ef4444 !important;
}

/* Show red border on ALL invalid fields after form validation */
form.validate-attempted input:invalid,
form.validate-attempted select:invalid,
form.validate-attempted textarea:invalid {
    border-color: #ef4444 !important;
}

/* Also support was-validated for backwards compatibility */
form.was-validated input:invalid,
form.was-validated select:invalid,
form.was-validated textarea:invalid {
    border-color: #ef4444 !important;
}

/* Also support the 'submitted' class for backwards compatibility */
form.submitted input:invalid,
form.submitted select:invalid,
form.submitted textarea:invalid {
    border-color: #ef4444 !important;
}

/* ============================================
   Toast Notification System
   ============================================ */

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

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

.toast-enter {
    animation: slideInRight 0.3s ease-out;
}

.toast-exit {
    animation: slideOutRight 0.3s ease-in;
}

/* ============================================
   Custom Scrollbar (for sidebar)
   ============================================ */

.scrollbar-thin::-webkit-scrollbar {
    width: 6px;
}

.scrollbar-thin::-webkit-scrollbar-track {
    background: transparent;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   Loading Spinner
   ============================================ */

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

.spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-left-color: currentColor;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.spinner-lg {
    width: 32px;
    height: 32px;
    border-width: 4px;
}

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

/* Fade In/Out */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

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

/* Smooth transitions for interactive elements */
.transition-smooth {
    transition: all 0.2s ease-in-out;
}

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

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

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.loading-overlay-dark {
    background: rgba(0, 0, 0, 0.3);
}

/* Pulse animation for loading elements */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

