/* ============================================
   CrewManager Glass UI Design System
   ============================================ */

/* === SVG Fallback (prevents giant icons if Tailwind fails to load) === */
svg:not([width]):not([class*="w-"]) {
    max-width: 1.5rem;
    max-height: 1.5rem;
}
svg { max-width: 100%; }

/* === Glass Cards === */
.glass-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.05);
    transition: box-shadow 0.3s ease, background 0.3s ease;
}

.glass-card-hover:hover {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.1);
}

/* === Dark Glass (sidebar) === */
.glass-dark {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* === Glass Topbar === */
.glass-topbar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

/* === Glass Inputs === */
.glass-input {
    background: rgba(255, 255, 255, 0.6) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(203, 213, 225, 0.4) !important;
    transition: all 0.2s ease;
}
.glass-input:focus {
    background: rgba(255, 255, 255, 0.85) !important;
    border-color: rgba(99, 102, 241, 0.5) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
}

/* === Glass Table Header === */
.glass-thead {
    background: rgba(248, 250, 252, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* === Gradient Button (Primary CTA) === */
.btn-gradient {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    font-weight: 500;
    transition: all 0.25s ease;
    border: none;
}
.btn-gradient:hover {
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
    transform: translateY(-1px);
}
.btn-gradient:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

/* === Gradient Text === */
.text-gradient {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === Glow Shadows (Status Badges) === */
.glow-emerald { box-shadow: 0 0 10px rgba(16, 185, 129, 0.3); }
.glow-amber   { box-shadow: 0 0 10px rgba(245, 158, 11, 0.3); }
.glow-red     { box-shadow: 0 0 10px rgba(239, 68, 68, 0.3); }
.glow-blue    { box-shadow: 0 0 10px rgba(59, 130, 246, 0.3); }
.glow-violet  { box-shadow: 0 0 10px rgba(139, 92, 246, 0.3); }

/* === Sidebar Links (Dark Theme) === */
.sidebar-link-glass {
    display: flex;
    align-items: center;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.75rem;
    color: rgba(148, 163, 184, 1); /* slate-400 */
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
}
.sidebar-link-glass:hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(226, 232, 240, 1); /* slate-200 */
}
.sidebar-link-glass.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.1));
    border-left-color: #60a5fa;
    color: #93c5fd;
    font-weight: 600;
}
.sidebar-link-glass.active .sidebar-icon {
    color: #60a5fa;
}
.sidebar-link-glass .sidebar-icon {
    color: rgba(100, 116, 139, 1); /* slate-500 */
    transition: color 0.2s ease;
}
.sidebar-link-glass:hover .sidebar-icon {
    color: rgba(148, 163, 184, 1); /* slate-400 */
}

/* === Pulse Ring Animation (Timbrage Buttons) === */
@keyframes pulse-ring {
    0% {
        transform: scale(0.95);
        opacity: 0.7;
    }
    70% {
        transform: scale(1.2);
        opacity: 0;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

.pulse-ring {
    position: relative;
}
.pulse-ring::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 9999px;
    animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    pointer-events: none;
}
.pulse-ring-emerald::before {
    background: rgba(16, 185, 129, 0.35);
}
.pulse-ring-red::before {
    background: rgba(239, 68, 68, 0.35);
}
.pulse-ring-amber::before {
    background: rgba(245, 158, 11, 0.35);
}

/* === Bottom Nav Active Dot === */
.nav-dot-active::after {
    content: '';
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 9999px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    margin: 3px auto 0;
}

/* === iOS Safe Area Bottom === */
.pb-safe-glass {
    padding-bottom: max(5rem, calc(env(safe-area-inset-bottom, 0px) + 5rem));
}

/* === Gradient Border Wrapper (for timbrage card) === */
.gradient-border {
    padding: 2px;
    border-radius: 1.5rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(139, 92, 246, 0.3));
}
.gradient-border > * {
    border-radius: calc(1.5rem - 2px);
}

/* === Progress Bar === */
.progress-bar-glass {
    height: 6px;
    border-radius: 9999px;
    background: rgba(148, 163, 184, 0.15);
    overflow: hidden;
}
.progress-bar-glass .progress-fill {
    height: 100%;
    border-radius: 9999px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    transition: width 0.5s ease;
}

/* === Scrollbar Styling (dark sidebar) === */
.glass-dark::-webkit-scrollbar {
    width: 4px;
}
.glass-dark::-webkit-scrollbar-track {
    background: transparent;
}
.glass-dark::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.3);
    border-radius: 9999px;
}
.glass-dark::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.5);
}

/* === Flash Messages Glass === */
.flash-glass {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* === Smooth Page Transitions === */
.glass-content {
    animation: fadeIn 0.3s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
