﻿/* =========================================
   Professional E-Commerce UI Enhancement
   ========================================= */

/* Enhanced Card Shadows and Hover Effects */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

.card-img-top {
    transition: transform 0.4s ease;
}

.card:hover .card-img-top {
    transform: scale(1.08);
}

/* Product Card Improvements */
.product-card {
    position: relative;
    height: 100%;
}

.product-card .badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    padding: 0.4em 0.8em;
    font-weight: 600;
    border-radius: 20px;
}

.product-image-wrapper {
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
    aspect-ratio: 1;
}

.product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.product-card:hover .product-overlay {
    transform: translateY(0);
}

.product-quick-view {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .product-quick-view {
    opacity: 1;
}

/* Enhanced Buttons */
.btn {
    border-radius: 8px;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #2d7a52 0%, #1a5a37 100%);
    box-shadow: 0 4px 12px rgba(45, 122, 82, 0.3);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1a5a37 0%, #2d7a52 100%);
    box-shadow: 0 6px 16px rgba(45, 122, 82, 0.4);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, #2d7a52 0%, #48a56f 100%);
    box-shadow: 0 4px 12px rgba(45, 122, 82, 0.3);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #48a56f 0%, #2d7a52 100%);
    box-shadow: 0 6px 16px rgba(45, 122, 82, 0.4);
    transform: translateY(-2px);
}

.btn-outline-primary {
    border: 2px solid #2d7a52;
    color: #2d7a52;
    background: transparent;
}

.btn-outline-primary:hover {
    background: #2d7a52;
    color: white;
    border-color: #2d7a52;
}

.btn-lg {
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.875rem;
}

/* Badge Improvements */
.badge {
    padding: 0.5em 1em;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85em;
}

.badge-discount {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Form Improvements */
.form-control, .form-select {
    border-radius: 8px;
    border: 2px solid #e0e5dd;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #2d7a52;
    box-shadow: 0 0 0 0.2rem rgba(45, 122, 82, 0.15);
}

.form-label {
    font-weight: 600;
    color: #5a6c5b;
    margin-bottom: 0.5rem;
}

.input-group {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

/* Enhanced Alerts */
.alert {
    border-radius: 12px;
    border: none;
    padding: 1rem 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.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-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
}

/* Table Improvements */
.table {
    border-radius: 12px;
    overflow: hidden;
}

.table thead th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 1rem;
    border: none;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table-hover tbody tr:hover {
    background-color: rgba(45, 122, 82, 0.05);
    transform: scale(1.01);
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

/* Pagination */
.pagination {
    gap: 0.5rem;
}

.page-link {
    border-radius: 8px;
    border: 2px solid #e0e5dd;
    color: #2d7a52;
    font-weight: 600;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.page-link:hover {
    background-color: #2d7a52;
    border-color: #2d7a52;
    color: white;
    transform: translateY(-2px);
}

.page-item.active .page-link {
    background-color: #2d7a52;
    border-color: #2d7a52;
}

/* Modal Improvements */
.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    border-bottom: 2px solid #e8f5ef;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #e8f5ef 0%, #fafbf9 100%);
    border-radius: 16px 16px 0 0;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    border-top: 2px solid #e8f5ef;
    padding: 1.5rem 2rem;
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 1rem 0;
    margin: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "❯";
    font-size: 1.2rem;
    color: #8a9788;
    margin: 0 0.5rem;
}

.breadcrumb-item a {
    color: #2d7a52;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
    color: #1a5a37;
    text-decoration: underline;
}

/* Progress Bar */
.progress {
    height: 8px;
    border-radius: 10px;
    background-color: #e8f5ef;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, #2d7a52 0%, #48a56f 100%);
    border-radius: 10px;
}

/* List Group */
.list-group-item {
    border: none;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    padding: 1rem 1.25rem;
    transition: all 0.3s ease;
    background-color: #fafbf9;
}

.list-group-item:hover {
    background-color: rgba(45, 122, 82, 0.08);
    transform: translateX(5px);
}

.list-group-item.active {
    background: linear-gradient(135deg, #2d7a52 0%, #1a5a37 100%);
    border-color: #2d7a52;
}

/* Spinner Overlay */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3rem;
    border-color: #2d7a52;
}

/* Tooltip */
.tooltip-inner {
    background-color: #2d7a52;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-weight: 600;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #fafbf9;
}

::-webkit-scrollbar-thumb {
    background: #2d7a52;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1a5a37;
}

/* Price Display */
.price-display {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2d7a52;
}

.price-original {
    font-size: 1.25rem;
    color: #8a9788;
    text-decoration: line-through;
}

.price-discount {
    color: #f4a742;
    font-weight: 700;
    font-size: 1.1rem;
}

/* Rating Stars */
.rating-stars {
    color: #ffc107;
    font-size: 1.1rem;
}

.rating-stars i {
    margin-right: 2px;
}

/* Category Tags */
.category-tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #e8f5ef 0%, #d4eddd 100%);
    border-radius: 20px;
    margin: 0.25rem;
    font-weight: 600;
    color: #2c3e2d;
    transition: all 0.3s ease;
    cursor: pointer;
}

.category-tag:hover {
    background: linear-gradient(135deg, #2d7a52 0%, #1a5a37 100%);
    color: white;
    transform: translateY(-2px);
}

/* Checkout Steps */
.checkout-steps {
    display: flex;
    justify-content: space-between;
    margin: 2rem 0;
    position: relative;
}

.checkout-steps::before {
    content: '';
    position: absolute;
    top: 25px;
    left: 10%;
    right: 10%;
    height: 3px;
    background: #e8f5ef;
    z-index: -1;
}

.checkout-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
}

.checkout-step-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #e8f5ef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #8a9788;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.checkout-step.active .checkout-step-circle {
    background: linear-gradient(135deg, #2d7a52 0%, #1a5a37 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(45, 122, 82, 0.3);
}

.checkout-step.completed .checkout-step-circle {
    background: #48a56f;
    color: white;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    font-size: 4rem;
    color: #d4eddd;
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e2d;
    margin-bottom: 0.5rem;
}

.empty-state-text {
    color: #6c757d;
    margin-bottom: 1.5rem;
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    height: 1.5rem;
    width: 60%;
    margin-bottom: 1rem;
}

.skeleton-image {
    height: 200px;
    width: 100%;
}

/* Responsive Utilities */
@media (max-width: 768px) {
    .btn-lg {
        padding: 0.7rem 1.5rem;
        font-size: 1rem;
    }

    .price-display {
        font-size: 1.5rem;
    }

    .checkout-steps {
        flex-direction: column;
        align-items: stretch;
    }

    .checkout-steps::before {
        display: none;
    }

    .checkout-step {
        flex-direction: row;
        justify-content: flex-start;
        margin-bottom: 1rem;
    }

    .checkout-step-circle {
        margin-right: 1rem;
        margin-bottom: 0;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

.slide-in {
    animation: slideIn 0.5s ease forwards;
}

/* Success Checkmark Animation */
@keyframes checkmark {
    0% {
        stroke-dashoffset: 50;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

.checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: checkmark 0.6s ease-in-out forwards;
}


/* Cart Badge Styles */
.cart-count {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    min-height: 20px;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    background-color: #dc3545 !important;
    color: white !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.cart-count:empty {
    display: none !important;
}

.nav-link.position-relative {
    display: inline-flex;
    align-items: center;
    position: relative;
}

.nav-link .cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    transform: none;
}

@media (max-width: 991px) {
    .cart-count {
        top: -5px;
        right: -8px;
        min-width: 18px;
        min-height: 18px;
        font-size: 0.7rem;
    }
}
