/* Modern E-Commerce Frontend Styles */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* CSS Variables for Dynamic Theming are now generated by getDynamicCSS() function */

/* Global Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #2d3748;
    overflow-x: hidden;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Modern Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
}

.display-1, .display-2, .display-3, .display-4, .display-5 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.text-gradient {
    background: linear-gradient(45deg, #ffffff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Enhanced Navigation */
.navbar {
    backdrop-filter: var(--backdrop-blur);
    background: rgba(255, 255, 255, 0.95) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    padding: 0.5rem 0; /* Reduced from 1rem to 0.5rem */
    min-height: 60px; /* Set consistent height */
}

.navbar.scrolled {
    box-shadow: var(--card-shadow);
    padding: 0.25rem 0; /* Reduced padding when scrolled */
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem; /* Reduced from 1.75rem */
    transition: var(--transition);
    display: flex;
    align-items: center;
}

/* Logo Sizing */
.navbar-brand img,
.navbar-logo {
    height: 45px !important; /* Fixed logo height */
    width: auto !important; /* Maintain aspect ratio */
    max-width: 150px; /* Prevent logos from being too wide */
    object-fit: contain; /* Ensure logo fits properly */
    margin-right: 0.5rem;
}

.footer-logo {
    height: 30px !important; /* Slightly smaller for footer */
    width: auto !important;
    max-width: 120px;
    object-fit: contain;
    margin-right: 0.5rem;
}

.navbar-brand:hover {
    transform: scale(1.02);
}

.nav-link {
    font-weight: 500;
    position: relative;
    transition: var(--transition);
    padding: 0.375rem 0.75rem !important; /* Reduced padding for shorter navbar */
}

.navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background: var(--primary-color, #0066cc);
    transition: var(--transition);
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

/* Modern Buttons */
.btn {
    font-weight: 500;
    border-radius: var(--border-radius);
    padding: 0.75rem 1.5rem;
    transition: var(--transition);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--transition);
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--primary-gradient);
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color, #0066cc);
    color: var(--primary-color, #0066cc);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color, #0066cc);
    transform: translateY(-2px);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Enhanced Hero Section */
.hero-section {
    background: var(--hero-gradient, linear-gradient(135deg, var(--hero-gradient-start, #1e40af) 0%, var(--hero-gradient-end, #3b82f6) 100%));
    min-height: 90vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    color: white;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><polygon fill="rgba(255,255,255,0.05)" points="0,1000 1000,0 1000,1000"/></svg>');
    background-size: cover;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-section h1 {
    margin-bottom: 2rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-section .lead {
    font-size: 1.4rem;
    opacity: 0.95;
    margin-bottom: 3rem;
}

.hero-image-container {
    position: relative;
    z-index: 2;
}

.backdrop-blur {
    backdrop-filter: var(--backdrop-blur);
}

/* Modern Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    overflow: hidden;
    position: relative;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-shadow-hover);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transition: var(--transition);
}

.card:hover::before {
    transform: scaleX(1);
}

/* Product Cards */
.product-card {
    height: 100%;
    cursor: pointer;
}

.product-card .card-img-top {
    height: 250px;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .card-img-top {
    transform: scale(1.05);
}

.product-card .card-body {
    padding: 1.5rem;
}

.product-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #2d3748;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color, #28a745);
    margin-bottom: 1rem;
}

.product-price .old-price {
    font-size: 1rem;
    font-weight: 400;
    color: #6c757d;
    text-decoration: line-through;
    margin-left: 0.5rem;
}

/* Category Cards */
.category-card {
    text-decoration: none;
    color: inherit;
    height: 100%;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: relative;
}

.category-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-gradient);
    opacity: 0;
    transition: var(--transition);
}

.category-card:hover::after {
    opacity: 0.1;
}

.category-card:hover {
    color: inherit;
    text-decoration: none;
}

.category-icon {
    font-size: 3rem;
    color: var(--primary-color, #0066cc);
    margin-bottom: 1rem;
    transition: var(--transition);
}

.category-card:hover .category-icon {
    transform: scale(1.1);
}

.category-name {
    font-size: 1.3rem;
    font-weight: 600;
    text-align: center;
}

/* Stats Section */
.stats-section {
    /* background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%); */
    padding: 5rem 0;
}

/* Reviews Section */
.reviews-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 5rem 0;
}

.stat-card {
    text-align: center;
    padding: 2rem;
}

.stat-number {
    font-size: 3.5rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    display: block;
}

.stat-label {
    font-size: 1.1rem;
    font-weight: 500;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Features Section */
.features-section {
    padding: 5rem 0;
}

.feature-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: white;
    transition: var(--transition);
}

.features-section .col-lg-3:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
}

/* Enhanced Footer */
.footer, footer {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: white !important;
    padding: 4rem 0 2rem;
}

.footer *, footer * {
    color: white !important;
}

.footer h1, .footer h2, .footer h3, .footer h4, .footer h5, .footer h6,
footer h1, footer h2, footer h3, footer h4, footer h5, footer h6 {
    color: white !important;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.footer a, footer a {
    color: white !important;
    text-decoration: none;
    transition: var(--transition);
}

.footer a:hover, footer a:hover {
    color: white !important;
    transform: translateX(5px);
}

.footer p, footer p {
    color: white !important;
}

.footer li, footer li {
    color: white !important;
}

.footer span, footer span {
    color: white !important;
}

.footer i, footer i {
    color: white !important;
}

.footer-bottom {
    border-top: 1px solid #4a5568;
    padding-top: 2rem;
    margin-top: 3rem;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .hero-section {
        min-height: 70vh;
        padding: 3rem 0;
        text-align: center;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .hero-section .lead {
        font-size: 1.2rem;
    }
    
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }
    
    .product-card .card-img-top {
        height: 200px;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    .category-icon {
        font-size: 2.5rem;
    }
    
    .category-name {
        font-size: 1.1rem;
    }
    
    .navbar-brand {
        font-size: 1.5rem;
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .hero-section {
        min-height: 60vh;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-group-sm .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .stats-section {
        padding: 3rem 0;
    }
    
    .features-section {
        padding: 3rem 0;
    }
}

/* Loading Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0px); 
    }
    50% { 
        transform: translateY(-20px); 
    }
}

.floating-element {
    animation: float 6s ease-in-out infinite;
}

.scroll-indicator {
    animation: float 2s ease-in-out infinite;
}

@keyframes spin {
    from { 
        transform: rotate(0deg); 
    }
    to { 
        transform: rotate(360deg); 
    }
}

.spin {
    animation: spin 1s linear infinite;
}

@keyframes pulse {
    0% { 
        transform: scale(1); 
    }
    50% { 
        transform: scale(1.2); 
    }
    100% { 
        transform: scale(1); 
    }
}

.pulse {
    animation: pulse 0.5s ease-in-out;
}

/* Scroll Animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s ease-out;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color, #0066cc);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #004499;
}

/* Search Bar Enhancement */
.search-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.search-input {
    border-radius: 50px;
    padding: 1rem 3rem 1rem 1.5rem;
    border: 2px solid #e2e8f0;
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--primary-color, #0066cc);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--primary-gradient);
    color: white;
}

/* Badge Enhancements */
.badge {
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-weight: 500;
}

.cart-badge {
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Enhanced Modals */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 1px solid #e2e8f0;
    padding: 1.5rem;
}

.modal-body {
    padding: 2rem;
}

/* Image Optimization */
img {
    max-width: 100%;
    height: auto;
}

.img-lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

.img-lazy.loaded {
    opacity: 1;
}

/* Touch Interactions */
.touch-active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* Toast Notifications */
.toast-notification {
    border-radius: var(--border-radius);
    font-weight: 500;
}

/* Wishlist Button States */
.btn[data-wishlist-id] {
    transition: var(--transition);
}

.btn[data-wishlist-id].active {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

.btn[data-wishlist-id]:hover {
    transform: scale(1.05);
}

/* Form Enhancements */
.form-control {
    border-radius: var(--border-radius);
    border: 2px solid #e2e8f0;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color, #0066cc);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* Newsletter Signup */
.newsletter .input-group {
    border-radius: var(--border-radius);
    overflow: hidden;
}

/* Print Styles */
@media print {
    .navbar,
    .footer,
    .btn,
    .hero-section {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    .card {
        background: #2d3748;
        color: white;
    }
    
    .text-muted {
        color: #a0aec0 !important;
    }
}
