/* Custom CSS for Happy Fish n Pets - Modern Swiggy Instamart Style */

:root {
    --primary-color: #ff7e8b;
    --primary-dark: #ff5260;
    --secondary-color: #6c757d;
    --success-color: #00d09c;
    --danger-color: #ff4757;
    --warning-color: #ffa502;
    --info-color: #3742fa;
    --light-color: #f8f9fa;
    --dark-color: #2f3542;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.6;
    padding-top: 80px; /* Account for fixed navbar */
    overflow-x: hidden;
}

/* Navigation */
.navbar {
    background: rgb(9, 44, 219) !important;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
}

.navbar-brand img {
    transition: transform 0.3s ease;
}

.navbar-brand:hover img {
    transform: scale(1.05);
}

.navbar-nav .nav-link {
    font-weight: 500;
    color: var(--gray-300) !important;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    background-color: var(--gray-100);
    color: var(--primary-color) !important;
}

.navbar-nav .nav-link.active {
    background-color: var(--primary-color);
    color: white !important;
}


/* Hero Section */
.hero-section {
    /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
    min-height: 100vh;
    display: flex;
    align-items: center;
    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 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="%23ffffff" opacity="0.2"/><circle cx="10" cy="90" r="0.5" fill="%23ffffff" opacity="0.2"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    animation: slideInLeft 1s ease-out;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: rgba(255,255,255,0.9);
    margin-bottom: 2rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    animation: slideInLeft 1s ease-out 0.2s both;
}

.hero-buttons {
    animation: slideInLeft 1s ease-out 0.4s both;
}

.hero-image {
    text-align: center;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Search Bar */
.search-container {
    max-width: 600px;
    margin: 2rem auto;
    animation: slideInUp 1s ease-out 0.6s both;
}

.search-box {
    position: relative;
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.search-input {
    border: none;
    padding: 1rem 4rem 1rem 1.5rem;
    font-size: 1.1rem;
    width: 100%;
    outline: none;
}

.search-btn {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    background: var(--primary-color);
    border: none;
    padding: 0 1.5rem;
    color: white;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.search-btn:hover {
    background: var(--primary-dark);
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.category-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.category-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    overflow: hidden;
    position: relative;
}

.category-icon i {
    font-size: 1.5rem;
    color: white;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.category-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--gray-200);
}

.category-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-700);
    margin: 0;
}

/* Product Cards */
.product-card-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.product-image-link {
    display: block;
    text-decoration: none;
    transition: all 0.3s ease;
}

.product-image-link:hover {
    text-decoration: none;
}

.product-image-link:hover img {
    transform: scale(1.05);
}

.product-info-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: all 0.3s ease;
}

.product-info-link:hover {
    text-decoration: none;
}

.product-info-link:hover .product-title {
    color: var(--primary-color);
}

.product-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 0.5rem;
}

.add-to-cart-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 0.5rem 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
}

.add-to-cart-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    border-color: rgba(255,255,255,0.3);
}

.add-to-cart-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.add-to-cart-btn i {
    font-size: 0.9rem;
}

.product-card .card-img-top {
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .card-img-top {
    transform: scale(1.05);
}

.product-card .card-body {
    padding: 1rem;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.product-description {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* Floating Cart */
.floating-cart {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
}

.floating-cart:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 32px rgba(255, 126, 139, 0.4);
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

/* Cart Badge */
#cart-count {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
}

/* Forms */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

/* Admin Panel Styles */
.admin-sidebar {
    min-height: 100vh;
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
}

.admin-sidebar .nav-link {
    color: var(--dark-color);
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

.admin-content {
    padding: 2rem;
}

/* Tables */
.table-responsive {
    border-radius: 0.375rem;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.table th {
    background-color: var(--light-color);
    border-bottom: 2px solid var(--primary-color);
    font-weight: 600;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Loading Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Sidebar Filters */
.sidebar-filters {
    position: sticky;
    top: 100px;
    height: fit-content;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: 1rem;
}

.filters-container {
    /* No flex, use normal flow */
}

.filter-title {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.list-group-item {
    border: none;
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

.list-group-item.active {
    background-color: var(--primary-color);
    color: white;
    border-radius: var(--border-radius-sm);
}

/* Category Grid Sidebar */
.category-grid-sidebar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--gray-700);
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.category-item:hover,
.category-item.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.category-image {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    margin-bottom: 0.5rem;
    overflow: hidden;
    border: 2px solid var(--gray-200);
}

.category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.category-image i {
    font-size: 1.5rem;
    color: var(--gray-600);
}

.category-item:hover .category-image i,
.category-item.active .category-image i {
    color: white;
}

.category-name {
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Product Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

/* Cart Items */
.cart-item {
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 0;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 0.375rem;
}

/* Order Status Badges */
.badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        text-align: center;
        padding: 2rem 0;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 0.75rem;
    }

    .product-card .card-img-top {
        height: 140px;
    }

    .product-card .card-body {
        padding: 0.75rem;
    }

    .product-title {
        font-size: 0.9rem;
    }

    .product-price {
        font-size: 1rem;
    }

    .product-description {
        font-size: 0.75rem;
    }

    .sidebar-filters {
        position: static;
        margin-bottom: 1rem;
        padding: 0.5rem;
    }

    .filters-container {
        /* Keep vertical on mobile */
    }

    .admin-sidebar {
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
    }

    .admin-content {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 1.75rem;
    }

    .hero-section p {
        font-size: 1rem;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .product-card .card-img-top {
        height: 120px;
    }

    .product-card .card-body {
        padding: 0.5rem;
    }

    .product-title {
        font-size: 0.8rem;
    }

    .product-price {
        font-size: 0.9rem;
    }

    .product-description {
        font-size: 0.65rem;
    }

    .list-group-item {
        font-size: 0.8rem;
        padding: 0.4rem 0;
    }

    .list-group-item .fa {
        font-size: 1.2rem;
    }



    .filter-title {
        font-size: 0.8rem;
    }

    .table-responsive {
        font-size: 0.875rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

/* Focus States */
.btn:focus,
.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .admin-sidebar {
        display: none !important;
    }
    
    .admin-content {
        padding: 0;
    }
    
    body {
        padding-top: 0;
    }
}


/* loading screen */

#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #ff6ec4, #7873f5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1050;
}

/* Container to hold logo and overlay */
.logo-wrapper {
  position: relative;
  width: 300px;
  height: auto;
}

/* Logo styling */
.loading-logo {
  display: block;
  width: 300px;
  height: auto;
  position: relative;
  z-index: 1;
  opacity: 0;
  animation: logoReveal 5s forwards;
  filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.2));
}

@keyframes logoReveal {
  0% {
    opacity: 0;
    transform: scale(0.5) rotate(-180deg);
  }

  20% {
    opacity: 1;
    transform: scale(1.2) rotate(10deg);
  }

  40% {
    transform: scale(0.9) rotate(-5deg);
  }

  60% {
    transform: scale(1.1) rotate(2deg);
  }

  80% {
    opacity: 1;
    transform: scale(0.95);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}
