/* Monkey Fit - Responsive Styles */

/* Mobile First Approach */
/* Base styles for mobile devices */
@media (max-width: 576px) {
    /* Navigation adjustments */
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    /* Container spacing */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Card adjustments */
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* Button adjustments */
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    /* Exercise cards responsive */
    .exercise-card {
        margin-bottom: 1rem;
    }
    
    .exercise-card img {
        height: 120px;
        object-fit: cover;
    }
    
    /* Modal adjustments */
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    /* Table responsive */
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }
    
    /* Admin panel adjustments */
    .admin-stats .card {
        margin-bottom: 0.75rem;
    }
    
    .admin-stats .card-body {
        padding: 0.75rem;
    }
    
    .admin-stats h3 {
        font-size: 1.5rem;
    }
    
    /* Fixed bottom buttons */
    .fixed-bottom {
        position: fixed;
        right: 15px;
        bottom: 15px;
        left: auto;
        width: auto;
    }
    
    .fixed-bottom .btn {
        border-radius: 25px;
        padding: 0.75rem 1.25rem;
    }
    
    /* Form improvements */
    .form-control,
    .form-select {
        font-size: 1rem;
    }
    
    /* Dashboard responsive */
    .dashboard-card {
        margin-bottom: 1rem;
    }
    
    /* Workout logging modal */
    .workout-log-modal .row {
        margin: 0;
    }
    
    .workout-log-modal .col-md-6 {
        padding: 0.25rem;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .card-columns {
        column-count: 1;
    }
    
    .exercise-grid .col-md-6 {
        margin-bottom: 1rem;
    }
    
    .admin-stats .col-md-3 {
        margin-bottom: 1rem;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .card-columns {
        column-count: 2;
    }
    
    .exercise-grid .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .admin-stats .col-md-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .card-columns {
        column-count: 3;
    }
    
    .exercise-grid .col-md-6 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
    
    .admin-stats .col-md-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .card-columns {
        column-count: 4;
    }
    
    .container {
        max-width: 1140px;
    }
}

/* Role-based styling */
.role-badge {
    font-size: 0.75rem;
    font-weight: 500;
}

.admin-section {
    border-left: 4px solid #dc3545;
}

.instructor-section {
    border-left: 4px solid #ffc107;
}

.user-section {
    border-left: 4px solid #0d6efd;
}

/* Enhanced mobile navigation */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background-color: rgba(33, 37, 41, 0.95);
        border-radius: 0.375rem;
        margin-top: 0.5rem;
        padding: 1rem;
    }
    
    .navbar-nav .nav-item {
        margin-bottom: 0.25rem;
    }
    
    .navbar-nav .nav-link {
        border-radius: 0.25rem;
        transition: background-color 0.15s ease-in-out;
    }
    
    .navbar-nav .nav-link:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .dropdown-menu {
        position: static !important;
        transform: none !important;
        border: none;
        background-color: rgba(0, 0, 0, 0.1);
        margin-top: 0.5rem;
    }
}

/* Enhanced card hover effects */
.card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Exercise card specific styles */
.exercise-card .card-img-top {
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.exercise-card:hover .card-img-top {
    transform: scale(1.05);
}

/* Button improvements */
.btn-group-vertical .btn {
    margin-bottom: 0.5rem;
}

.btn-group-vertical .btn:last-child {
    margin-bottom: 0;
}

/* Form validation styles */
.form-control:invalid {
    border-color: #dc3545;
}

.form-control:valid {
    border-color: #198754;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus indicators */
.btn:focus,
.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Dark theme adjustments */
[data-bs-theme="dark"] {
    --bs-body-bg: #212529;
    --bs-body-color: #dee2e6;
}

[data-bs-theme="dark"] .card {
    background-color: #343a40;
    border-color: #495057;
}

[data-bs-theme="dark"] .modal-content {
    background-color: #343a40;
    border-color: #495057;
}

/* Print styles */
@media print {
    .navbar,
    .fixed-bottom,
    .btn,
    .modal {
        display: none !important;
    }
    
    .container {
        max-width: none !important;
    }
    
    .card {
        border: 1px solid #000;
        break-inside: avoid;
    }
}