/* =============================================
   POS Sistemi – Enhancement Styles
   Dark Mode, Animations, Badges, Hero, Drawer
   ============================================= */

/* ─── Dark Mode Variables ─── */
[data-theme="dark"] {
    --primary-color: #ff7e4a;
    --secondary-color: #1a1a2e;
    --accent-color: #e8a838;
    --text-color: #e0e0e0;
    --light-bg: #121212;
    --card-bg: #1e1e2e;
    --card-shadow: rgba(0,0,0,0.4);
    --border-color: #2a2a3a;
    --navbar-bg: linear-gradient(135deg, #1a1a2e, #2d1b69);
    --footer-bg: #0d0d1a;
    --input-bg: #2a2a3a;
}

[data-theme="dark"] body {
    background: var(--light-bg) !important;
    color: var(--text-color);
}

[data-theme="dark"] .navbar {
    background: var(--navbar-bg) !important;
}

[data-theme="dark"] .product-card,
[data-theme="dark"] .card,
[data-theme="dark"] .cart-item {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .product-card:hover {
    box-shadow: 0 15px 40px var(--card-shadow) !important;
}

[data-theme="dark"] .product-info h5,
[data-theme="dark"] .card-header,
[data-theme="dark"] h2, [data-theme="dark"] h3, [data-theme="dark"] h4, [data-theme="dark"] h5 {
    color: var(--text-color) !important;
}

[data-theme="dark"] .product-info .text-muted {
    color: #999 !important;
}

[data-theme="dark"] .product-image {
    background: linear-gradient(45deg, #1a1a2e, #2a2a3a) !important;
}

[data-theme="dark"] .category-round-btn {
    background: var(--card-bg) !important;
    box-shadow: 0 3px 15px rgba(0,0,0,0.3) !important;
}

[data-theme="dark"] .category-round-icon {
    color: var(--primary-color) !important;
}

[data-theme="dark"] .category-round-name {
    color: var(--text-color) !important;
}

[data-theme="dark"] #products {
    background: var(--light-bg) !important;
}

[data-theme="dark"] .footer {
    background: var(--footer-bg) !important;
}

[data-theme="dark"] .alert-warning {
    background: #332d1a !important;
    color: #ffc107 !important;
    border-color: #554d2a !important;
}

[data-theme="dark"] .text-muted {
    color: #888 !important;
}

/* ─── Dark Mode Toggle ─── */
.theme-toggle {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1050;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.theme-toggle:hover {
    transform: scale(1.15) rotate(20deg);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    background: rgba(0,0,0,0.5);
}

/* ─── Hero Section ─── */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 50%, #e74c3c 100%);
    padding: 3rem 0 2rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    animation: floatBubble 8s ease-in-out infinite;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(255,255,255,0.03);
    animation: floatBubble 6s ease-in-out infinite reverse;
}

@keyframes floatBubble {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.05); }
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
    animation: fadeInUp 0.8s ease-out;
}

.hero-content p {
    font-size: 1.1rem;
    opacity: 0.95;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-features {
    display: flex;
    gap: 2rem;
    margin-top: 1.5rem;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-feature {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.hero-feature i {
    font-size: 1.3rem;
    background: rgba(255,255,255,0.2);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-image {
    position: relative;
    z-index: 2;
    text-align: center;
    animation: fadeInRight 1s ease-out;
}

.hero-featured-products {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-product-mini {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1rem;
    width: 140px;
    text-align: center;
    transition: transform 0.3s ease;
    border: 1px solid rgba(255,255,255,0.1);
}

.hero-product-mini:hover {
    transform: translateY(-5px) scale(1.05);
    background: rgba(255,255,255,0.25);
}

.hero-product-mini img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 0.5rem;
}

.hero-product-mini .name {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-product-mini .price {
    font-size: 0.85rem;
    font-weight: 700;
    color: #FFD700;
}

@media (max-width: 768px) {
    .hero-content h1 { font-size: 1.8rem; }
    .hero-features { flex-direction: column; gap: 0.8rem; }
    .hero-product-mini { width: 110px; padding: 0.6rem; }
    .hero-product-mini img { width: 50px; height: 50px; }
}

/* ─── Product Badges ─── */
.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.badge-tag {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.badge-new {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
}

.badge-popular {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.badge-discount {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
}

/* ─── Skeleton Loading ─── */
.skeleton-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

[data-theme="dark"] .skeleton-card {
    background: var(--card-bg);
}

.skeleton-img {
    height: 200px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-text {
    height: 14px;
    border-radius: 7px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    margin: 0.5rem 1rem;
}

.skeleton-text-sm {
    height: 10px;
    width: 60%;
    border-radius: 5px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    margin: 0.5rem 1rem;
}

.skeleton-price {
    height: 20px;
    width: 40%;
    border-radius: 10px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    margin: 0.8rem 1rem 1rem;
}

[data-theme="dark"] .skeleton-img,
[data-theme="dark"] .skeleton-text,
[data-theme="dark"] .skeleton-text-sm,
[data-theme="dark"] .skeleton-price {
    background: linear-gradient(90deg, #2a2a3a 25%, #353545 50%, #2a2a3a 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ─── Scroll Animations ─── */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-up-delay-1 { transition-delay: 0.1s; }
.fade-up-delay-2 { transition-delay: 0.2s; }
.fade-up-delay-3 { transition-delay: 0.3s; }

/* ─── Enhanced Product Card Hover ─── */
.product-card .product-image {
    position: relative;
    overflow: hidden;
}

.product-card .product-image img {
    transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.08);
}

.product-card .quick-view-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
    padding: 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
}

.product-card:hover .quick-view-overlay {
    transform: translateY(0);
}

/* ─── Mini Cart Drawer ─── */
.cart-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(3px);
}

.cart-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    background: white;
    z-index: 2001;
    box-shadow: -5px 0 30px rgba(0,0,0,0.2);
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.cart-drawer.active {
    right: 0;
}

[data-theme="dark"] .cart-drawer {
    background: var(--card-bg);
}

.cart-drawer-header {
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
}

.cart-drawer-header h5 {
    margin: 0;
    font-weight: 700;
    color: white !important;
}

.cart-drawer-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 14px;
}

.cart-drawer-close:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

.cart-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.2rem;
}

.cart-drawer-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

[data-theme="dark"] .cart-drawer-item {
    background: #2a2a3a;
}

.cart-drawer-item:hover {
    transform: translateX(-3px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.cart-drawer-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.cart-drawer-item-info {
    flex: 1;
    min-width: 0;
}

.cart-drawer-item-name {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-drawer-item-qty {
    font-size: 0.75rem;
    color: #888;
}

.cart-drawer-item-price {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 0.9rem;
    white-space: nowrap;
}

.cart-drawer-footer {
    padding: 1.2rem 1.5rem;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}

[data-theme="dark"] .cart-drawer-footer {
    background: #1a1a2e;
    border-color: #2a2a3a;
}

.cart-drawer-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 700;
}

.cart-drawer-total .total-price {
    color: var(--primary-color);
    font-size: 1.3rem;
}

.cart-drawer-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #aaa;
}

.cart-drawer-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ─── Add to Cart Animation ─── */
@keyframes cartBounce {
    0%, 100% { transform: scale(1); }
    30% { transform: scale(1.3); }
    60% { transform: scale(0.9); }
}

.floating-cart.bounce {
    animation: cartBounce 0.5s ease;
}

@keyframes addSuccess {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.btn-added {
    animation: addSuccess 0.4s ease;
    background: #28a745 !important;
    border-color: #28a745 !important;
    color: white !important;
}

/* ─── General Animation Utilities ─── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ─── Responsive Enhancements ─── */
@media (max-width: 768px) {
    .theme-toggle { 
        top: 75px; 
        right: 10px; 
        width: 38px; 
        height: 38px; 
        font-size: 15px; 
    }
    .hero-section { padding: 2rem 0 1.5rem; }
}
