/* Main Stylesheet for Fitness Store */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
}

html {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 0;
    margin-top: 56px;
}

.min-vh-50 {
    min-height: 50vh;
}

.hero-icon {
    font-size: 10rem;
    opacity: 0.3;
}

/* Product Cards */
.product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.product-card .card-img-top {
    height: 200px;
    object-fit: cover;
}

/* Sections */
.products-section {
    background-color: white;
}

/* Buttons */
.btn {
    border-radius: 6px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,123,255,0.3);
}

/* Cards */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.card-body {
    padding: 1.5rem;
}

/* Forms */
.form-control, .form-select {
    border-radius: 6px;
    border: 1px solid #dee2e6;
    padding: 10px 15px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

/* Navbar */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
}

/* Main Content - Takes up available space */
main {
    flex: 1 0 auto;
}

/* Footer - Stays at bottom */
footer {
    flex-shrink: 0;
    margin-top: auto;
}

/* Social Links */
.social-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.social-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
    color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.social-link i {
    line-height: 1;
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
}

/* Tables */
.table {
    background-color: white;
}

.table thead th {
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    color: #6c757d;
}

/* Badges */
.badge {
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: 500;
}

/* Responsive - Mobile First Approach */
@media (max-width: 576px) {
    /* Typography */
    h1, .h1 {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    h2, .h2 {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    h3, .h3 {
        font-size: 1.25rem;
        line-height: 1.3;
    }
    
    h4, .h4 {
        font-size: 1.1rem;
    }
    
    h5, .h5 {
        font-size: 1rem;
    }
    
    .display-4 {
        font-size: 1.75rem;
        line-height: 1.2;
    }
    
    .lead {
        font-size: 1rem;
        line-height: 1.5;
    }
    
    /* Hero Section */
    .hero-section {
        padding: 40px 0;
        margin-top: 56px;
    }
    
    .hero-icon {
        font-size: 4rem;
        margin-top: 20px;
        opacity: 0.2;
    }
    
    .min-vh-50 {
        min-height: auto;
    }
    
    /* Cards */
    .card {
        margin-bottom: 15px;
        border-radius: 8px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card.shadow .card-body {
        padding: 1.25rem;
    }
    
    /* Product Cards - Better mobile layout */
    .product-card {
        margin-bottom: 1rem;
    }
    
    .product-card .card-img-top {
        height: 180px;
    }
    
    .product-card .card-body {
        padding: 1rem;
    }
    
    .product-card .card-title {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    
    .product-card .card-text {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    .product-card .btn {
        font-size: 0.85rem;
        padding: 8px 16px;
        white-space: nowrap;
    }
    
    .product-card .h4 {
        font-size: 1.25rem;
    }
    
    /* Buttons */
    .btn {
        padding: 10px 18px;
        font-size: 0.95rem;
        min-height: 44px; /* Better touch target */
    }
    
    .btn-lg {
        padding: 12px 24px;
        font-size: 1.05rem;
        min-height: 48px;
    }
    
    .btn-sm {
        padding: 6px 12px;
        font-size: 0.85rem;
        min-height: 36px;
    }
    
    /* Forms */
    .form-control, .form-select {
        padding: 12px 15px;
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 44px; /* Better touch target */
        border-radius: 8px;
    }
    
    .form-label {
        font-weight: 500;
        margin-bottom: 0.5rem;
        font-size: 0.95rem;
    }
    
    /* Navbar */
    .navbar {
        padding: 0.5rem 0;
    }
    
    .navbar-brand {
        font-size: 1rem;
        padding: 0.25rem 0;
    }
    
    .navbar-toggler {
        padding: 0.25rem 0.5rem;
        font-size: 1rem;
        border: none;
    }
    
    .navbar-nav {
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .navbar-nav .nav-link {
        padding: 10px 0;
        font-size: 0.95rem;
    }
    
    .navbar-nav .nav-link i {
        margin-right: 8px;
    }
    
    /* Dark mode toggle button */
    .dark-mode-toggle {
        width: 100%;
        margin: 10px 0 !important;
        justify-content: center;
    }
    
    /* Footer */
    footer {
        padding: 30px 0 !important;
        font-size: 0.9rem;
    }
    
    footer .row {
        text-align: center !important;
    }
    
    footer .col-md-6 {
        margin-bottom: 25px;
    }
    
    footer .col-md-6:last-child {
        margin-bottom: 0;
    }
    
    footer .text-md-end {
        text-align: center !important;
    }
    
    /* Social Links */
    .social-links {
        justify-content: center;
        margin-top: 20px;
        margin-bottom: 15px;
    }
    
    .social-link {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
    
    /* Product grid */
    .products-section .row {
        margin-left: -7.5px;
        margin-right: -7.5px;
    }
    
    .products-section .row > [class*="col-"] {
        padding-left: 7.5px;
        padding-right: 7.5px;
    }
    
    /* Product detail page */
    .product-detail-image {
        margin-bottom: 1.5rem;
    }
    
    .product-detail-image img {
        border-radius: 8px;
    }
    
    /* Login/Register forms */
    .col-md-6.col-lg-5 {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Button groups - stack on mobile */
    .btn-group,
    .d-flex.gap-2 {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn,
    .d-flex.gap-2 .btn {
        width: 100%;
        margin-bottom: 10px;
        margin-right: 0 !important;
    }
    
    .btn-group .btn:last-child,
    .d-flex.gap-2 .btn:last-child {
        margin-bottom: 0;
    }
    
    /* Cart page - better mobile layout */
    .cart-page .col-md-8 {
        margin-bottom: 1.5rem;
    }
    
    .cart-page .col-md-4 {
        order: -1;
    }
    
    /* Checkout page - better mobile layout */
    .checkout-page .col-md-8 {
        margin-bottom: 1.5rem;
    }
    
    .checkout-page .col-md-4 {
        order: -1;
    }
    
    /* Dashboard - stack columns */
    .dashboard .col-md-4 {
        margin-bottom: 1.5rem;
    }
    
    .dashboard .col-md-8 {
        padding-left: 0;
    }
    
    /* Alerts */
    .alert {
        padding: 14px 18px;
        font-size: 0.9rem;
        border-radius: 8px;
        margin-bottom: 1rem;
    }
    
    /* Badges */
    .badge {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
    
    /* Text alignment */
    .text-md-end,
    .text-end {
        text-align: center !important;
    }
    
    /* Spacing utilities */
    .mb-md-0 {
        margin-bottom: 1rem !important;
    }
    
    .mt-md-0 {
        margin-top: 1rem !important;
    }
    
    /* List groups */
    .list-group-item {
        padding: 14px 16px;
        font-size: 0.9rem;
    }
    
    .list-unstyled li {
        padding: 8px 0;
        font-size: 0.9rem;
    }
    
    /* Tables - make them scrollable cards on mobile */
    .table-responsive {
        border-radius: 8px;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 1rem;
    }
    
    .table {
        font-size: 0.85rem;
        margin-bottom: 0;
        min-width: 500px; /* Force horizontal scroll */
    }
    
    .table th,
    .table td {
        padding: 10px 8px;
        vertical-align: middle;
    }
    
    .table th:first-child,
    .table td:first-child {
        padding-left: 12px;
    }
    
    .table th:last-child,
    .table td:last-child {
        padding-right: 12px;
    }
    
    /* Better table layout for cart/checkout */
    .table tbody tr {
        border-bottom: 1px solid #dee2e6;
    }
    
    .table tbody tr:last-child {
        border-bottom: none;
    }
    
    /* Hide less important columns on mobile */
    .table .d-none-mobile {
        display: none !important;
    }
    
    /* Container padding */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Main content spacing */
    main.py-5 {
        padding-top: 1.5rem !important;
        padding-bottom: 2rem !important;
    }
    
    /* Spacing */
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    .mb-4 {
        margin-bottom: 1.5rem !important;
    }
    
    .mb-5 {
        margin-bottom: 2rem !important;
    }
    
    .mt-4 {
        margin-top: 1.5rem !important;
    }
    
    .mt-5 {
        margin-top: 2rem !important;
    }
    
    /* Images */
    .img-fluid {
        border-radius: 8px;
        max-width: 100%;
        height: auto;
    }
    
    /* Order summary cards */
    .order-summary {
        position: sticky;
        top: 70px;
        margin-bottom: 1.5rem;
    }
    
    /* Payment method selection */
    .form-check {
        padding: 12px;
        margin-bottom: 10px;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        background-color: #f8f9fa;
    }
    
    .form-check-input {
        margin-top: 0.4rem;
        width: 1.2rem;
        height: 1.2rem;
    }
    
    .form-check-label {
        font-size: 0.95rem;
        padding-left: 0.5rem;
    }
    
    /* Stripe card element */
    #card-element {
        padding: 12px;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        background-color: white;
    }
    
    /* Account info cards */
    .account-info-card {
        margin-bottom: 1.5rem;
    }
    
    /* Better spacing for product details */
    .product-details h1 {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }
    
    .product-details h3 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .product-details .lead {
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    /* What's included list */
    .list-unstyled li i {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    /* Tablet and below */
    .hero-section {
        padding: 60px 0;
    }
    
    .hero-icon {
        font-size: 6rem;
    }
    
    .display-4 {
        font-size: 2.25rem;
        line-height: 1.2;
    }
    
    /* Dashboard */
    .dashboard .row > div {
        margin-bottom: 20px;
    }
    
    /* Product cards */
    .product-card .card-img-top {
        height: 200px;
    }
    
    /* Account settings tabs */
    .list-group {
        margin-bottom: 20px;
    }
    
    /* Account settings layout */
    .account-settings .col-md-3 {
        margin-bottom: 20px;
    }
    
    .account-settings .col-md-9 {
        padding-left: 0;
    }
    
    /* Tables - make horizontal scroll on mobile */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Cart and checkout - stack on tablets */
    .cart-page .col-md-8,
    .checkout-page .col-md-8 {
        margin-bottom: 1.5rem;
    }
    
    /* Better button sizing on tablets */
    .btn {
        min-height: 42px;
    }
    
    .btn-lg {
        min-height: 46px;
    }
    
    /* Form improvements */
    .form-control,
    .form-select {
        min-height: 42px;
    }
    
    /* Card body padding */
    .card-body {
        padding: 1.25rem;
    }
    
    /* Product detail images */
    .product-detail-image {
        margin-bottom: 2rem;
    }
    
    /* Navbar improvements */
    .navbar-nav .nav-link {
        padding: 10px 0;
    }
}

@media (max-width: 992px) {
    /* Small desktop and tablets */
    .card-body {
        padding: 1.25rem;
    }
}

/* Loading Spinner */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Utilities */
.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

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

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

/* Mobile-specific improvements */
@media (max-width: 576px) {
    /* Better touch targets */
    a, button, input, select, textarea {
        -webkit-tap-highlight-color: rgba(0, 123, 255, 0.2);
    }
    
    /* Prevent text size adjustment on orientation change */
    html {
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
    }
    
    /* Better scrolling */
    body {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Improve readability */
    p, .card-text {
        line-height: 1.6;
    }
    
    /* Better spacing for stacked elements */
    .row > [class*="col-"] {
        margin-bottom: 1rem;
    }
    
    .row > [class*="col-"]:last-child {
        margin-bottom: 0;
    }
    
    /* Product card improvements */
    .product-card .d-flex.justify-content-between {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch !important;
    }
    
    .product-card .d-flex.justify-content-between .btn {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    /* Better order summary on mobile */
    .order-summary .card-body {
        padding: 1.25rem;
    }
    
    .order-summary .d-flex.justify-content-between {
        padding: 0.75rem 0;
        font-size: 0.95rem;
    }
    
    .order-summary .h5 {
        font-size: 1.3rem;
    }
    
    /* Checkout form improvements */
    #payment-form {
        margin-top: 1rem;
    }
    
    #payment-form .btn {
        margin-top: 1rem;
    }
    
    /* Better product detail layout */
    .product-details .btn-lg {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    /* Account settings improvements */
    .account-settings .list-group-item {
        font-size: 0.9rem;
    }
    
    /* Dashboard table improvements */
    .dashboard .table-responsive {
        margin-top: 1rem;
    }
    
    /* Better cart table on mobile */
    .cart-page .table td {
        font-size: 0.9rem;
    }
    
    .cart-page .table .btn-sm {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    /* Payment method cards */
    #stripe-payment {
        margin-top: 1rem;
        padding: 1rem;
        background-color: #f8f9fa;
        border-radius: 8px;
    }
    
    /* Better spacing for alerts */
    .alert {
        margin-bottom: 1.25rem;
    }
    
    /* Improve card shadows on mobile */
    .card {
        box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    }
    
    /* Better footer spacing */
    footer h5 {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    footer p, footer a {
        font-size: 0.9rem;
    }
}

/* Additional improvements for very small screens */
@media (max-width: 375px) {
    .hero-section {
        padding: 30px 0;
    }
    
    .display-4 {
        font-size: 1.5rem;
    }
    
    h1, .h1 {
        font-size: 1.5rem;
    }
    
    h2, .h2 {
        font-size: 1.3rem;
    }
    
    .btn-lg {
        padding: 10px 20px;
        font-size: 1rem;
    }
    
    .card-body {
        padding: 0.9rem;
    }
    
    .navbar-brand {
        font-size: 0.9rem;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        padding: 40px 0;
    }
    
    .hero-icon {
        font-size: 5rem;
    }
    
    .min-vh-50 {
        min-height: auto;
    }
}
