/* Variables */
:root {
    --primary-color: #F27A1A;
    --primary-hover: #e06500;
    --secondary-color: #4a4a4a;
    --accent-color: #ffc107;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --text-color: #333333;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --border-radius: 0.375rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --transition: all 0.3s ease;
}

/* Base */
html, body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    background-color: #f9f9f9;
    scroll-behavior: smooth;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover, .btn-outline-primary:focus, .btn-outline-primary:active {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

/* Loading screen */
.loading-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #003366 0%, #004080 100%);
    color: white;
}

.loading-logo {
    margin-bottom: 2rem;
    animation: logoFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.loading-logo img {
    max-width: 150px;
    height: auto;
}

.loading-spinner {
    margin-bottom: 1.5rem;
}

.loading-spinner .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3em;
    color: #E73C30;
}

.loading-text {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.5px;
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px) scale(1);
    }
    50% {
        transform: translateY(-10px) scale(1.02);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Navigation */
.navbar {
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.navbar-brand {
    font-weight: 700;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary-color);
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Product cards */
.product-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card .card-img-top {
    height: 200px;
    object-fit: cover;
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
}

.product-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card .product-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-card .product-price {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.25rem;
    margin-top: auto;
    margin-bottom: 1rem;
}

.product-card .product-rating {
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

/* Styles professionnels pour rupture de stock - Effet flou élégant */
.product-out-of-stock {
    position: relative;
}

.product-out-of-stock .card-img-top {
    filter: blur(3px) grayscale(50%) brightness(0.8);
    transition: filter 0.3s ease;
}

.product-out-of-stock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.product-out-of-stock-text {
    color: #dc3545;
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    letter-spacing: 0.5px;
    transform: rotate(-15deg);
    padding: 0.5rem 1rem;
    border: 2px solid #dc3545;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.product-out-of-stock .card-body {
    opacity: 0.8;
}

.product-out-of-stock .product-title {
    text-decoration: line-through;
    color: #6c757d;
}

.product-out-of-stock .product-price {
    color: #6c757d;
    text-decoration: line-through;
}

/* Animation pour l'overlay - effet flou élégant */
.product-out-of-stock-overlay {
    animation: fadeInBlur 0.4s ease-in-out;
}

@keyframes fadeInBlur {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(2px);
        transform: scale(1);
    }
}

/* Effet hover pour les produits en rupture - flou réduit */
.product-out-of-stock:hover .card-img-top {
    filter: blur(2px) grayscale(30%) brightness(0.9);
}

.product-out-of-stock:hover .product-out-of-stock-text {
    transform: rotate(-15deg) scale(1.05);
    transition: transform 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.product-out-of-stock:hover .product-out-of-stock-overlay {
    background: rgba(255, 255, 255, 0.85);
    transition: background 0.2s ease;
}

/* Responsive pour mobile */
@media (max-width: 768px) {
    .product-out-of-stock-text {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }

    .product-out-of-stock .card-img-top {
        filter: blur(2px) grayscale(40%) brightness(0.85);
    }
}

/* Forms */
.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(242, 122, 26, 0.25);
}

.input-group-text {
    background-color: var(--light-color);
    border-color: var(--border-color);
}

/* Footer */
.footer {
    background-color: white;
    border-top: 1px solid var(--border-color);
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Pagination */
.pagination .page-link {
    color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .navbar-brand img {
        height: 30px;
    }
    
    .product-card .card-img-top {
        height: 150px;
    }
}

/* Error UI */
#blazor-error-ui {
    background-color: var(--danger-color);
    color: white;
    bottom: 0;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* Auth pages */
.auth-container {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* Fix modale: s'assurer que la modal apparaisse au-dessus du header/notifications */
.modal {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 13000 !important;
}

/* s'assurer que la backdrop reste sous la modal */
.modal-backdrop {
    z-index: 12990 !important;
}

/* placer la boîte en dessous du header (évite d'être masquée) */
.modal .modal-dialog {
    margin: 6rem auto 2rem auto;
    max-width: 640px;
}

/* adaptabilité mobile: garder du padding en haut */
@media (max-width: 576px) {
    .modal .modal-dialog {
        margin: 8rem auto 2rem auto;
        width: calc(100% - 2rem);
    }
}

/* Page */
.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
    padding-top: 60px;
}

/* Price tags */
.price-tag {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Rating stars */
.rating {
    color: var(--accent-color);
}

.rating .bi-star-fill,
.rating .bi-star {
    font-size: 0.875rem;
}

/* Category pills */
.category-pill {
    background-color: #e9ecef;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    margin: 0.25rem;
    display: inline-block;
    transition: background-color 0.2s;
}

.category-pill:hover {
    background-color: #dee2e6;
    cursor: pointer;
}

/* Product grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

/* Media Queries */
@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }

    .product-card {
        margin-bottom: 1rem;
    }

    .product-card .card-body {
        padding: 0.75rem;
    }

    .product-card .card-title {
        font-size: 0.9rem;
        line-height: 1.3;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 576px) {
    .product-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .product-card .card-body {
        padding: 0.5rem;
    }

    .product-card .card-title {
        font-size: 0.85rem;
        line-height: 1.2;
        margin-bottom: 0.4rem;
    }

    .product-card .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
}

/* Hero section */
.hero-section {
    margin-bottom: 3rem;
}

.hero-section .carousel-item {
    height: 500px;
}

.hero-section .carousel-item img {
    height: 100%;
    object-fit: cover;
    filter: brightness(0.7);
}

.hero-section .carousel-caption {
    bottom: 30%;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-section p {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Category cards */
.category-card {
    transition: var(--transition);
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-5px);
}

.category-card .bi {
    transition: var(--transition);
}

.category-card:hover .bi {
    transform: scale(1.2);
}

/* Newsletter section */
.newsletter-section {
    background-color: var(--light-color);
    padding: 4rem 0;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .hero-section .carousel-item {
        height: 300px;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    .hero-section .carousel-caption {
        bottom: 20%;
    }
}

/* Dark mode styles */
.dark-mode {
    background-color: #121212;
    color: #f8f9fa;
}

.dark-mode .card {
    background-color: #1e1e1e;
    color: #f8f9fa;
}

.dark-mode .bg-light {
    background-color: #1e1e1e !important;
}

.dark-mode .navbar,
.dark-mode .footer {
    background-color: #1e1e1e;
    color: #f8f9fa;
}

/* Hotline Compact Style */
.hotline-compact {
    display: flex;
    align-items: center;
    color: white;
    font-size: 0.9rem;
    white-space: nowrap;
}

.hotline-compact i {
    color: #F96302;
}

.hotline-number {
    font-weight: 600;
    color: white;
}

/* Responsive adjustments for hotline */
@media (max-width: 768px) {
    .hotline-compact {
        font-size: 0.8rem;
    }

    .hotline-compact .hotline-number {
        display: none;
    }

    .hotline-compact::after {
        content: "Appeler";
        font-size: 0.75rem;
    }
}

@media (max-width: 576px) {
    .hotline-compact i {
        font-size: 1.1rem;
    }
}

/* Layout */
html, body {
    height: 100%;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

/* Styles pour les pages d'authentification */
.auth-page {
    background-color: #f8f9fa;
    min-height: 100vh;
}

.auth-layout {
    background-color: #f8f9fa;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

.auth-page .card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    max-width: 100%;
}

.auth-page .form-control {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 10px 12px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.auth-page .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(242, 122, 26, 0.15);
}

.auth-page .btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
}

.auth-page .btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
}

.auth-page .btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
    font-size: 14px;
}

.auth-page .btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.auth-page .form-label {
    font-weight: 500;
    font-size: 14px;
    color: #495057;
    margin-bottom: 6px;
}

.auth-page .alert {
    border-radius: 8px;
    font-size: 14px;
    padding: 10px 15px;
}

.auth-page .text-muted {
    color: #6c757d !important;
}

/* Styles spécifiques pour les formulaires compacts */
.auth-page .input-group-sm .form-control {
    padding: 6px 10px;
    font-size: 13px;
}

.auth-page .input-group-sm .input-group-text {
    padding: 6px 10px;
    font-size: 13px;
}

.auth-page .form-label.small {
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 2px;
}

.auth-page .form-label.small.mb-1 {
    margin-bottom: 2px;
}

.auth-page .text-muted {
    font-size: 11px;
    margin-top: 2px;
}

.auth-page .form-check-label.small {
    font-size: 12px;
}

.auth-page .text-danger.small {
    font-size: 11px;
}

.auth-page .mb-1 {
    margin-bottom: 8px !important;
}

.auth-page .mb-2 {
    margin-bottom: 12px !important;
}

/* Responsive pour les pages d'authentification */
@media (max-width: 576px) {
    .auth-page .container-fluid {
        padding: 15px;
    }

    .auth-page .card-body {
        padding: 20px !important;
    }

    .auth-page h4 {
        font-size: 1.1rem;
    }

    .auth-page .form-control {
        font-size: 16px; /* Évite le zoom sur iOS */
    }

    .auth-page .input-group-sm .form-control {
        font-size: 16px; /* Évite le zoom sur iOS */
    }
}
