/* 
 * ==========================================
 * GLOBAL STYLES
 * ==========================================
 * Base styles for the application, including font family,
 * background colors for dark/light modes, and flexbox layout.
 */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #2b3035; /* Default Dark Mode Background */
    min-height: 100vh;         /* Ensure full viewport height */
    display: flex;
    flex-direction: column;    /* Stack content vertically */
    color: #f8f9fa;            /* Default Light Text */
    transition: background-color 0.5s ease, color 0.5s ease; /* Smooth theme transition */
}

/* Wrapper to push footer to the bottom of the page */
.content-wrapper {
    flex: 1; /* Takes up remaining vertical space */
}

/* 
 * ==========================================
 * CARD COMPONENT STYLING
 * ==========================================
 * Custom styles for Bootstrap cards to match the theme.
 */
.card {
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3); /* Default Dark Mode Shadow */
    transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
    background-color: #212529; /* Dark Card Background */
    color: #f8f9fa;
}

/* Light Mode Card Overrides */
[data-bs-theme="light"] .card {
    background-color: #ffffff !important;
    color: #212529 !important;
    border: 1px solid rgba(0,0,0,0.1);       /* Subtle border for definition */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* Stronger shadow for separation on white bg */
}

/* Hover Effects for Cards */
.card:hover {
    transform: translateY(-5px); /* Lift effect */
    box-shadow: 0 8px 24px rgba(0,0,0,0.12); /* Enhanced shadow on hover */
}

.product-img {
    padding: 10px;
    border-radius: 12px;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* 
 * ==========================================
 * NAVBAR STYLING
 * ==========================================
 */
.navbar {
    background-color: #212529; /* Dark Mode Navbar */
    overflow: hidden;
    transition: background-color 0.5s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3); /* Subtle shadow for depth */
}

[data-bs-theme="light"] .navbar {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.navbar .container-fluid,
.navbar .navbar-collapse {
    align-items: center;
}
.navbar .navbar-brand,
.navbar .nav-link {
    padding-top: 12px;
    padding-bottom: 12px;
    display: inline-flex;
    align-items: center;
}

/* Light Mode Navbar Overrides */
[data-bs-theme="light"] .navbar {
    background-color: #ffffff !important;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

/* Navbar Links */
.navbar a {
    float: left;
    display: block;
    color: #f8f9fa;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
    font-size: 17px;
    transition: color 0.3s ease, background-color 0.3s ease;
}

[data-bs-theme="light"] .navbar a {
    color: #212529;
}

/* Navbar Link Hover Effects */
.navbar a:hover {
    color: #adb5bd; /* Gray Hover in Dark Mode */
}

[data-bs-theme="light"] .navbar a:hover {
    color: #000000; /* Deep Black for Contrast in Light Mode */
    font-weight: 500;
}

.navbar a.active {
    background-color: #adb5bd;
    color: white;
}

/* Navbar Toggler (Hamburger Menu) Customization */
[data-bs-theme="light"] .navbar-toggler {
    border-color: rgba(0,0,0,0.1);
}
[data-bs-theme="light"] .navbar-toggler-icon {
    /* Custom SVG for dark icon in light mode */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2833, 37, 41, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* 
 * ==========================================
 * FOOTER STYLING
 * ==========================================
 */
.footer-custom {
    padding-top: 40px;
    padding-bottom: 20px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Footer Links */
.footer-links a {
    transition: color 0.3s ease-in-out, transform 0.3s ease-in-out;
    color: #f8f9fa;
    display: inline-block;
}

[data-bs-theme="light"] .footer-links a {
    color: #212529;
}

.footer-links a:hover {
    color: #adb5bd !important;
    transform: scale(1.05); /* Breathing Effect */
}

[data-bs-theme="light"] .footer-links a:hover {
    color: #000000 !important; /* Deep Black Contrast */
}

/* Payment Icons */
.payment-icon {
    font-size: 2rem;
    margin-right: 10px;
    color: #adb5bd;
}

[data-bs-theme="light"] .payment-icon {
    color: #495057;
}

/* Footer Bottom Links (Privacy/Terms) */
.footer-bottom-link {
    color: #f8f9fa;
    transition: color 0.3s ease;
}

[data-bs-theme="light"] .footer-bottom-link {
    color: #212529;
}

.footer-bottom-link:hover {
    color: #adb5bd;
}

/* 
 * ==========================================
 * THEME TOGGLE BUTTON
 * ==========================================
 */
.theme-toggle {
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 50%;
    transition: background-color 0.3s;
    height: 44px;
    display: inline-flex;
    align-items: center;
}
.theme-toggle:hover {
    background-color: rgba(255,255,255,0.1);
}

/* 
 * ==========================================
 * MODAL & BUTTON STYLING
 * ==========================================
 */
.policy-links a {
    color: #adb5bd;
    text-decoration: none;
    margin: 0 15px;
    transition: color 0.3s ease;
}

.policy-links a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Button Border/Shadow Adjustments for Themes */
[data-bs-theme="dark"] .btn-light {
    border: 1px solid rgba(255,255,255,0.25);
    box-shadow: 0 0 0 6px rgba(255,255,255,0.06);
}
[data-bs-theme="dark"] .btn-light:hover {
    box-shadow: 0 0 0 8px rgba(255,255,255,0.10);
}
[data-bs-theme="light"] .btn-dark {
    border: 1px solid rgba(0,0,0,0.2);
    box-shadow: 0 0 0 6px rgba(0,0,0,0.04);
}
[data-bs-theme="light"] .btn-dark:hover {
    box-shadow: 0 0 0 8px rgba(0,0,0,0.08);
}

/* Theme-aware Modal Styles */
[data-bs-theme="dark"] .modal-content {
    background-color: #212529;
    color: #f8f9fa;
}
[data-bs-theme="light"] .modal-content {
    background-color: #ffffff;
    color: #212529;
}
[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-body {
    border-color: rgba(255,255,255,0.1);
}
[data-bs-theme="light"] .modal-header,
[data-bs-theme="light"] .modal-body {
    border-color: rgba(0,0,0,0.1);
}

/* Close Button Contrast Fixes */
[data-bs-theme="dark"] .btn-close {
    filter: invert(1);
}
[data-bs-theme="light"] .btn-close {
    filter: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e%3cline x1='2' y1='2' x2='14' y2='14' stroke='rgba(33,37,41,0.95)' stroke-width='2'/%3e%3cline x1='14' y1='2' x2='2' y2='14' stroke='rgba(33,37,41,0.95)' stroke-width='2'/%3e%3c/svg%3e") !important;
    opacity: 1;
}
@media (max-width: 767.98px) {
    .footer-custom .row {
        align-items: flex-start;
    }
    .footer-custom .col-md-3 {
        margin-bottom: 1.5rem;
    }
}
.footer-custom .copyright {
    font-size: 0.875rem;
    opacity: 0.85;
}

/* 
 * ==========================================
 * SOCIAL ICON BUTTONS (CIRCULAR NEWSTARN STYLE)
 * ==========================================
 */
.social-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-decoration: none;
    background-color: #343a40;  /* bg-gray-800 */
    color: #adb5bd;             /* text-gray-400 */
    padding: 0;
    margin: 0;
    line-height: 1;
    position: relative;
}
.social-icon-btn i {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin: 0;
    padding: 0;
    font-size: inherit;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
[data-bs-theme="light"] .social-icon-btn {
    background-color: #e9ecef;  /* bg-gray-200 */
    color: #6c757d;             /* text-gray-600 */
}
.social-icon-btn:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff;
}
.social-icon-facebook:hover {
    background-color: #2563eb !important;
}
.social-icon-instagram:hover {
    background-color: #db2777 !important;
}
.social-icon-youtube:hover {
    background-color: #dc2626 !important;
}
.social-icon-twitter:hover {
    background-color: #1da1f2 !important;
}

@media (max-width: 575.98px) {
    .social-icon-btn {
        width: 24px;
        height: 24px;
        font-size: 0.875rem;
    }
}
@media (max-width: 991.98px) {
    .navbar .navbar-nav .nav-link {
        padding-left: 0;
        padding-right: 0.75rem;
    }
    .navbar .navbar-nav .nav-link .bi {
        margin-left: 0;
        margin-right: 0.5rem;
    }
}

/* Mobile Compare Label */
.mobile-compare-label {
    color: #f8f9fa;
}
[data-bs-theme="light"] .mobile-compare-label {
    color: #212529;
    font-weight: 600;
}

/* Navbar Cart Icon */
.cart-icon i {
    color: #f8f9fa;
    transition: color 0.3s ease, transform 0.3s ease;
}

[data-bs-theme="light"] .cart-icon i {
    color: #212529;
}

.cart-icon:hover i {
    transform: translateY(-2px);
    color: #adb5bd;
}

[data-bs-theme="light"] .cart-icon:hover i {
    color: #495057;
}

/* 
 * ==========================================
 * UTILITY CLASSES & COMPONENTS
 * ==========================================
 */
.text-muted-custom {
    color: #adb5bd; /* Lighter gray for Dark Mode readability */
    transition: color 0.3s ease;
}

[data-bs-theme="light"] .text-muted-custom {
    color: #495057 !important; /* Dark gray for Light Mode contrast */
    font-weight: 500; /* Added weight for better visibility */
}

/* Feature Box Styling */
.feature-box {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f8f9fa;
}
[data-bs-theme="light"] .feature-box {
    background-color: #f8f9fa; /* Lighter gray background */
    border: 1px solid #dee2e6;
    color: #212529;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Modal Hero Section */
.modal-hero-section {
    padding: 2rem 1rem;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 100%);
    border: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 2rem;
}
[data-bs-theme="light"] .modal-hero-section {
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Table Contrast Fixes for Light Mode */
[data-bs-theme="light"] .table {
    color: #212529;
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(0, 0, 0, 0.05);
    --bs-table-color: #212529;
}
[data-bs-theme="light"] .table th,
[data-bs-theme="light"] .table td {
    color: #212529; /* Force dark text */
}
/* Ensure custom muted text in table is visible */
[data-bs-theme="light"] .table .text-muted-custom {
    color: #495057 !important;
}

[data-bs-theme="light"] .cart-modal-content h6,
[data-bs-theme="light"] .cart-modal-content .text-muted-custom,
[data-bs-theme="light"] .cart-modal-content .fw-bold,
[data-bs-theme="light"] .cart-modal-content #cart-total {
    color: #000;
}

/* 
 * ==========================================
 * ACTION BUTTONS (ADD TO CART & DETAILS)
 * ==========================================
 */
.add-to-cart {
    transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease;
    border: none;
}

.add-to-cart:hover {
    transform: scale(1.02); /* Reduced intensity */
}

.add-to-cart i {
    transition: transform 0.2s ease;
    color: inherit; /* Icon matches text color */
}

.add-to-cart:hover i {
    transform: translateY(-2px);
}

/* Dark Mode: Transparent BG, White Text (Default) -> White BG, Black Text (Hover) */
[data-bs-theme="dark"] .add-to-cart {
    background-color: transparent;
    color: #f8f9fa;
    border: 2px solid #f8f9fa;
}
[data-bs-theme="dark"] .add-to-cart:hover {
    background-color: #f8f9fa;
    color: #000000;
}

/* Light Mode: Button White, Text Black (Default) -> Black BG, White Text (Hover) */
[data-bs-theme="light"] .add-to-cart {
    background-color: #f8f9fa;
    color: #000;
    border: 1px solid #ced4da; /* Subtle border for visibility on white */
}
[data-bs-theme="light"] .add-to-cart:hover {
    background-color: #000000;
    color: #ffffff;
    border-color: #000000;
}

/* Details Button Customization (Sync with Add to Cart) */
.btn-custom-details {
    transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease;
    border: 2px solid;
    font-weight: 500;
}
.btn-custom-details:hover {
    transform: translateY(-2px);
}

/* Dark Mode: Outline White -> Hover White BG/Black Text */
[data-bs-theme="dark"] .btn-custom-details {
    background-color: transparent;
    color: #f8f9fa;
    border-color: #f8f9fa;
}
[data-bs-theme="dark"] .btn-custom-details:hover {
    background-color: #f8f9fa;
    color: #000;
}

/* Light Mode: Outline Black -> Hover Black BG/White Text */
[data-bs-theme="light"] .btn-custom-details {
    background-color: transparent;
    color: #000;
    border-color: #000;
}
[data-bs-theme="light"] .btn-custom-details:hover {
    background-color: #000;
    color: #fff;
}

/* Modal Text Size Optimization */
.modal-hero-title {
    font-size: 2rem;
    font-weight: 700;
}
@media (min-width: 768px) {
    .modal-hero-title {
        font-size: 2.5rem;
    }
}

/* Ensure modal text contrast in both modes */
[data-bs-theme="dark"] .modal-body,
[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer {
    border-color: rgba(255,255,255,0.1);
}
[data-bs-theme="light"] .modal-body,
[data-bs-theme="light"] .modal-header,
[data-bs-theme="light"] .modal-footer {
    border-color: rgba(0,0,0,0.1);
}


/* 
 * ==========================================
 * BACK TO TOP BUTTON
 * ==========================================
 */
.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1050;
    display: none;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0;
    width: auto;
    height: auto;
    outline: none;
}
.back-to-top.show {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 
 * ==========================================
 * EMAIL INPUT STYLING
 * ==========================================
 */
.stylish-email-input .input-group-text {
    border-radius: 999px 0 0 999px;
    border-right: none;
}
.stylish-email-input .form-control {
    border-radius: 0 999px 999px 0;
}
.stylish-email-input .input-group-text i {
    color: #28a745;
}
[data-bs-theme="dark"] .stylish-email-input .input-group-text {
    background-color: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.15);
}
[data-bs-theme="dark"] .stylish-email-input .form-control {
    background-color: transparent;
    border-color: rgba(255,255,255,0.15);
    color: #f8f9fa;
}
[data-bs-theme="light"] .stylish-email-input .input-group-text {
    background-color: #f1f3f5;
    border-color: #ced4da;
}
[data-bs-theme="light"] .stylish-email-input .form-control {
    background-color: #ffffff;
    border-color: #ced4da;
    color: #212529;
}
