/* Frontend Custom Styles */
:root {
    --primary-color: #28a745;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --gradient-primary: linear-gradient(135deg, #28a745 0%, #218838 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Header Styles */
.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
}

.top-bar {
    font-size: 0.9rem;
}

.navbar-brand {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
    transform: translateY(-1px);
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background: var(--gradient-primary);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar-nav .nav-link:hover::after {
    width: 100%;
}

/* Search Form */
.input-group .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Cart Button */
.btn-primary {
    background: var(--gradient-primary);
    border: none;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Product Cards */
.product-card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    background: white;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.product-image-wrapper {
    position: relative;
    overflow: hidden;
}

.product-card .card-img-top {
    height: 200px;
    object-fit: cover;
    transition: all 0.3s ease;
}

.product-card:hover .card-img-top {
    transform: scale(1.05);
}

.btn-wishlist {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: none;
    color: #dc3545;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 10;
}

.btn-wishlist:hover {
    background: #dc3545;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.btn-wishlist:active {
    transform: scale(0.95);
}

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

.product-card .card-title {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.product-card .card-text {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--success-color);
    margin-bottom: 1rem;
}

.product-price .old-price {
    font-size: 1rem;
    color: var(--secondary-color);
    text-decoration: line-through;
    margin-right: 0.5rem;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-success {
    background: var(--gradient-secondary);
    border: none;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

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

.btn-outline-primary:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Hero Section */
.hero-section {
    background: var(--gradient-primary);
    color: white;
    padding: 4rem 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 1000 100" fill="white" opacity="0.1"><polygon points="0,0 1000,0 1000,100 0,80"/></svg>');
    background-size: cover;
}

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

/* Category Cards */
.category-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    border: none;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Features Section */
.features-section {
    background: var(--light-color);
    padding: 4rem 0;
}

.feature-item {
    text-align: center;
    padding: 2rem;
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Footer */
.footer {
    background: var(--dark-color) !important;
}

.footer h5, .footer h6 {
    color: white;
}

.footer .social-links a {
    transition: all 0.3s ease;
}

.footer .social-links a:hover {
    transform: translateY(-3px);
    color: var(--primary-color) !important;
}

.footer .list-unstyled a {
    transition: all 0.3s ease;
}

.footer .list-unstyled a:hover {
    color: var(--primary-color) !important;
    padding-left: 0.5rem;
}

/* Back to Top Button */
.btn-floating {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: none;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.btn-floating.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .hero-section p {
        font-size: 1rem;
    }

    .top-bar .d-flex {
        flex-direction: column;
        gap: 0.5rem;
    }

    .top-bar .text-end {
        text-align: left !important;
    }

    .navbar-nav {
        margin-top: 1rem;
    }

    .input-group {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .product-card .card-body {
        padding: 1rem;
    }

    .category-card {
        padding: 1.5rem;
    }

    .feature-item {
        padding: 1rem;
    }

    .btn-floating {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
    }
}

/* 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-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Utility Classes */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: var(--gradient-primary);
}

.bg-gradient-secondary {
    background: var(--gradient-secondary);
}

.shadow-custom {
    box-shadow: var(--shadow);
}

.shadow-custom-lg {
    box-shadow: var(--shadow-lg);
}

/* Cart Styles */
.cart-item {
    border-bottom: 1px solid #eee;
    padding: 1rem 0;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-summary {
    background: var(--light-color);
    border-radius: 10px;
    padding: 1.5rem;
}

/* Checkout Styles */
.checkout-step {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.checkout-step.active {
    border-left: 4px solid var(--primary-color);
}

/* Alert Styles */
.alert {
    border-radius: 10px;
    border: none;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
}

/* Cart Dropdown Styles */
.cart-dropdown-container {
    position: relative;
}

.cart-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 350px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    margin-top: 10px;
}

.cart-dropdown-container:hover .cart-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.cart-dropdown-content {
    max-height: 400px;
    overflow-y: auto;
}

.cart-dropdown-header {
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.cart-dropdown-body {
    padding: 15px 20px;
}

.cart-dropdown-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f1f3f4;
}

.cart-dropdown-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    margin-right: 12px;
    flex-shrink: 0;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.3;
}

.cart-item-details {
    font-size: 0.8rem;
    color: #6c757d;
}

.cart-item-total {
    font-size: 0.9rem;
    font-weight: 600;
    color: #28a745;
    margin-left: 10px;
}

.cart-dropdown-footer {
    padding: 15px 20px;
    border-top: 1px solid #dee2e6;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

.cart-dropdown-empty {
    text-align: center;
    padding: 30px 20px;
}

.cart-dropdown-empty i {
    color: #6c757d;
    margin-bottom: 15px;
}

.cart-dropdown-empty p {
    color: #6c757d;
    margin-bottom: 15px;
}

.cart-dropdown-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-weight: 600;
}

.cart-dropdown-summary .total-amount {
    color: #28a745;
    font-size: 1.1rem;
}

.cart-dropdown-actions {
    display: flex;
    gap: 10px;
}

.cart-dropdown-actions .btn {
    flex: 1;
    font-size: 0.9rem;
    padding: 8px 12px;
}

/* Cart Dropdown Arrow */
.cart-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid white;
}

.cart-dropdown-menu::after {
    content: '';
    position: absolute;
    top: -9px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-bottom: 9px solid #dee2e6;
}

/* Mobile Cart Dropdown */
@media (max-width: 768px) {
    .cart-dropdown-menu {
        width: 300px;
        right: -50px;
    }

    .cart-dropdown-menu::before,
    .cart-dropdown-menu::after {
        right: 70px;
    }
}

/* Auth Forms Styles */
.auth-section {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.auth-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: none;
}

.auth-card-header {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
    text-align: center;
    padding: 2rem 2rem 1.5rem;
}

.auth-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.auth-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 0;
}

.auth-card-body {
    padding: 2rem;
}

.auth-card-footer {
    background: #f8f9fa;
    padding: 1.5rem 2rem;
    text-align: center;
    border-top: 1px solid #e9ecef;
}

.auth-form .form-group {
    margin-bottom: 1.5rem;
}

.auth-form .form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.auth-form .form-label i {
    color: #6c757d;
}

.auth-form .input-group {
    position: relative;
}

.auth-form .input-group-text {
    background: #f8f9fa;
    border: 1px solid #ced4da;
    border-right: none;
    color: #6c757d;
    padding: 0.75rem 1rem;
}

.auth-form .form-control {
    border: 1px solid #ced4da;
    border-left: none;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.auth-form .form-control:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
    border-left: none;
}

.auth-form .input-group:focus-within .input-group-text {
    border-color: #28a745;
    background: #28a745;
    color: white;
}

.auth-form .btn-outline-secondary {
    border-color: #ced4da;
    color: #6c757d;
}

.auth-form .btn-outline-secondary:hover {
    background: #6c757d;
    border-color: #6c757d;
    color: white;
}

.auth-btn {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    border: none;
    padding: 0.75rem 2rem;
    font-weight: 600;
    font-size: 1.1rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(40, 167, 69, 0.3);
}

.auth-btn:active {
    transform: translateY(0);
}

.auth-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.forgot-link {
    color: #28a745;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: #218838;
    text-decoration: underline;
}

.auth-link {
    color: #28a745;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.auth-link:hover {
    color: #218838;
    text-decoration: underline;
}

.terms-link {
    color: #28a745;
    text-decoration: none;
    font-weight: 500;
}

.terms-link:hover {
    color: #218838;
    text-decoration: underline;
}

.divider {
    position: relative;
    text-align: center;
    margin: 2rem 0;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e9ecef;
}

.divider span {
    background: white;
    padding: 0 1rem;
    color: #6c757d;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

.social-login .btn {
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.social-login .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.social-login .btn-outline-primary:hover {
    background: #007bff;
    border-color: #007bff;
}

.social-login .btn-outline-info:hover {
    background: #17a2b8;
    border-color: #17a2b8;
}

/* Password Strength Indicator */
.password-strength .progress {
    background: #e9ecef;
    border-radius: 2px;
}

.password-strength .progress-bar {
    transition: all 0.3s ease;
    border-radius: 2px;
}

.password-strength .progress-bar.bg-danger {
    background: linear-gradient(90deg, #dc3545, #fd7e14) !important;
}

.password-strength .progress-bar.bg-warning {
    background: linear-gradient(90deg, #ffc107, #fd7e14) !important;
}

.password-strength .progress-bar.bg-success {
    background: linear-gradient(90deg, #28a745, #20c997) !important;
}

.password-match small {
    font-size: 0.8rem;
    font-weight: 500;
}

/* Form Validation */
.invalid-feedback.d-block {
    display: block !important;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #dc3545;
}

.invalid-feedback.d-block i {
    margin-right: 0.25rem;
}

.form-control.is-invalid {
    border-color: #dc3545;
}

.form-control.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Loading States */
.btn .fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Right Sidebar */
.right-sidebar {
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    z-index: 1050;
    display: flex;
    transition: transform 0.3s ease;
    transform: translateX(100%);
}

.right-sidebar.active {
    transform: translateX(0);
}

.sidebar-tabs {
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #28a745 0%, #20c997 100%);
    padding: 20px 10px;
    gap: 15px;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
}

.sidebar-tab {
    position: relative;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    font-size: 1.2rem;
}

.sidebar-tab:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.sidebar-tab.active {
    background: white;
    color: #28a745;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.sidebar-tab .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 0.7rem;
    padding: 2px 6px;
}

.sidebar-content {
    width: 350px;
    background: white;
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 15px rgba(0,0,0,0.1);
}

.sidebar-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.sidebar-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.sidebar-panel {
    display: none;
}

.sidebar-panel.active {
    display: block;
}

/* Chat List */
.chat-list {
    max-height: 500px;
    overflow-y: auto;
}

.chat-item {
    padding: 10px;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-item:hover {
    background: #f8f9fa;
}

.chat-item.active {
    background: #e7f3ff;
}

/* View History */
.history-item {
    padding: 10px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
    transition: background 0.2s;
}

.history-item:hover {
    background: #f8f9fa;
}

.history-item-image {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
}

.history-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.history-item-info {
    flex: 1;
    min-width: 0;
}

.history-item-name {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item-price {
    font-size: 0.85rem;
    color: #28a745;
    font-weight: 600;
}

.history-item-time {
    font-size: 0.75rem;
    color: #6c757d;
}

/* Cart Sidebar */
.cart-sidebar-item {
    transition: background 0.2s;
}

.cart-sidebar-item:hover {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 10px;
    margin: -10px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar-content {
        width: 100vw;
    }
    
    .sidebar-tabs {
        padding: 15px 8px;
        gap: 10px;
    }
    
    .sidebar-tab {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
}

/* Responsive Auth Forms */
@media (max-width: 768px) {
    .auth-section {
        padding: 1rem 0;
    }

    .auth-card {
        margin: 1rem;
        border-radius: 15px;
    }

    .auth-card-header {
        padding: 1.5rem 1.5rem 1rem;
    }

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

    .auth-card-footer {
        padding: 1rem 1.5rem;
    }

    .auth-title {
        font-size: 1.5rem;
    }

    .auth-icon {
        font-size: 2.5rem;
    }

    .auth-btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}
