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

body {
    font-family: 'Comic Sans MS', cursive, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    color: #333;
    font-size: 2.5em;
}

nav {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 12px 20px;
    background: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    border: none;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-primary {
    background: #2196F3;
}

.creation-zone {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.palette-outils {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 2px dashed #ccc;
}

.outils {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.outil-btn {
    padding: 15px;
    background: #FF9800;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1em;
    transition: all 0.3s ease;
}

.outil-btn:hover {
    background: #F57C00;
    transform: scale(1.05);
}

.bibliotheque h4 {
    margin-bottom: 10px;
    color: #333;
}

.images-disponibles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    max-height: 1200px;
    overflow-y: auto;
}

.image-miniature {
    width: 100%;
    aspect-ratio: 1;
    border: 2px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    cursor: grab;
    transition: all 0.3s ease;
}

.image-miniature:hover {
    transform: scale(1.05);
    border-color: #4CAF50;
}

.image-miniature img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.livre-container {
    background: #e0e0e0;
    padding: 20px;
    border-radius: 10px;
    overflow: auto;
}

.livre {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.page {
    background: white;
    border: 3px solid #333;
    border-radius: 10px;
    padding: 20px;
    min-height: 400px;
    position: relative;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.3);
}

.numero-page {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8em;
}

.contenu-page {
    height: 100%;
    position: relative;
}

.element {
    position: absolute;
    cursor: move;
    user-select: none;
}

.element-image {
    max-width: 150px;
    max-height: 150px;
    border: 2px solid transparent;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.element-image:hover {
    border-color: #4CAF50;
    transform: scale(1.05);
}

.zone-texte {
    padding: 10px;
    border-radius: 10px;
    min-width: 100px;
    min-height: 50px;
    border: 2px dashed #ccc;
    resize: both;
    overflow: auto;
    font-family: 'Comic Sans MS', cursive;
}

.zone-texte:focus {
    outline: none;
    border-style: solid;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 20px;
    border-radius: 15px;
    width: 400px;
    position: relative;
}

.close {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 28px;
    cursor: pointer;
}

#contenuTexte {
    width: 100%;
    height: 150px;
    margin: 15px 0;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-family: 'Comic Sans MS', cursive;
    resize: vertical;
}

.couleurs {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .creation-zone {
        grid-template-columns: 1fr;
    }
    
    .livre {
        grid-template-columns: 1fr;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
    }
}