/* Custom CSS for enhanced styling */

/* Fitness-themed Loading Spinner */
.fitness-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fitness-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.fitness-spinner-container {
    position: relative;
    z-index: 10000;
    text-align: center;
}

.fitness-spinner {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    min-width: 200px;
}

.barbell {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    animation: lifting 2s ease-in-out infinite;
}

.weight {
    width: 30px;
    height: 60px;
    background: linear-gradient(145deg, #333, #555);
    border-radius: 8px;
    position: relative;
    box-shadow: 
        inset 2px 2px 4px rgba(255,255,255,0.1),
        inset -2px -2px 4px rgba(0,0,0,0.2);
}

.weight::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 40px;
    background: linear-gradient(145deg, #2a2a2a, #444);
    border-radius: 4px;
}

.bar {
    width: 80px;
    height: 8px;
    background: linear-gradient(145deg, #666, #888);
    margin: 0 5px;
    border-radius: 4px;
    box-shadow: 
        0 0 12px rgba(0,0,0,0.4),
        inset 0 0 6px rgba(255,255,255,0.2),
        inset 0 0 6px rgba(0,0,0,0.1);
}

.loading-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.loading-dots {
    display: flex;
    justify-content: center;
    gap: 0.3rem;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: #3b82f6;
    border-radius: 50%;
    animation: bounce 1.5s ease-in-out infinite;
    box-shadow: 
        inset 0 2px 4px rgba(255,255,255,0.15),
        inset 0 -2px 4px rgba(0,0,0,0.3);
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Animations */
@keyframes lifting {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-15px) rotate(-2deg);
    }
    50% {
        transform: translateY(-25px) rotate(0deg);
    }
    75% {
        transform: translateY(-15px) rotate(2deg);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) scale(1);
        background: #3b82f6;
    }
    40% {
        transform: translateY(-10px) scale(1.2);
        background: #1d4ed8;
    }
    60% {
        transform: translateY(-5px) scale(1.1);
        background: #2563eb;
    }
}

/* Show state */
.fitness-loader.show {
    display: flex;
    animation: fadeIn 0.3s ease-in-out;
}

.fitness-loader.hide {
    animation: slideUp 0.3s ease-out;
}

/* Alternative spinner styles for variety */
.fitness-spinner.dumbbell-style .barbell {
    animation: bicepCurl 1.8s ease-in-out infinite;
}

.fitness-spinner.squat-style .barbell {
    animation: squat 2.2s ease-in-out infinite;
}

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

@keyframes squat {
    0%, 100% {
        transform: translateY(0) scaleY(1);
    }
    50% {
        transform: translateY(10px) scaleY(0.9);
    }
}

/* Base improvements */
:root {
    --primary-color: #3b82f6;
    --secondary-color: #6b7280;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --bg-color: #f8fafc;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    background-color: var(--bg-color);
}

/* Enhanced navigation */
.navbar {
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.navbar .btn-ghost:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

/* Card enhancements */
.card {
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Enhanced buttons */
.btn {
    transition: all 0.2s ease-in-out;
    border: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #2563eb);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #059669);
}

.btn-error {
    background: linear-gradient(135deg, var(--error-color), #dc2626);
}

/* Form improvements */
.input, .textarea, .select {
    transition: all 0.2s ease-in-out;
    border: 2px solid #e5e7eb;
}

.input:focus, .textarea:focus, .select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Alert enhancements */
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: var(--card-shadow);
}

.alert-success {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    color: #065f46;
    border-left: 4px solid var(--success-color);
}

.alert-error {
    background: linear-gradient(135deg, #fef2f2, #fecaca);
    color: #991b1b;
    border-left: 4px solid var(--error-color);
}

.alert-warning {
    background: linear-gradient(135deg, #fffbeb, #fed7aa);
    color: #92400e;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #1e40af;
    border-left: 4px solid var(--primary-color);
}

/* Badge improvements */
.badge {
    font-weight: 500;
    text-transform: none;
}

.badge-success {
    background: var(--success-color);
    color: white;
}

.badge-warning {
    background: var(--warning-color);
    color: white;
}

.badge-error {
    background: var(--error-color);
    color: white;
}

/* Table enhancements */
.table th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.table tr:hover {
    background-color: rgba(59, 130, 246, 0.05);
}

/* Mobile-specific improvements */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.75rem 1rem;
        min-height: 2.75rem;
    }
    
    .btn-xs {
        padding: 0.5rem 0.75rem;
        min-height: 2rem;
        font-size: 0.75rem;
    }
    
    .navbar .menu {
        gap: 0.25rem;
    }
    
    .navbar .btn-ghost {
        padding: 0.5rem 0.75rem;
        min-height: 2.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }
    
    /* Mobile card stacking */
    .grid.md\\:grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Mobile form improvements */
    .form-control {
        margin-bottom: 1rem;
    }
    
    .input, .textarea, .select {
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 3rem;
    }
    
    /* Mobile table responsiveness */
    .table-responsive {
        margin: 0 -1rem;
        border-radius: 0;
    }
    
    /* Mobile admin improvements */
    .admin-section .card-body {
        padding: 1rem;
    }
    
    /* Mobile button groups */
    .btn-group-mobile {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .btn-group-mobile .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Mobile text sizing */
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .card-title {
        font-size: 1.25rem;
    }
}

/* Loading states */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Class card specific styling */
.class-card {
    position: relative;
    overflow: hidden;
}

.class-card .badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1;
}

.class-status-active {
    background: linear-gradient(135deg, var(--success-color), #059669);
}

.class-status-inactive {
    background: linear-gradient(135deg, var(--secondary-color), #4b5563);
}

/* Booking specific styling */
.booking-item {
    border-left: 4px solid var(--primary-color);
    transition: all 0.2s ease-in-out;
}

.booking-item:hover {
    background-color: rgba(59, 130, 246, 0.05);
}

.booking-confirmed {
    border-left-color: var(--success-color);
}

.booking-cancelled {
    border-left-color: var(--secondary-color);
    opacity: 0.7;
}

/* Admin panel enhancements */
.admin-section {
    margin-bottom: 2rem;
}

.admin-section .card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color), #2563eb);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.stat-card h3 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

/* Responsive table wrapper */
.table-responsive {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.table-responsive .table {
    margin-bottom: 0;
}

/* Penalty styling */
.penalty-item {
    background: linear-gradient(135deg, #fef2f2, #fecaca);
    border: 1px solid #fca5a5;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

/* Exercise styling */
.exercise-item {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

/* Profile section styling */
.profile-section {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
}

/* Telegram link styling */
.telegram-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #0088cc, #0066aa);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
}

.telegram-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 136, 204, 0.3);
}

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

/* Focus improvements */
.btn:focus-visible,
.input:focus-visible,
.textarea:focus-visible,
.select:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

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

.slide-up {
    animation: slideUp 0.3s ease-out;
}

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

/* Print styles */
@media print {
    .navbar,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* Gym Barbell Button Styles */
.btn-barbell {
    position: relative;
    background: linear-gradient(145deg, #2c3e50, #34495e);
    border: 3px solid #1a252f;
    border-radius: 30px;
    color: #ecf0f1 !important;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    box-shadow: 
        0 8px 16px rgba(0,0,0,0.3),
        inset 0 2px 4px rgba(255,255,255,0.1),
        inset 0 -2px 4px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    overflow: visible;
    padding: 0.75rem 2rem;
    min-height: 3rem;
}

.btn-barbell:before,
.btn-barbell:after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 140%;
    background: linear-gradient(145deg, #95a5a6, #7f8c8d);
    border: 3px solid #5d6d7e;
    border-radius: 8px;
    box-shadow: 
        0 0 12px rgba(0,0,0,0.4),
        inset 0 0 6px rgba(255,255,255,0.2),
        inset 0 0 6px rgba(0,0,0,0.1);
}

.btn-barbell:before {
    left: -12px;
}

.btn-barbell:after {
    right: -12px;
}

.btn-barbell:hover {
    background: linear-gradient(145deg, #34495e, #2c3e50);
    transform: translateY(-3px);
    box-shadow: 
        0 12px 24px rgba(0,0,0,0.4),
        inset 0 2px 4px rgba(255,255,255,0.15),
        inset 0 -2px 4px rgba(0,0,0,0.3);
    color: #ffffff !important;
}

.btn-barbell:active {
    transform: translateY(-1px);
    box-shadow: 
        0 6px 12px rgba(0,0,0,0.3),
        inset 0 2px 4px rgba(255,255,255,0.1);
}

.btn-barbell-primary {
    background: linear-gradient(145deg, #e74c3c, #c0392b);
    border-color: #a93226;
}

.btn-barbell-primary:hover {
    background: linear-gradient(145deg, #c0392b, #e74c3c);
}

.btn-barbell-success {
    background: linear-gradient(145deg, #27ae60, #229954);
    border-color: #1e8449;
}

.btn-barbell-success:hover {
    background: linear-gradient(145deg, #229954, #27ae60);
}

.btn-barbell-warning {
    background: linear-gradient(145deg, #f39c12, #e67e22);
    border-color: #d35400;
}

.btn-barbell-warning:hover {
    background: linear-gradient(145deg, #e67e22, #f39c12);
}

.btn-barbell-error {
    background: linear-gradient(145deg, #e67e22, #d35400);
    border-color: #ba4a00;
}

.btn-barbell-error:hover {
    background: linear-gradient(145deg, #d35400, #e67e22);
}

.btn-barbell-secondary {
    background: linear-gradient(145deg, #8e44ad, #7d3c98);
    border-color: #6c3483;
}

.btn-barbell-secondary:hover {
    background: linear-gradient(145deg, #7d3c98, #8e44ad);
}

/* Small barbell buttons */
.btn-barbell-sm {
    padding: 0.5rem 1.5rem;
    font-size: 0.875rem;
    border-radius: 25px;
    min-height: 2.5rem;
}

.btn-barbell-sm:before,
.btn-barbell-sm:after {
    width: 12px;
    height: 130%;
    border-radius: 6px;
}

.btn-barbell-sm:before {
    left: -9px;
}

.btn-barbell-sm:after {
    right: -9px;
}

/* Extra small barbell buttons */
.btn-barbell-xs {
    padding: 0.375rem 1rem;
    font-size: 0.75rem;
    border-radius: 20px;
    min-height: 2rem;
}

.btn-barbell-xs:before,
.btn-barbell-xs:after {
    width: 8px;
    height: 120%;
    border-radius: 4px;
    border-width: 2px;
}

.btn-barbell-xs:before {
    left: -6px;
}

.btn-barbell-xs:after {
    right: -6px;
}

/* Gym themed navbar */
.navbar-gym {
    background: linear-gradient(145deg, #2c3e50, #34495e);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.navbar-gym .navbar-brand {
    color: #ecf0f1 !important;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

/* Gym themed cards */
.card-gym {
    background: linear-gradient(145deg, #ecf0f1, #d5dbdb);
    border: 2px solid #aab7b8;
    box-shadow: 
        0 8px 16px rgba(0,0,0,0.1),
        inset 0 1px 3px rgba(255,255,255,0.8);
}

/* Dark mode support (basic) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1f2937;
        --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    }
}
