/* Custom Styles for E-Commerce Application */

/* Import Montserrat Font */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-color: #343a40;
    --primary-hover: #23272b;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
}

/* General Styles */
body {
    font-family: 'Montserrat', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Modern Navbar Styles */
.navbar {
    padding: 1rem 0;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95) !important;
}

.navbar-brand {
    font-size: 1.5rem;
    transition: transform 0.2s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.navbar-brand i {
    transition: transform 0.3s ease;
}

.navbar-brand:hover i {
    transform: rotate(10deg);
}

.nav-link {
    color: #495057 !important;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 8px;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color) !important;
    background-color: rgba(52, 58, 64, 0.1);
}

.nav-link i {
    transition: transform 0.2s ease;
}

.nav-link:hover i {
    transform: translateY(-2px);
}

/* Cart Icon */
.nav-link .bi-cart3 {
    font-size: 1.25rem;
}

/* User Dropdown */
.dropdown-menu {
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 12px;
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.dropdown-item {
    border-radius: 8px;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: rgba(52, 58, 64, 0.1);
    color: var(--primary-color);
    transform: translateX(5px);
}

.dropdown-item i {
    width: 20px;
}

/* Register Button */
.btn-primary.btn-sm {
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    font-weight: 500;
}

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

/* Mobile Toggle */
.navbar-toggler {
    padding: 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* Modern Hero Section */
.hero-section {
    background: linear-gradient(135deg, #343a40 0%, #23272b 100%);
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.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 1440 320"><path fill="rgba(255,255,255,0.1)" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,144C960,149,1056,139,1152,122.7C1248,107,1344,85,1392,74.7L1440,64L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
    opacity: 0.5;
}

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

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    line-height: 1.2;
    color: white;
}

.text-gradient {
    background: linear-gradient(to right, #fff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-white-75 {
    color: rgba(255, 255, 255, 0.85);
}

.hero-btn {
    border-radius: 50px;
    font-weight: 600;
    border: none;
}

.hero-btn:hover {
    opacity: 0.9;
}

.hero-btn-outline {
    border-radius: 50px;
    font-weight: 600;
    border: 2px solid white;
}

.hero-btn-outline:hover {
    background-color: white;
    color: var(--primary-color);
}

.hero-stats h3 {
    color: white;
    font-size: 2rem;
}

.hero-stats small {
    font-size: 0.875rem;
}

/* Hero Image Section */
.hero-image-wrapper {
    position: relative;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-main-image {
    width: 100%;
    max-width: 450px;
    height: auto;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    object-fit: cover;
    animation: fadeInScale 1s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Floating Cards */
.floating-card {
    position: absolute;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: float 3s ease-in-out infinite;
}

.floating-card i {
    font-size: 1.5rem;
}

.floating-card span {
    font-weight: 600;
    color: #333;
}

.card-1 {
    top: 10%;
    right: 10%;
    animation-delay: 0s;
}

.card-2 {
    bottom: 30%;
    left: 5%;
    animation-delay: 1s;
}

.card-3 {
    bottom: 10%;
    right: 15%;
    animation-delay: 2s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Modern Category Cards */
.category-card {
    background: white;
    border-radius: 20px;
    padding: 2rem 1rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid #f0f0f0;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.category-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.category-card:hover .category-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.category-icon i {
    font-size: 2.5rem;
    color: white;
}

.category-name {
    color: #333;
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.category-card small {
    color: #999;
    font-size: 0.75rem;
    transition: color 0.3s ease;
}

.category-card:hover small {
    color: var(--primary-color);
}

/* Modern Product Card Styles */
.product-card {
    transition: all 0.3s ease;
    border: none;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    background: white;
}

/* Removed hover animation */

.product-image {
    height: 280px;
    width: 100%;
    object-fit: contain;
    object-position: center;
    background: #f8f9fa;
    padding: 1rem;
    display: block;
}

.product-card .card-img-top {
    min-height: 280px;
    max-height: 280px;
}

/* Removed image scale animation */

.product-card .card-body {
    padding: 1.5rem;
}

/* Product card buttons */
.product-card .btn-outline-primary {
    flex: 0 1 auto;
    min-width: 0;
    white-space: nowrap;
}

.product-card .add-to-cart-btn {
    width: 50px;
    height: 50px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Product card clickable elements */
.product-card a.text-decoration-none:hover .product-image {
    opacity: 0.85;
}

.product-card a.text-decoration-none:hover .card-title {
    color: var(--primary-color) !important;
}

.product-card .card-title {
    transition: color 0.2s ease;
}

.product-card .product-image {
    transition: opacity 0.2s ease;
    cursor: pointer;
}

.product-card .card-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.product-card .card-text {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
}

.product-card .text-primary {
    color: var(--primary-color) !important;
    font-weight: 700;
    font-size: 1.5rem;
}

.product-card .btn-primary {
    background: var(--primary-color);
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
}

.product-card .btn-primary:hover {
    background: var(--primary-hover);
}

.product-card .btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
}

.product-card .btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

/* Stock Badge */
.badge.bg-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
}

.badge.bg-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%) !important;
}

.badge.bg-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
}

/* Hover Effects */
.hover-shadow {
    transition: box-shadow 0.3s ease;
}

.hover-shadow:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,.15);
}

/* Card Styles */
.card {
    border-radius: 10px;
    border: 1px solid #dee2e6;
}

.card-header {
    border-radius: 10px 10px 0 0 !important;
}

/* Button Styles */
.btn {
    border-radius: 5px;
    padding: 0.5rem 1rem;
    font-weight: 500;
}

.btn:hover {
    opacity: 0.9;
}

/* Badge Styles */
.badge {
    padding: 0.4em 0.8em;
    font-weight: 500;
}

/* Section Header Badge Styles - Fix overlap issue */
.text-center .badge.bg-primary.bg-opacity-10,
.text-center .badge.bg-warning.bg-opacity-10 {
    display: inline-block;
    position: relative;
    margin-bottom: 1rem;
    font-weight: 600;
    color: #333 !important;
}

.text-center .badge.bg-primary.bg-opacity-10::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    border-radius: 2px;
    background: #0d6efd;
}

.text-center .badge.bg-warning.bg-opacity-10::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    border-radius: 2px;
    background: #ffc107;
}

/* Alert Styles */
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

/* Form Styles */
.form-control, .form-select {
    border-radius: 5px;
    border: 1px solid #ced4da;
    padding: 0.6rem 0.75rem;
}

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

/* Table Styles */
.table {
    border-radius: 8px;
    overflow: hidden;
}

.table thead {
    background-color: #f8f9fa;
}

.table-hover tbody tr:hover {
    background-color: #f8f9fa;
}

/* Profile Page - Order List Styles */
.order-list .order-item {
    transition: background-color 0.2s ease;
}

.order-list .order-item:hover {
    background-color: #f8f9fa;
}

.order-list .order-item:last-child {
    border-bottom: none !important;
}

.order-list .order-item .badge {
    vertical-align: middle;
    line-height: 1;
    padding: 0.35em 0.65em;
}

.order-list .order-item > div > div {
    align-items: center;
}

/* Cart Page Styles */
.cart-item {
    transition: background-color 0.2s ease;
}

.cart-item:hover {
    background-color: #f8f9fa;
}

.cart-item-image img {
    max-height: 100px;
    object-fit: contain;
    background: #f8f9fa;
    padding: 0.5rem;
    border-radius: 8px;
}

.cart-item .input-group input[type="number"] {
    border-right: none;
}

.cart-item .input-group .btn {
    border-left: 1px solid #dee2e6;
}

/* Order Summary Card */
.card.sticky-top {
    position: sticky;
}

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

/* Footer Styles */
footer {
    margin-top: auto;
    padding: 1.5rem 0 !important;
}

footer h5 {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

footer p {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

footer ul {
    margin-bottom: 0;
}

footer ul li {
    margin-bottom: 0.15rem;
}

footer ul li a {
    font-size: 0.85rem;
}

footer .hover-link {
    transition: color 0.3s ease;
}

footer .hover-link:hover {
    color: #fff !important;
}

footer .col-md-4 {
    margin-bottom: 0;
}

footer .row {
    margin-bottom: 0;
}

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

/* Responsive Images - Enhanced Quality */
img {
    max-width: 100%;
    height: auto;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    -ms-interpolation-mode: bicubic;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* High quality image rendering */
.product-image,
.product-detail-image,
.card-img-top,
.hero-main-image {
    image-rendering: auto;
    image-rendering: -webkit-optimize-contrast;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0) scale(1.0, 1.0);
    transform: translateZ(0);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

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

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

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

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

/* Override Bootstrap primary button colors */
.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
}

.btn-outline-primary {
    color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
}

.shadow-sm {
    box-shadow: 0 .125rem .25rem rgba(0,0,0,.075) !important;
}

.shadow {
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.15) !important;
}

/* Product Detail Page */
.product-detail-image-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 2rem;
    min-height: 500px;
}

.product-detail-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    max-height: 500px;
}

.product-detail-info .badge {
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.product-detail-info .display-5 {
    font-size: 2rem;
    line-height: 1.2;
}

.product-detail-info .display-6 {
    font-size: 2.5rem;
}

.product-detail-info .alert {
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
}

.product-detail-info .card {
    border-radius: 12px;
}

.product-detail-info .input-group .btn {
    border-color: #dee2e6;
}

.product-detail-info .input-group input {
    border-left: none;
    border-right: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .product-image {
        height: 200px;
        padding: 0.5rem;
    }
    
    .product-detail-image {
        max-width: 100%;
        padding: 1rem;
        min-height: 250px;
    }
    
    .product-card {
        margin-bottom: 1rem;
    }
    
    .product-card .card-body {
        padding: 1rem;
    }
    
    .product-card .card-title {
        font-size: 1rem;
    }
    
    .product-card .card-text {
        font-size: 0.85rem;
    }
    
    .product-card .text-primary {
        font-size: 1.25rem;
    }
    
    .product-card .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Mobile: Full width buttons */
    .product-card .btn-outline-primary {
        flex: 1 1 auto;
    }
    
    .product-card .add-to-cart-btn {
        width: 50px;
        height: 45px;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    /* Fix container padding on mobile */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Ensure cards don't overflow */
    .row {
        margin-left: -8px;
        margin-right: -8px;
    }
    
    .row > * {
        padding-left: 8px;
        padding-right: 8px;
    }
}

/* Print Styles */
@media print {
    .navbar, footer, .btn, .alert {
        display: none;
    }
}
