/* Swara Trends Custom Styles */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --purple-color: #6f42c1;
    --gradient-start: #667eea;
    --gradient-end: #764ba2;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* Header Styles */
header {
    z-index: 1000;
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: -0.5px;
}

.search-bar {
    min-width: 250px;
}

.search-bar .form-control {
    border-radius: 30px 0 0 30px;
    border-right: none;
}

.search-bar .input-group-text {
    border-radius: 0 30px 30px 0;
    background-color: #fff;
    border-left: none;
}

/* Hero Banner */
.hero-banner {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    position: relative;
    overflow: hidden;
}

.hero-banner::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"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="40" r="1.5" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="80" r="1" fill="rgba(255,255,255,0.1)"/></svg>');
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.hero-image-placeholder {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Category Cards */
.category-card {
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.category-icon {
    transition: all 0.3s ease;
}

.category-card:hover .category-icon {
    transform: scale(1.2);
}

/* Product Cards */
.product-card {
    transition: all 0.3s ease;
    border: none;
    border-radius: 15px;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.product-image {
    height: 250px;
    overflow: hidden;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.price-section .price {
    font-size: 1.5rem;
}

.stock-status .badge {
    font-size: 0.8rem;
}

/* Quantity Selector */
.quantity-selector .qty-input {
    max-width: 60px;
    border-left: none;
    border-right: none;
}

.qty-btn {
    padding: 0.375rem 0.75rem;
}

.qty-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0b5ed7 100%);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(13, 110, 253, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #157347 100%);
    border: none;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(25, 135, 84, 0.4);
}

/* Cart Offcanvas */
.offcanvas {
    width: 400px;
}

.cart-item {
    transition: all 0.3s ease;
}

.cart-item:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

.remove-item {
    transition: all 0.3s ease;
}

.remove-item:hover {
    transform: scale(1.1);
}

/* Custom Tab Styles - Enhanced Active State */
.custom-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
    background: #e9ecef;
    padding: 15px;
    border-radius: 10px;
    border: 3px solid #007bff;
}

.tab-button {
    background: #ffffff;
    border: 2px solid #007bff;
    padding: 15px 25px;
    font-weight: 700;
    font-size: 16px;
    color: #007bff;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    min-width: 120px;
    text-align: center;
}

.tab-button:hover {
    background: #007bff;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 119, 255, 0.4);
    border-color: #007bff;
}

.tab-button.active {
    background: #007bff;
    color: white;
    border-color: #0056b3;
    box-shadow: 0 6px 12px rgba(0, 119, 255, 0.6);
    transform: translateY(-2px);
    position: relative;
}

/* Enhanced active tab indicator */
.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: #007bff;
    clip-path: polygon(50% 100%, 0 0, 100% 0);
    z-index: -1;
}

.tab-button.active::before {
    content: '●';
    position: absolute;
    top: 5px;
    right: 8px;
    color: #fff;
    font-size: 12px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.tab-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Tab content styling */
.tab-content {
    margin-top: 25px;
    padding: 25px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    border: 2px solid #e9ecef;
    min-height: 400px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Order Status Badges */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-confirmed {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #b8daff;
}

.status-shipped {
    background: #cce5ff;
    color: #004085;
    border: 1px solid #b3d7ff;
}

.status-delivered {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Admin Panel Styles */
.card {
    border-radius: 15px;
    border: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0b5ed7 100%);
    color: white;
    border-radius: 15px 15px 0 0 !important;
    border: none;
}

.nav-tabs {
    position: relative;
    z-index: 1000;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    font-weight: 500;
    color: var(--secondary-color);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    z-index: 1000;
    padding: 12px 20px;
    background: transparent;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: transparent;
}

.nav-tabs .nav-link:hover {
    color: var(--primary-color);
    border-bottom-color: rgba(13, 110, 253, 0.3);
    cursor: pointer;
    background-color: rgba(13, 110, 253, 0.05);
}

/* Ensure tab buttons are clickable */
.nav-tabs button {
    pointer-events: auto !important;
    z-index: 1000 !important;
    user-select: none;
}

/* Tab content styling */
.tab-content {
    position: relative;
    z-index: 1;
    margin-top: 20px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block !important;
}

/* Make sure all tab content sections are visible when shown */
#dashboard, #add-product, #manage-products, #inventory, #orders, #profit-loss {
    display: none;
}

#dashboard {
    display: block; /* Dashboard shown by default */
}

/* Dashboard Cards */
.card.bg-primary, .card.bg-success, .card.bg-info, 
.card.bg-warning, .card.bg-danger {
    border-radius: 15px;
    transition: all 0.3s ease;
}

.card.bg-primary:hover, .card.bg-success:hover, 
.card.bg-info:hover, .card.bg-warning:hover, 
.card.bg-danger:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

/* Tables */
.table {
    border-radius: 10px;
    overflow: hidden;
}

.table thead th {
    background-color: var(--light-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0,0,0,0.02);
}

/* Alerts */
.alert {
    border-radius: 10px;
    border: none;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

/* Form Elements */
.form-control, .form-select {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #2c3e50 0%, #1a2530 100%);
}

footer a {
    transition: all 0.3s ease;
}

footer a:hover {
    color: var(--primary-color) !important;
    transform: translateX(5px);
}

/* Header badge icons styling */
.header-actions .badge {
    display: flex !important;
    align-items: center !important;
    gap: 2px !important;
    padding: 0.25em 0.5em !important;
}

.header-actions .badge i {
    font-size: 0.6rem !important;
    margin: 0 !important;
}

/* Header button spacing */
.header-actions .btn {
    margin-right: 0.5rem !important;
}

.header-actions .btn:last-child {
    margin-right: 0 !important;
}

/* Circular logo styling */
.navbar-brand img,
footer h4 img {
    border-radius: 50% !important;
    border: 2px solid #0d6efd !important;
    object-fit: cover !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

/* Mobile Menu Improvements */
@media (max-width: 991.98px) {
    .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        z-index: 1000;
        padding: 1rem;
        border-top: 1px solid #dee2e6;
    }
    
    .navbar-collapse.show {
        display: block !important;
    }
    
    .header-actions {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    .header-actions > div {
        width: 100% !important;
        margin-bottom: 0.5rem;
    }
    
    .dropdown-menu {
        position: static !important;
        transform: none !important;
        width: 100% !important;
        margin-top: 0.5rem !important;
    }
    
    .btn {
        width: 100% !important;
        margin-bottom: 0.5rem !important;
        justify-content: center !important;
    }
    
    .search-bar {
        width: 100% !important;
        margin-bottom: 1rem !important;
    }
}

/* Mobile Responsive Fixes */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }
    
    .container, .container-fluid {
        max-width: 100%;
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .hero-banner .display-4 {
        font-size: 2rem;
    }
    
    .search-bar {
        min-width: 150px;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .product-card {
        margin-bottom: 1.5rem;
    }
    
    .offcanvas {
        width: 100%;
    }
    
    .card-header h5 {
        font-size: 1.1rem;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
    
    /* Header mobile adjustments */
    .navbar-brand {
        font-size: 1.5rem;
    }
    
    .navbar-nav {
        text-align: center;
    }
    
    .dropdown-menu {
        text-align: center;
    }
    
    /* Filter controls mobile */
    .form-select {
        width: 100% !important;
        margin-bottom: 10px;
    }
    
    /* Product grid mobile - 2 items per row */
    .col-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1.3rem;
    }
    
    .hero-banner {
        padding: 1.5rem 0;
    }
    
    .category-card {
        padding: 0.8rem !important;
    }
    
    .category-icon i {
        font-size: 1.5rem !important;
    }
    
    .product-image {
        height: 150px;
    }
    
    .price-section .price {
        font-size: 1.2rem;
    }
    
    /* Ensure proper spacing on small screens */
    .mb-4 {
        margin-bottom: 1rem !important;
    }
    
    .p-4 {
        padding: 1rem !important;
    }
    
    /* Mobile button adjustments */
    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
    
    /* Mobile text adjustments */
    h5 {
        font-size: 1rem;
    }
    
    .card-title {
        font-size: 1rem;
    }
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* Custom Colors */
.text-purple {
    color: var(--purple-color) !important;
}

.bg-purple {
    background-color: var(--purple-color) !important;
}

.border-purple {
    border-color: var(--purple-color) !important;
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0b5ed7;
}

/* Utility Classes */
.cursor-pointer {
    cursor: pointer;
}

.shadow-hover {
    transition: box-shadow 0.3s ease;
}

.shadow-hover:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.border-hover {
    transition: border-color 0.3s ease;
}

.border-hover:hover {
    border-color: var(--primary-color);
}

/* Product Card Variations */
.product-card.border-primary {
    border: 2px solid var(--primary-color) !important;
}

.product-card.border-success {
    border: 2px solid var(--success-color) !important;
}

/* Discount Badge Animation */
.badge.bg-danger {
    animation: pulse 2s infinite;
}

/* Featured Badge */
.badge.bg-warning {
    color: #000;
    font-weight: 600;
}

/* Out of Stock Style */
.badge.bg-danger {
    background-color: #dc3545 !important;
}

/* Price Comparison */
.text-decoration-line-through {
    opacity: 0.7;
}

/* Mobile Menu Toggle */
.navbar-toggler {
    border: none;
    padding: 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* Dropdown Menu */
.dropdown-menu {
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border: none;
    margin-top: 5px;
}

.dropdown-item {
    transition: all 0.2s ease;
    border-radius: 5px;
    margin: 2px 8px;
}

.dropdown-item:hover {
    background-color: rgba(13, 110, 253, 0.1);
    color: var(--primary-color);
}

/* Modal Styles */
.modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

.modal-header {
    border-radius: 15px 15px 0 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, #0b5ed7 100%);
    color: white;
    border: none;
}

/* Toast Notifications */
.toast {
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Progress Bars */
.progress {
    border-radius: 10px;
    height: 10px;
}

.progress-bar {
    border-radius: 10px;
}

/* Image Placeholders */
.image-placeholder {
    background: linear-gradient(45deg, #f8f9fa 25%, transparent 25%), 
                linear-gradient(-45deg, #f8f9fa 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #f8f9fa 75%), 
                linear-gradient(-45deg, transparent 75%, #f8f9fa 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    animation: placeholderShimmer 2s linear infinite;
}

@keyframes placeholderShimmer {
    0% { background-position: 0 0, 0 10px, 10px -10px, -10px 0px; }
    100% { background-position: 20px 0, 20px 10px, 30px -10px, 10px 0px; }
}