/* GLOBAL FITNESS - Custom Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Rajdhani', sans-serif;
    background: linear-gradient(to right, #434343 0%, #000000 100%);
    background-attachment: fixed;
}

/* Logo and Brand */
.logo-font {
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 2px;
}

/* Gradient Backgrounds */
.gradient-bg {
    background: linear-gradient(to right, #434343 0%, #000000 100%);
}

.gradient-red {
    background: linear-gradient(135deg, #dc2626 0%, #7f1d1d 100%);
}

.gradient-gold {
    background: linear-gradient(135deg, #fbbf24 0%, #78350f 100%);
}

/* Glass Effect */
.glass-effect {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #dc2626, #7f1d1d);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #ef4444, #991b1b);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(220, 38, 38, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(220, 38, 38, 1);
    }
}

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

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

.pulse-animation {
    animation: pulse 2s infinite;
}

.glow-effect {
    animation: glow 2s infinite;
}

/* Cards */
.exercise-card {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.exercise-card:hover {
    border-color: #dc2626;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(220, 38, 38, 0.3);
}

.exercise-card.completed {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(22, 163, 74, 0.05));
    border-color: #22c55e;
}

/* Progress Bars */
.progress-bar {
    transition: width 0.5s ease-in-out;
    background: linear-gradient(to right, #dc2626, #7f1d1d);
}

/* Week Cards */
.week-card {
    transition: all 0.3s ease;
}

.week-card:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.week-card.active {
    border: 2px solid #dc2626;
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.5);
}

.week-card.completed {
    opacity: 0.7;
    border: 2px solid #22c55e;
}

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

thead th {
    background: linear-gradient(to right, #434343, #1a1a1a);
    border-bottom: 2px solid #dc2626;
}

tbody tr {
    transition: all 0.2s ease;
}

tbody tr:hover {
    background: rgba(220, 38, 38, 0.1);
}

/* Status Badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background: linear-gradient(135deg, #22c55e, #15803d);
}

.status-expiring {
    background: linear-gradient(135deg, #f59e0b, #b45309);
}

.status-expired {
    background: linear-gradient(135deg, #ef4444, #991b1b);
}

/* Calendar */
.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.calendar-day:hover {
    background: rgba(220, 38, 38, 0.2);
}

.calendar-day.has-workout {
    background: linear-gradient(135deg, #22c55e, #15803d);
    color: white;
    font-weight: 700;
}

.calendar-day.rest-day {
    background: linear-gradient(135deg, #94a3b8, #475569);
    color: white;
}

.calendar-day.today {
    border: 2px solid #dc2626;
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.5);
}

/* Loading Spinner */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #dc2626;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tooltips */
.tooltip {
    position: relative;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a1a;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 1000;
    border: 1px solid #dc2626;
}

/* Modal Backdrop */
.modal-backdrop {
    backdrop-filter: blur(4px);
    background: rgba(0, 0, 0, 0.7);
}

/* Print Styles */
@media print {
    nav, button, .no-print {
        display: none !important;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .logo-font {
        font-size: 1.5rem;
    }
    
    .glass-effect {
        padding: 1rem;
    }
}

/* Focus States */
:focus {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
}

button:focus, a:focus, input:focus, select:focus, textarea:focus {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
}

/* Custom Utility Classes */
.text-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.card-shadow {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.card-shadow-lg {
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.5);
}

/* Payment QR */
#qrCode {
    max-width: 300px;
    height: auto;
}

/* Subscription Alert */
.subscription-alert {
    animation: pulse 2s infinite;
}

/* Chart Containers */
.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

canvas {
    max-width: 100%;
}

/* Exercise Video Placeholder */
.exercise-video {
    background: linear-gradient(135deg, #1a1a1a, #434343);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

/* Periodization Timeline */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #dc2626, #7f1d1d);
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #dc2626;
    border: 2px solid #1a1a1a;
}

.timeline-item.completed::before {
    background: #22c55e;
}

/* Muscle Group Tags */
.muscle-tag {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(220, 38, 38, 0.2);
    border: 1px solid rgba(220, 38, 38, 0.4);
    border-radius: 9999px;
    font-size: 0.75rem;
    margin: 2px;
}

/* Achievement Badges */
.achievement-badge {
    animation: glow 2s infinite;
}

/* Stats Grid */
.stat-card {
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(220, 38, 38, 0.3);
}

/* Mobile Menu */
@media (max-width: 768px) {
    .mobile-menu {
        animation: slideIn 0.3s ease-out;
    }
}

/* Dark Mode Ready */
@media (prefers-color-scheme: dark) {
    /* Already in dark theme */
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Payment Success Animation */
@keyframes successCheck {
    0% {
        transform: scale(0) rotate(-45deg);
    }
    50% {
        transform: scale(1.2) rotate(-45deg);
    }
    100% {
        transform: scale(1) rotate(-45deg);
    }
}

.success-check {
    animation: successCheck 0.5s ease-out;
}

/* ===================================
   TAB SYSTEM - Navegación mejorada
   ================================= */

.tab-button {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
    cursor: pointer;
}

.tab-button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.tab-button.active {
    background: linear-gradient(135deg, #dc2626, #7f1d1d);
    border-color: #dc2626;
    color: white;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.5);
}

.tab-content {
    animation: fadeIn 0.5s ease-in-out;
}

/* ===================================
   MODAL SYSTEM - Ventanas emergentes
   ================================= */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: fadeIn 0.3s ease-in-out;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a1a, #434343);
    border: 2px solid rgba(220, 38, 38, 0.5);
    border-radius: 16px;
    padding: 32px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
    animation: slideUp 0.3s ease-out;
}

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

.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #dc2626, #7f1d1d);
    border-radius: 4px;
}

/* ===================================
   CHART ENHANCEMENTS
   ================================= */

#weightChartContainer {
    position: relative;
    min-height: 400px;
}

#weightChart {
    max-height: 400px !important;
}

/* ===================================
   PHOTO GALLERY
   ================================= */

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.photo-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.photo-item:hover {
    transform: scale(1.05);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===================================
   WATER TRACKER
   ================================= */

.water-glass {
    transition: all 0.3s ease;
}

.water-glass.filled {
    color: #3b82f6;
    transform: scale(1.1);
}

/* ===================================
   NUTRITION CALCULATOR
   ================================= */

.macro-bar {
    height: 12px;
    border-radius: 6px;
    transition: width 0.5s ease-out;
}

.macro-protein {
    background: linear-gradient(to right, #ef4444, #dc2626);
}

.macro-carbs {
    background: linear-gradient(to right, #fbbf24, #f59e0b);
}

.macro-fat {
    background: linear-gradient(to right, #fb923c, #ea580c);
}

/* ===================================
   RESPONSIVE ADJUSTMENTS
   ================================= */

@media (max-width: 640px) {
    .modal-content {
        padding: 20px;
        max-width: 100%;
    }
    
    .tab-button {
        padding: 8px 16px;
        font-size: 0.875rem;
    }
    
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===================================
   HOVER EFFECTS
   ================================= */

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow {
    transition: all 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.6);
}

/* ===================================
   LOGO ENHANCEMENTS - Sin fondo
   ================================= */

.logo-no-bg {
    /* Efecto para logos sin fondo */
    mix-blend-mode: screen;
    transition: all 0.3s ease;
}

.logo-no-bg:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 15px rgba(220, 38, 38, 0.8)) !important;
}

/* Para asegurar que los logos PNG transparentes se vean bien */
img[src*="logo"] {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Logo container mejorado */
.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Efecto glow para logos */
@keyframes logoGlow {
    0%, 100% {
        filter: drop-shadow(0 0 8px rgba(220, 38, 38, 0.4));
    }
    50% {
        filter: drop-shadow(0 0 15px rgba(220, 38, 38, 0.8));
    }
}

.logo-animate {
    animation: logoGlow 3s infinite ease-in-out;
}

/* ===================================
   EDIT TAB BUTTONS - Modal de edición
   ================================= */

.edit-tab-button {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 0.9rem;
}

.edit-tab-button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.edit-tab-button.active {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    border-color: #a855f7;
    color: white;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.5);
}

.edit-tab-content {
    animation: fadeIn 0.3s ease-in-out;
}

/* ===================================
   CREATIVE EFFECTS - Animaciones Avanzadas
   ================================= */

/* Partículas flotantes */
@keyframes float-up {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(50px) rotate(360deg);
        opacity: 0;
    }
}

/* Efecto Ripple */
@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Confetti */
@keyframes confetti-fall {
    to {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Shimmer loading */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Gradient shift */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Toast animations */
@keyframes toast-in {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toast-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

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

.shake {
    animation: shake 0.5s;
}

/* Glow pulse */
@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 10px var(--glow-color, #dc2626);
    }
    50% {
        box-shadow: 0 0 30px var(--glow-color, #dc2626);
    }
}

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

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

/* Hover glow effect mejorado */
.hover-glow-enhanced {
    position: relative;
    overflow: hidden;
}

.hover-glow-enhanced::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(220, 38, 38, 0.3), transparent);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.hover-glow-enhanced:hover::before {
    width: 300px;
    height: 300px;
}

/* Neón effect */
.neon-text {
    color: #fff;
    text-shadow: 
        0 0 5px #dc2626,
        0 0 10px #dc2626,
        0 0 20px #dc2626,
        0 0 40px #dc2626;
    animation: neon-flicker 1.5s infinite alternate;
}

@keyframes neon-flicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        text-shadow: 
            0 0 5px #dc2626,
            0 0 10px #dc2626,
            0 0 20px #dc2626,
            0 0 40px #dc2626;
    }
    20%, 24%, 55% {
        text-shadow: none;
    }
}

/* Gradient border animation */
.gradient-border {
    position: relative;
    background: linear-gradient(45deg, #434343, #000);
    padding: 2px;
    border-radius: 12px;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    padding: 2px;
    background: linear-gradient(45deg, #dc2626, #fbbf24, #22c55e, #3b82f6, #a855f7);
    background-size: 400% 400%;
    animation: gradient-rotate 3s linear infinite;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

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

/* Floating animation */
@keyframes floating {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.floating {
    animation: floating 3s ease-in-out infinite;
}

/* Morphing shapes */
@keyframes morph {
    0%, 100% {
        border-radius: 40% 60% 70% 30% / 40% 40% 60% 50%;
    }
    34% {
        border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%;
    }
    67% {
        border-radius: 100% 60% 60% 100% / 100% 100% 60% 60%;
    }
}

.morphing-shape {
    animation: morph 8s ease-in-out infinite;
}

/* Card flip */
.flip-card {
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* Magnetic button */
.magnetic-button {
    transition: transform 0.2s ease;
}

/* Progress ring */
.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    transition: stroke-dashoffset 0.5s ease;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

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

/* Tilt effect */
.tilt-card {
    transition: transform 0.1s ease;
}

/* Particles container */
#particles-container {
    pointer-events: none;
}

/* Success/Error toasts */
.success-toast,
.error-toast {
    display: flex;
    align-items: center;
}

/* Improved glass effect */
.glass-effect-enhanced {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Spotlight effect */
.spotlight {
    position: relative;
    overflow: hidden;
}

.spotlight::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 70%
    );
    opacity: 0;
    transition: opacity 0.3s;
}

.spotlight:hover::after {
    opacity: 1;
}

/* Enhanced scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: linear-gradient(to bottom, #1a1a1a, #0a0a0a);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #dc2626, #991b1b);
    border-radius: 10px;
    border: 2px solid #1a1a1a;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #ef4444, #dc2626);
}

/* Loading spinner mejorado */
.spinner-enhanced {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(220, 38, 38, 0.2);
    border-top: 5px solid #dc2626;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.5);
}

/* Pulse animation */
@keyframes pulse-scale {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.pulse-scale {
    animation: pulse-scale 2s infinite;
}
