/* ===== Variables CSS - Thème Chainsaw & Flames ===== */
:root {
    --primary-color: #dc2626;
    --primary-dark: #991b1b;
    --secondary-color: #78716c;
    --accent-color: #f97316;
    --accent-yellow: #fbbf24;
    --success-color: #16a34a;
    --error-color: #dc2626;
    --background-color: #1c1917;
    --card-background: #292524;
    --text-color: #fafaf9;
    --text-light: #a8a29e;
    --border-color: #44403c;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
    --shadow-fire: 0 0 20px rgba(249, 115, 22, 0.4), 0 0 40px rgba(220, 38, 38, 0.2);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
    --gradient-fire: linear-gradient(135deg, #dc2626 0%, #f97316 50%, #fbbf24 100%);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

ul {
    list-style: none;
}

/* ===== Container ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Header ===== */
.main-header {
    background: linear-gradient(180deg, var(--card-background) 0%, #1c1917 100%);
    box-shadow: var(--shadow), 0 2px 10px rgba(249, 115, 22, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid var(--primary-color);
}

.main-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo-icon {
    font-size: 2rem;
}

.main-nav ul {
    display: flex;
    gap: 30px;
}

.main-nav a {
    font-weight: 500;
    color: var(--text-color);
    transition: var(--transition);
    padding: 8px 0;
    position: relative;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.main-nav a:hover {
    color: var(--primary-color);
}

.main-nav a:hover::after {
    width: 100%;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-color);
    border-radius: 2px;
    transition: var(--transition);
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-align: center;
}

.btn-primary {
    background: var(--gradient-fire);
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    border: none;
}

.btn-primary:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-fire);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ===== Hero Section ===== */
.hero {
    background: 
        linear-gradient(135deg, rgba(28, 25, 23, 0.85) 0%, rgba(41, 37, 36, 0.8) 100%),
        url('../images/chainsaw.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: white;
    padding: 120px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-fire);
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(28, 25, 23, 0.7) 100%);
    pointer-events: none;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-content .highlight {
    color: var(--accent-color);
}

.hero-content p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 30px;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero .btn-secondary {
    border-color: white;
    color: white;
}

.hero .btn-secondary:hover {
    background: white;
    color: var(--primary-color);
}

/* ===== Features Section ===== */
.features {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 50px;
    color: var(--text-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    background: var(--card-background);
    padding: 40px 30px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-fire);
    border-color: var(--accent-color);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
}

.feature-card p {
    color: var(--text-light);
}

/* ===== Products Section ===== */
.latest-products, .products-section {
    padding: 80px 0;
    background: var(--background-color);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.product-card {
    background: var(--card-background);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-fire);
    border-color: var(--primary-color);
}

.product-image {
    height: 200px;
    overflow: hidden;
    background: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-image {
    font-size: 4rem;
    opacity: 0.3;
}

.product-image {
    background: 
        linear-gradient(135deg, rgba(41, 37, 36, 0.7) 0%, rgba(28, 25, 23, 0.5) 100%),
        url('../images/chainsaw.jpg');
    background-size: cover;
    background-position: center;
}

.product-info {
    padding: 20px;
}

.product-category {
    display: inline-block;
    background: var(--background-color);
    color: var(--primary-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 10px;
}

.product-title {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-color);
}

.product-description {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.product-seller {
    color: var(--text-light);
    font-size: 0.85rem;
}

/* ===== Page Header ===== */
.page-header {
    background: 
        linear-gradient(135deg, rgba(28, 25, 23, 0.9) 0%, rgba(41, 37, 36, 0.85) 100%),
        url('../images/chainsaw.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 60px 0;
    text-align: center;
    border-bottom: 3px solid var(--primary-color);
    position: relative;
}

.page-header::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-fire);
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.page-header p {
    opacity: 0.9;
}

/* ===== Products Layout ===== */
.products-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
}

.filters-sidebar {
    background: var(--card-background);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    position: sticky;
    top: 100px;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.results-count {
    color: var(--text-light);
    margin-bottom: 20px;
}

/* ===== Auth Section ===== */
.auth-section {
    padding: 60px 0;
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
}

.auth-container {
    max-width: 450px;
    margin: 0 auto;
    background: 
        linear-gradient(135deg, rgba(41, 37, 36, 0.97) 0%, rgba(28, 25, 23, 0.95) 100%),
        url('../images/chainsaw.jpg');
    background-size: cover;
    background-position: center;
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.auth-tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: var(--background-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.auth-tab.active {
    background: var(--primary-color);
    color: white;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 25px;
}

/* ===== Form Styles ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-light);
    font-size: 0.85rem;
}

/* ===== File Upload ===== */
.file-upload {
    position: relative;
}

.file-upload input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--background-color);
    transition: var(--transition);
}

.file-upload:hover .file-upload-label {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.file-upload-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.file-upload-text {
    color: var(--text-light);
}

.file-preview {
    margin-top: 15px;
}

.file-preview img {
    max-width: 200px;
    border-radius: var(--radius-sm);
}

/* ===== Alerts ===== */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-error {
    background: #fef2f2;
    color: var(--error-color);
    border: 1px solid #fecaca;
}

.alert-success {
    background: #ecfdf5;
    color: var(--success-color);
    border: 1px solid #a7f3d0;
}

/* ===== Sell Section ===== */
.sell-section {
    padding: 60px 0;
}

.sell-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
    align-items: start;
}

.sell-form-container {
    background: 
        linear-gradient(135deg, rgba(41, 37, 36, 0.97) 0%, rgba(28, 25, 23, 0.95) 100%),
        url('../images/chainsaw.jpg');
    background-size: cover;
    background-position: center;
    padding: 35px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.sell-form-container h2 {
    margin-bottom: 25px;
}

.user-products {
    background: var(--card-background);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.user-products h2 {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.user-products-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.user-product-card {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: var(--background-color);
    border-radius: var(--radius-sm);
}

.user-product-image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--border-color);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-product-image .no-image {
    font-size: 2rem;
}

.user-product-info h4 {
    font-size: 0.95rem;
    margin-bottom: 5px;
}

.user-product-price {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 5px;
}

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-available {
    background: #ecfdf5;
    color: var(--success-color);
}

.status-sold {
    background: #fef2f2;
    color: var(--error-color);
}

.status-reserved {
    background: #fffbeb;
    color: var(--accent-color);
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--card-background);
    border-radius: var(--radius);
}

.empty-state.small {
    padding: 30px 15px;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--text-light);
    margin-bottom: 20px;
}

/* ===== Footer ===== */
.main-footer {
    background: 
        linear-gradient(180deg, rgba(12, 10, 9, 0.95) 0%, rgba(28, 25, 23, 0.9) 100%),
        url('../images/chainsaw.jpg');
    background-size: cover;
    background-position: center bottom;
    color: white;
    padding: 60px 0 0;
    margin-top: auto;
    border-top: 3px solid var(--primary-color);
    position: relative;
}

.main-footer::before {
    content: '';
    position: absolute;
    top: -3px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-fire);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--accent-color);
}

.footer-section p {
    opacity: 0.8;
    line-height: 1.8;
}

.footer-section ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-section a {
    opacity: 0.8;
    transition: var(--transition);
}

.footer-section a:hover {
    opacity: 1;
    color: var(--accent-color);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0;
    text-align: center;
    opacity: 0.6;
    font-size: 0.9rem;
}

/* ===== Utilities ===== */
.text-center {
    text-align: center;
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
    .products-layout {
        grid-template-columns: 1fr;
    }

    .filters-sidebar {
        position: static;
    }

    .sell-layout {
        grid-template-columns: 1fr;
    }

    .user-products {
        order: -1;
    }
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--card-background);
        box-shadow: var(--shadow);
        padding: 20px;
    }

    .main-nav.active {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 15px;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .auth-container {
        padding: 25px;
    }

    .sell-form-container {
        padding: 25px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 50px 0;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .hero-buttons .btn {
        width: 100%;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }
}
