/* ============================================
   BounceZero — Custom CSS (Tailwind Companion)
   Glassmorphism, Animations, Dark Mode
   ============================================ */

/* --- Base Transitions --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Oxygen, Ubuntu, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* --- Glassmorphism --- */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-strong {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.glass-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

/* --- Gradient Text --- */
.gradient-text {
    background: linear-gradient(135deg, #E91E63, #FF4081, #E91E63);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}

/* --- Scroll Reveal --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* --- Skeleton Loading --- */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeletonPulse 1.5s ease-in-out infinite;
    border-radius: 8px;
}

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

/* --- Floating Animation --- */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

@keyframes floatSlow {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(3deg); }
}

/* --- Glow Effects --- */
.glow-pink {
    box-shadow: 0 0 20px rgba(233, 30, 99, 0.3), 0 0 60px rgba(233, 30, 99, 0.1);
}

.glow-teal {
    box-shadow: 0 0 20px rgba(38, 166, 154, 0.3), 0 0 60px rgba(38, 166, 154, 0.1);
}

/* --- Button Shimmer --- */
.btn-shimmer {
    position: relative;
    overflow: hidden;
}

.btn-shimmer::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%
    );
    transform: rotate(45deg) translateX(-100%);
    transition: none;
}

.btn-shimmer:hover::after {
    animation: shimmer 0.75s ease forwards;
}

@keyframes shimmer {
    from { transform: rotate(45deg) translateX(-100%); }
    to { transform: rotate(45deg) translateX(100%); }
}

/* --- Checkmark Draw Animation --- */
.checkmark-svg .checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: checkStroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-svg .checkmark-check {
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: checkStroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes checkStroke {
    100% { stroke-dashoffset: 0; }
}

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

.shake { animation: shake 0.6s ease; }

/* --- Pulse Ring --- */
@keyframes pulseRing {
    0% { transform: scale(0.9); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.5; }
    100% { transform: scale(0.9); opacity: 1; }
}

/* --- Spin --- */
@keyframes spin {
    to { transform: rotate(360deg); }
}

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

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

/* --- Scale In --- */
@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* --- Count Up (CSS progress ring) --- */
.progress-ring circle {
    transition: stroke-dashoffset 1s ease;
}

/* --- Toast Enhanced --- */
.toast-enhanced {
    animation: slideInRight 0.3s ease;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    animation: toastProgress 3s linear forwards;
}

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* --- Modal Enhanced --- */
.modal-backdrop-blur {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-scale-in {
    animation: scaleIn 0.2s ease;
}

/* --- Input Focus Ring --- */
.input-glow:focus {
    box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.15);
}

.input-glow-teal:focus {
    box-shadow: 0 0 0 3px rgba(38, 166, 154, 0.15);
}

/* --- Score Circle (conic-gradient) --- */
.score-circle {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* --- Sidebar Nav Link Active --- */
.nav-link.active {
    background: rgba(233, 30, 99, 0.1);
    color: #E91E63 !important;
    border-right: 3px solid #E91E63;
}

/* --- Spinner (button loading) --- */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}

/* --- Scrollbar Styling --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ============================================
   ADMIN PANEL — Design Enhancements
   ============================================ */

/* --- Glassmorphism Sidebar --- */
.admin-glass-sidebar {
    background: linear-gradient(180deg, rgba(27, 27, 47, 0.95), rgba(22, 33, 62, 0.95));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
}

/* --- Gradient Page Headers --- */
.admin-gradient-header {
    background: linear-gradient(135deg, #E91E63, #FF4081, #FF80AB);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease infinite;
}

/* --- Stat Card Glow --- */
.admin-stat-glow {
    position: relative;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.admin-stat-glow:hover {
    box-shadow: 0 4px 20px rgba(233, 30, 99, 0.15), 0 0 40px rgba(233, 30, 99, 0.05);
    transform: translateY(-2px);
}

/* --- Table Row Hover Glow --- */
.admin-table-row-hover {
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.admin-table-row-hover:hover {
    box-shadow: inset 0 0 0 1px rgba(233, 30, 99, 0.08), 0 2px 8px rgba(233, 30, 99, 0.06);
}

/* --- Action buttons in table --- */
.admin-action-btn {
    opacity: 0.5;
    transition: opacity 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.admin-table-row-hover:hover .admin-action-btn {
    opacity: 1;
}

/* --- Active nav glow --- */
.nav-link.active {
    box-shadow: inset -3px 0 12px rgba(233, 30, 99, 0.15);
    text-shadow: 0 0 20px rgba(233, 30, 99, 0.3);
}

/* --- Enhanced modal transitions --- */
.modal-scale-in {
    animation: adminModalIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes adminModalIn {
    from { transform: scale(0.92) translateY(10px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-backdrop-blur {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: backdrop-filter 0.3s ease;
}

/* ============================================
   DARK MODE — [data-theme="dark"]
   ============================================ */
[data-theme="dark"] body,
[data-theme="dark"] {
    color-scheme: dark;
}

[data-theme="dark"] .glass {
    background: rgba(26, 26, 46, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .glass-strong {
    background: rgba(26, 26, 46, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .glass-card {
    background: rgba(26, 26, 46, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .skeleton {
    background: linear-gradient(90deg, #1a1a2e 25%, #2d2d44 50%, #1a1a2e 75%);
    background-size: 200% 100%;
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #475569;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}
