/* Custom CSS for WMStoreDigital E-commerce */

:root {
    --primary-color: #4f46e5;
    --secondary-color: #7c3aed;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --wmstore-blue: #4f46e5;
    --wmstore-purple: #7c3aed;
    --wmstore-gradient: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Utility Classes */
.gradient-bg {
    background: var(--wmstore-gradient);
}

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

/* WMStoreDigital Brand Colors */
.wmstore-primary {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.wmstore-secondary {
    background-color: var(--secondary-color) !important;
    color: white !important;
}

.wmstore-text-primary {
    color: var(--primary-color) !important;
}

.wmstore-text-secondary {
    color: var(--secondary-color) !important;
}

.wmstore-border-primary {
    border-color: var(--primary-color) !important;
}

/* Brand Logo Styling */
.wmstore-logo {
    font-weight: 700;
    background: var(--wmstore-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

/* Improved contrast for better readability */
.text-on-gradient {
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.bg-contrast {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

/* Animation Classes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0,0,0);
    }
    40%, 43% {
        transform: translate3d(0, -30px, 0);
    }
    70% {
        transform: translate3d(0, -15px, 0);
    }
    90% {
        transform: translate3d(0, -4px, 0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

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

.bounce-animation {
    animation: bounce 2s infinite;
}

/* Card Styles */
.card-hover {
    transition: all 0.3s ease;
    cursor: pointer;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Product Card Styles */
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-info {
    padding: 16px;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1f2937;
    line-height: 1.4;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #059669;
    margin-bottom: 12px;
}

.product-original-price {
    font-size: 0.9rem;
    color: #6b7280;
    text-decoration: line-through;
    margin-left: 8px;
}

.add-to-cart-btn {
    width: 100%;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.add-to-cart-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(59, 130, 246, 0.4);
}

/* Category Card Styles */
.category-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #e5e7eb;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
    border-color: #3b82f6;
}

.category-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

/* Category text improvements */
.category-card h4 {
    color: #1f2937 !important;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.category-card p {
    color: #6b7280 !important;
    font-size: 0.9rem;
}

/* Search Styles */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 50;
    max-height: 300px;
    overflow-y: auto;
}

.search-suggestion {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
}

.search-suggestion:hover {
    background-color: #f9fafb;
}

.search-suggestion:last-child {
    border-bottom: none;
}

/* Cart Sidebar Styles */
#cartSidebar {
    z-index: 9999;
}

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

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

.cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 12px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.cart-item-price {
    color: #059669;
    font-weight: 600;
}

.quantity-controls {
    display: flex;
    align-items: center;
    margin-top: 8px;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #d1d5db;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quantity-btn:hover {
    background: #f9fafb;
}

.quantity-btn:first-child {
    border-radius: 4px 0 0 4px;
}

.quantity-btn:last-child {
    border-radius: 0 4px 4px 0;
}

.quantity-input {
    width: 50px;
    height: 30px;
    border: 1px solid #d1d5db;
    border-left: none;
    border-right: none;
    text-align: center;
    background: white;
}

/* Chatbot Styles */
#chatWindow {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.chat-message {
    margin-bottom: 12px;
    animation: fadeInUp 0.3s ease-out;
}

.chat-message.user {
    text-align: right;
}

.chat-message.user .message-bubble {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    display: inline-block;
    padding: 10px 15px;
    border-radius: 18px 18px 4px 18px;
    max-width: 80%;
}

.chat-message.bot .message-bubble {
    background: #f8f9fa;
    color: #2d3748;
    display: inline-block;
    padding: 10px 15px;
    border-radius: 18px 18px 18px 4px;
    max-width: 80%;
    border: 1px solid #e2e8f0;
}

/* Chat input improvements */
#chatInput {
    background: white !important;
    color: #2d3748 !important;
    border: 1px solid #d1d5db !important;
}

#chatInput::placeholder {
    color: #9ca3af !important;
}

#chatInput:focus {
    background: white !important;
    color: #2d3748 !important;
    border-color: #3b82f6 !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

/* Global input improvements */
input[type="text"], 
input[type="email"], 
input[type="number"], 
input[type="search"], 
textarea {
    background: white !important;
    color: #374151 !important;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
textarea:focus {
    background: white !important;
    color: #374151 !important;
}

/* Search input specific fixes */
#searchInput,
#mobileSearchInput {
    background: white !important;
    color: #374151 !important;
}

#searchInput::placeholder,
#mobileSearchInput::placeholder {
    color: #9ca3af !important;
    opacity: 1;
}

/* Category card text contrast */
.category-card h4 {
    color: #1f2937 !important;
    font-weight: 600 !important;
}

.category-card p {
    color: #6b7280 !important;
}

/* Loading Animations */
.loading-dots {
    display: inline-flex;
    align-items: center;
}

.loading-dots span {
    width: 6px;
    height: 6px;
    background: #6b7280;
    border-radius: 50%;
    margin: 0 2px;
    animation: loading-dots 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes loading-dots {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-left: 4px solid #10b981;
}

.notification.error {
    border-left: 4px solid #ef4444;
}

.notification.info {
    border-left: 4px solid #3b82f6;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .product-card {
        margin-bottom: 20px;
    }
    
    #chatWindow {
        width: calc(100vw - 32px);
        height: 70vh;
        right: 16px;
        bottom: 80px;
    }
    
    .cart-panel {
        width: 100% !important;
        max-width: none !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #111827;
        color: #f9fafb;
    }
    
    .product-card {
        background-color: #1f2937;
        border-color: #374151;
    }
    
    .category-card {
        background-color: #1f2937;
        border-color: #374151;
    }
    
    /* Notification Dark Mode Fix */
    .notification {
        background-color: #1f2937 !important;
        color: #f9fafb !important;
        border-color: #374151;
    }
    
    .notification * {
        color: #f9fafb !important;
    }
    
    /* Keep border colors for notification types */
    .notification.success {
        border-left-color: #10b981 !important;
    }
    
    .notification.error {
        border-left-color: #ef4444 !important;
    }
    
    .notification.info {
        border-left-color: #3b82f6 !important;
    }
}

/* ============================================
   ADMIN DASHBOARD DARK MODE - SPECIFIC FIXES
   ============================================ */

@media (prefers-color-scheme: dark) {
    /* Admin page body */
    body:has(#sidebar) {
        background-color: #111827 !important;
    }
    
    /* Admin main content */
    #main-content {
        background-color: #111827 !important;
    }
    
    /* Admin sections */
    .section-content {
        color: #f9fafb !important;
    }
    
    /* Dashboard cards - texto visível */
    .section-content .bg-white {
        background-color: #1f2937 !important;
    }
    
    .section-content .bg-white h3,
    .section-content .bg-white h4,
    .section-content .bg-white p {
        color: #f9fafb !important;
    }
    
    /* Stats cards colors */
    .section-content .rounded-lg.p-6 {
        background-color: #1f2937 !important;
        border: 1px solid #374151 !important;
    }
    
    /* Recent activities and orders */
    .space-y-4 > div {
        background-color: transparent !important;
    }
    
    .flex.items-start.space-x-3 p,
    .flex.items-center.justify-between p {
        color: #f9fafb !important;
    }
    
    /* AI Activities specific */
    #ai-activities .flex.items-start p {
        color: #f9fafb !important;
    }
    
    /* Recent orders specific */
    #recent-orders .flex.items-center p {
        color: #f9fafb !important;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
}

/* Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus Styles */
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .gradient-bg {
        background: #000;
    }
    
    .product-card {
        border: 2px solid #000;
    }
}
