/**
 * Azur Imprim Conception - Styles principaux
 * Design inspiré de azur-imprim.fr
 */

/* ========================================
   Variables CSS
======================================== */
:root {
    --azur-primary: #0d6efd;
    --azur-primary-dark: #0a58ca;
    --azur-secondary: #1e3a5f;
    --azur-dark: #0f1c2e;
    --azur-light: #f8f9fa;
    --azur-accent: #00b4d8;
    --azur-success: #198754;
    --azur-warning: #ffc107;
    --azur-danger: #dc3545;
    --azur-info: #0dcaf0;
    
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Open Sans', sans-serif;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.2);
    
    --border-radius: 8px;
    --border-radius-lg: 16px;
    
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: var(--azur-light);
    padding-top: 80px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    color: var(--azur-secondary);
}

a {
    color: var(--azur-primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--azur-primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* ========================================
   Navigation
======================================== */
.navbar {
    background: linear-gradient(135deg, var(--azur-dark) 0%, var(--azur-secondary) 100%);
    padding: 10px 0;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    min-height: 70px;
}

.navbar.scrolled {
    padding: 8px 0;
    background: var(--azur-dark);
}

.navbar-brand img {
    height: 50px;
    width: auto;
    transition: var(--transition);
}

.navbar-brand:hover img {
    transform: scale(1.05);
}

.navbar-nav .nav-link {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 8px 16px;
    color: rgba(255,255,255,0.9) !important;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: #fff !important;
    background: rgba(255,255,255,0.1);
}

.navbar .dropdown-menu {
    background: var(--azur-dark);
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 10px 0;
}

.navbar .dropdown-item {
    color: rgba(255,255,255,0.8);
    padding: 10px 20px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.navbar .dropdown-item:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.navbar .dropdown-divider {
    border-color: rgba(255,255,255,0.1);
}

/* ========================================
   Buttons
======================================== */
.btn {
    font-family: var(--font-heading);
    font-weight: 600;
    padding: 10px 24px;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--azur-primary) 0%, var(--azur-accent) 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--azur-primary-dark) 0%, var(--azur-primary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.4);
}

.btn-secondary {
    background: var(--azur-secondary);
    border: none;
}

.btn-secondary:hover {
    background: var(--azur-dark);
    transform: translateY(-2px);
}

.btn-outline-primary {
    border: 2px solid var(--azur-primary);
    color: var(--azur-primary);
}

.btn-outline-primary:hover {
    background: var(--azur-primary);
    color: #fff;
    transform: translateY(-2px);
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1.1rem;
}

/* ========================================
   Hero Section
======================================== */
.hero {
    background: linear-gradient(135deg, var(--azur-dark) 0%, var(--azur-secondary) 50%, var(--azur-primary) 100%);
    min-height: 500px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 80px 0;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></svg>') repeat;
    background-size: 50px 50px;
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    color: #fff;
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero .lead {
    color: rgba(255,255,255,0.9);
    font-size: 1.3rem;
    margin-bottom: 30px;
}

.hero-image {
    position: relative;
    z-index: 1;
}

.hero-image img {
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
}

/* ========================================
   Section Styles
======================================== */
.section {
    padding: 80px 0;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 15px;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--azur-primary), var(--azur-accent));
    margin-top: 15px;
    border-radius: 2px;
}

.section-title.text-center::after {
    margin-left: auto;
    margin-right: auto;
}

.section-subtitle {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 40px;
}

/* ========================================
   Cards
======================================== */
.card {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card-img-top {
    height: 200px;
    object-fit: cover;
}

.card-body {
    padding: 25px;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 10px;
}

.card-text {
    color: #666;
    font-size: 0.95rem;
}

/* Product Card */
.product-card {
    position: relative;
}

.product-card .card-img-top {
    height: 220px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.product-card .product-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--azur-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.product-card .badge {
    position: absolute;
    top: 20px;
    left: 20px;
}

/* Project Card */
.project-card {
    border-left: 4px solid var(--azur-primary);
}

.project-card.status-brouillon {
    border-left-color: #6c757d;
}

.project-card.status-soumis {
    border-left-color: #0dcaf0;
}

.project-card.status-bat_envoye {
    border-left-color: #ffc107;
}

.project-card.status-bat_valide {
    border-left-color: #198754;
}

.project-card.status-bat_refuse {
    border-left-color: #dc3545;
}

.project-card.status-termine {
    border-left-color: #198754;
}

/* ========================================
   Category Grid
======================================== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.category-card {
    background: #fff;
    border-radius: var(--border-radius-lg);
    padding: 40px 30px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.category-card .icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--azur-primary) 0%, var(--azur-accent) 100%);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 20px;
    transition: var(--transition);
}

.category-card:hover .icon {
    transform: scale(1.1) rotate(5deg);
}

.category-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.category-card p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0;
}

.category-card .count {
    display: inline-block;
    background: var(--azur-light);
    color: var(--azur-primary);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 15px;
}

/* ========================================
   Forms
======================================== */
.form-control,
.form-select {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--azur-primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

.form-label {
    font-weight: 600;
    color: var(--azur-secondary);
    margin-bottom: 8px;
}

.form-text {
    color: #666;
    font-size: 0.85rem;
}

.input-group-text {
    background: var(--azur-light);
    border: 2px solid #e9ecef;
    border-right: none;
}

/* Auth Form */
.auth-wrapper {
    min-height: calc(100vh - 76px);
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--azur-light) 0%, #e9ecef 100%);
    padding: 40px 0;
}

.auth-card {
    background: #fff;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    max-width: 500px;
    margin: 0 auto;
}

.auth-header {
    background: linear-gradient(135deg, var(--azur-dark) 0%, var(--azur-secondary) 100%);
    padding: 40px;
    text-align: center;
}

.auth-header img {
    max-height: 60px;
    margin-bottom: 20px;
}

.auth-header h1 {
    color: #fff;
    font-size: 1.8rem;
    margin: 0;
}

.auth-body {
    padding: 40px;
}

/* ========================================
   Dashboard
======================================== */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: #fff;
    border-radius: var(--border-radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-card .icon {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
}

.stat-card .icon.primary {
    background: linear-gradient(135deg, var(--azur-primary) 0%, var(--azur-accent) 100%);
}

.stat-card .icon.success {
    background: linear-gradient(135deg, #198754 0%, #20c997 100%);
}

.stat-card .icon.warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
}

.stat-card .icon.info {
    background: linear-gradient(135deg, #0dcaf0 0%, #6f42c1 100%);
}

.stat-card .content h3 {
    font-size: 2rem;
    margin-bottom: 5px;
    color: var(--azur-secondary);
}

.stat-card .content p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

/* ========================================
   Editor
======================================== */
.editor-wrapper {
    display: grid;
    grid-template-columns: 300px 1fr 280px;
    gap: 20px;
    min-height: calc(100vh - 200px);
}

.editor-sidebar {
    background: #fff;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    overflow-y: auto;
}

.editor-canvas {
    background: #fff;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.editor-canvas .canvas-container {
    background: #e9ecef;
    border: 2px dashed #dee2e6;
    border-radius: var(--border-radius);
    position: relative;
}

.editor-tools {
    background: #fff;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 20px;
}

.editor-tools h5 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

/* Zone éditable */
.editable-zone {
    position: absolute;
    border: 2px dashed var(--azur-primary);
    background: rgba(13, 110, 253, 0.05);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--azur-primary);
    text-align: center;
    padding: 5px;
}

.editable-zone:hover {
    background: rgba(13, 110, 253, 0.1);
    border-style: solid;
}

.editable-zone.active {
    border-style: solid;
    border-color: var(--azur-accent);
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.3);
}

.editable-zone.filled {
    border-style: solid;
    border-color: var(--azur-success);
}

/* ========================================
   File Upload
======================================== */
.upload-zone {
    border: 3px dashed #dee2e6;
    border-radius: var(--border-radius-lg);
    padding: 40px;
    text-align: center;
    background: #f8f9fa;
    cursor: pointer;
    transition: var(--transition);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--azur-primary);
    background: rgba(13, 110, 253, 0.05);
}

.upload-zone i {
    font-size: 3rem;
    color: #adb5bd;
    margin-bottom: 15px;
}

.upload-zone p {
    margin: 0;
    color: #666;
}

.upload-zone .btn {
    margin-top: 15px;
}

/* File Preview */
.file-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.file-item {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.file-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.file-item .file-info {
    padding: 10px;
    background: #fff;
}

.file-item .file-name {
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-item .file-size {
    font-size: 0.75rem;
    color: #666;
}

.file-item .btn-delete {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 50%;
    background: rgba(220, 53, 69, 0.9);
    color: #fff;
    border: none;
    font-size: 0.8rem;
    opacity: 0;
    transition: var(--transition);
}

.file-item:hover .btn-delete {
    opacity: 1;
}

/* ========================================
   Status Badges
======================================== */
.badge {
    font-family: var(--font-heading);
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
}

.badge-status-brouillon {
    background: #6c757d;
    color: #fff;
}

.badge-status-soumis {
    background: #0dcaf0;
    color: #000;
}

.badge-status-bat_envoye {
    background: #ffc107;
    color: #000;
}

.badge-status-bat_valide {
    background: #198754;
    color: #fff;
}

.badge-status-bat_refuse {
    background: #dc3545;
    color: #fff;
}

.badge-status-termine {
    background: #198754;
    color: #fff;
}

.badge-status-annule {
    background: #343a40;
    color: #fff;
}

/* ========================================
   Footer
======================================== */
.footer {
    background: linear-gradient(135deg, var(--azur-dark) 0%, var(--azur-secondary) 100%);
    padding: 60px 0 30px;
    margin-top: 80px;
}

.footer-logo {
    max-height: 80px;
}

.footer h5 {
    color: #fff;
    font-size: 1.1rem;
}

.footer-contact {
    color: rgba(255,255,255,0.7);
}

.footer-contact li {
    margin-bottom: 10px;
}

.footer-contact a {
    color: rgba(255,255,255,0.7);
}

.footer-contact a:hover {
    color: #fff;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: #fff;
    padding-left: 5px;
}

.text-light-50 {
    color: rgba(255,255,255,0.5) !important;
}

/* ========================================
   Flash Messages
======================================== */
.flash-messages {
    position: fixed;
    top: 86px;
    left: 0;
    right: 0;
    z-index: 1040;
    padding: 10px 0;
}

.flash-messages .alert {
    margin-bottom: 10px;
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

/* ========================================
   Utilities
======================================== */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--azur-primary) 0%, var(--azur-accent) 100%);
}

.bg-gradient-dark {
    background: linear-gradient(135deg, var(--azur-dark) 0%, var(--azur-secondary) 100%);
}

.text-gradient {
    background: linear-gradient(135deg, var(--azur-primary) 0%, var(--azur-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.divider {
    height: 4px;
    width: 60px;
    background: linear-gradient(90deg, var(--azur-primary), var(--azur-accent));
    border-radius: 2px;
}

.divider.center {
    margin-left: auto;
    margin-right: auto;
}

/* ========================================
   Responsive
======================================== */
@media (max-width: 991px) {
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .editor-wrapper {
        grid-template-columns: 1fr;
    }
    
    .editor-sidebar,
    .editor-tools {
        order: 2;
    }
    
    .editor-canvas {
        order: 1;
    }
}

@media (max-width: 767px) {
    body {
        padding-top: 66px;
    }
    
    .hero {
        min-height: auto;
        padding: 60px 0;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .section {
        padding: 50px 0;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }
    
    .auth-body {
        padding: 30px 20px;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 575px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
}

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

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--azur-light);
    border-top-color: var(--azur-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.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;
}
