/* Rupora Custom Styles - Additional styling for specific components */

/* Banner/Hero Section */
.hero-banner {
    background: white;
    color: var(--text-primary);
    padding: 0rem 0rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    .hero-subtitle {
        font-size: 1rem;
    }
    .hero-banner {
        padding: 0rem 0rem;
    }
}

.category-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
    background: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-card:hover {
    transform: scale(1.05);
}

.category-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(232, 232, 232, 0.4);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.category-card:hover::before {
    background: rgba(0, 0, 0, 0.6);
}

.category-card .category-name {
    position: relative;
    z-index: 10;
    color: white;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    transition: transform 0.3s ease;
}

.category-card:hover .category-name {
    transform: translateY(-2px);
}

.category-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.category-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Cart Animations */
@keyframes bounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    80% {
        transform: translateY(-5px);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.cart-count {
    transition: all 0.3s ease !important;
}

.cart-count:not(:empty) {
    animation: pulse 0.3s ease;
}

.add-to-cart:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.add-to-cart:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Product Grid Enhancements */
.product-grid {
    display: grid;
    gap: 1.5rem;
}

/* Mobile: 1 column */
@media (max-width: 640px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
}

/* Tablet: 2-3 columns */
@media (min-width: 641px) and (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop: 4-5 columns */
@media (min-width: 1025px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Blog Grid */
.blog-grid {
    display: grid;
    gap: 2rem;
}

@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1025px) {
    .blog-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Blog Card */
.blog-card {
    background: var(--surface);
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid var(--border);
}

.blog-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.blog-content {
    padding: 1.5rem;
}

.blog-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.blog-excerpt {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.blog-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Shopping Cart */
.cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--surface);
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 0.5rem;
}

.cart-item-info {
    flex: 1;
}

.cart-item-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.cart-item-price {
    color: var(--primary);
    font-weight: 600;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.quantity-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.quantity-btn:hover {
    background: var(--light-gray);
    border-color: var(--primary);
}

.quantity-input {
    width: 60px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    padding: 0.25rem;
}

/* Checkout Form */
.checkout-form {
    background: var(--surface);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
}

.form-section {
    margin-bottom: 2rem;
}

.form-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.5rem;
}

.payment-methods {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.payment-method {
    border: 2px solid var(--border);
    border-radius: 0.75rem;
    padding: 1rem;
    cursor: pointer;
}

.payment-method:hover {
    border-color: var(--primary);
}

.payment-method.selected {
    border-color: var(--primary);
    background: rgba(25, 49, 51, 0.05);
}

.payment-method-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
}

.payment-method-details {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* Order Summary */
.order-summary {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    position: sticky;
    top: 2rem;
}

.order-summary-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.order-item:last-child {
    border-bottom: none;
}

.order-total {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--primary);
}

/* Admin Sidebar */
.admin-sidebar {
    background: var(--surface);
    height: 100vh;
    border-right: 1px solid var(--border);
    width: 250px;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.admin-sidebar.collapsed {
    transform: translateX(-100%);
}

.admin-sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--primary);
    color: white;
    flex-shrink: 0;
}

.admin-sidebar-nav {
    padding: 1rem 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom scrollbar for sidebar */
.admin-sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.admin-sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.admin-sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.admin-sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Smooth scrolling for sidebar */
.admin-sidebar-nav {
    scroll-behavior: smooth;
}

/* Firefox scrollbar styling */
.admin-sidebar-nav {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.admin-nav-item {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    border-left: 3px solid transparent;
}

.admin-nav-item:hover {
    background: var(--light-gray);
    border-left-color: var(--primary);
    color: var(--primary);
}

.admin-nav-item.active {
    background: rgba(25, 49, 51, 0.1);
    border-left-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}

.admin-nav-icon {
    margin-right: 0.75rem;
    width: 1.25rem;
}

/* Admin Main Content */
.admin-main {
    margin-left: 250px;
    padding: 2rem;
}

.admin-main.expanded {
    margin-left: 0;
}

/* Data Tables */
.data-table {
    width: 100%;
    background: var(--surface);
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid var(--border);
}

.data-table th {
    background: var(--light-gray);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.data-table tr:hover {
    background: rgba(25, 49, 51, 0.02);
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background: #d1fae5;
    color: #065f46;
}

.status-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-completed {
    background: #d1fae5;
    color: #065f46;
}

.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    
    .admin-sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .checkout-form {
        padding: 1rem;
    }
    
    .order-summary {
        position: static;
        margin-top: 2rem;
    }
    
    .cart-item {
        flex-direction: column;
        text-align: center;
    }
    
    .cart-item-image {
        width: 120px;
        height: 120px;
    }
    
    .data-table {
        font-size: 0.875rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }
}

/* Loading States */
.loading-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;
}

.loading-content {
    text-align: center;
}

.loading-spinner-large {
    width: 3rem;
    height: 3rem;
    border: 3px solid var(--light-gray);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    margin: 0 auto 1rem;
}

/* Animations removed */

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Performance Optimizations for Admin Products Page */
.lazy-load {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lazy-load.loaded {
    opacity: 1;
}

/* Image loading placeholder */
.image-placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Form loading states */
.form-loading {
    position: relative;
    pointer-events: none;
}

.form-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* Button loading state */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Optimize table performance */
.data-table {
    table-layout: fixed;
    width: 100%;
}

.data-table img {
    will-change: transform;
    transform: translateZ(0);
}

/* Reduce repaints on hover */
.data-table tr {
    will-change: background-color;
}

/* Image optimization */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: optimize-contrast;
}

/* Prevent layout shifts */
.product-image-container {
    aspect-ratio: 1;
    overflow: hidden;
}

/* Memory optimization for large lists */
.virtualized-list {
    contain: layout style paint;
}
