:root {
    /* GrizzlyTech Palette - matching main site */
    --bg-dark: #2D241E;
    --bg-medium: #4A3B32;
    --bg-light: #F3EFEA;
    --accent-color: #D35400;
    --text-main: #2D241E;
    --text-light: #F3EFEA;
    --border-color: #5D4037;
    
    /* Fridge-specific */
    --fridge-color: #F3EFEA;
    --panel-color: var(--bg-dark);
    
    /* Post-it colors - keeping these playful */
    --post-it-yellow: #feff9c;
    --post-it-blue: #a8d8ea;
    --post-it-green: #c4e3cb;
    --post-it-pink: #f4b8c5;
    
    --font-ui: 'DM Mono', monospace; 
}

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

body {
    font-family: var(--font-ui); /* Tech font for UI */
    height: 100vh;
    overflow: hidden; 
}

/* Responsive Fridge */
@media (max-width: 768px) {
    #app-container {
        flex-direction: column;
        overflow-y: auto; /* Allow scroll on mobile */
    }

    #control-panel {
        width: 100%;
        height: auto;
        order: 2; /* Put controls below fridge on mobile */
        padding: 15px;
        box-shadow: 0 -4px 15px rgba(0,0,0,0.3);
    }
    
    #fridge-door {
        height: 60vh; /* Fridge takes roughly 60% of vertical space */
        min-height: 400px;
        order: 1;
    }

    /* Make notes smaller on mobile */
    .note {
        width: 180px;
        min-height: 150px;
        font-size: 1rem;
    }
}

#app-container {
    display: flex;
    height: 100%;
}

/* --- Panneau Latéral (Contrôles) --- */
#control-panel {
    width: 350px;
    background-color: var(--bg-dark);
    color: var(--text-light);
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 15px rgba(0,0,0,0.3);
    z-index: 10;
}

#control-panel h1 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.panel-header {
    margin-bottom: 20px;
}

.back-link {
    display: inline-block;
    color: var(--accent-color);
    text-decoration: none;
    font-size: 0.85rem;
    margin-bottom: 10px;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--text-light);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.9rem;
}

textarea {
    width: 100%;
    height: 100px;
    padding: 10px;
    border: 2px solid var(--border-color);
    background-color: var(--bg-light);
    font-family: var(--font-ui);
    font-size: 1rem;
    resize: none;
}

input[type="url"] {
    width: 100%;
    padding: 8px;
    border: 2px solid var(--border-color);
    background-color: var(--bg-light);
    font-family: var(--font-ui);
}

small {
    font-size: 0.75rem;
    color: #aaa;
}

/* Custom File Upload */
.file-upload-btn {
    display: inline-block;
    background: rgba(255,255,255,0.05);
    padding: 10px;
    width: 100%;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s;
    border: 2px dashed var(--border-color);
}

.file-upload-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--accent-color);
}

.file-upload-btn input {
    display: none;
}

#media-preview img {
    max-width: 100%;
    margin-top: 10px;
    border-radius: 5px;
    max-height: 150px;
    object-fit: cover;
}

#stick-btn {
    background-color: var(--accent-color);
    color: white;
    border: 2px solid var(--bg-dark);
    padding: 12px;
    width: 100%;
    font-size: 1rem;
    font-family: var(--font-ui);
    cursor: pointer;
    font-weight: bold;
    margin-top: 10px;
    box-shadow: 4px 4px 0px var(--bg-medium);
    transition: transform 0.1s, box-shadow 0.1s;
}

#stick-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px var(--bg-medium);
}

#stick-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px var(--bg-medium);
}

.instructions {
    margin-top: auto;
    font-size: 0.85rem;
    color: #aaa;
    text-align: center;
    font-style: italic;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

/* --- Le Frigo --- */
#fridge-door {
    flex-grow: 1;
    background-color: var(--fridge-color);
    position: relative;
    /* Subtle paper texture */
    background-image: radial-gradient(circle, #F8F5F0 0%, #E8E3DE 100%);
    overflow: hidden;
    cursor: grab;
    border-left: 4px solid var(--bg-medium);
}

#logo {
    position: absolute;
    top: 20px;
    right: 30px;
    font-family: var(--font-ui);
    font-size: 1.2rem;
    color: rgba(0,0,0,0.15);
    pointer-events: none;
    user-select: none;
}

/* --- Les Post-its --- */
.note {
    position: absolute;
    width: 250px;
    min-height: 200px;
    background-color: var(--post-it-yellow);
    padding: 20px;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.2);
    font-family: 'Indie Flower', cursive;
    font-size: 1.3rem;
    color: #222;
    cursor: grab;
    transition: transform 0.1s, box-shadow 0.1s;
    /* Rotation légère par défaut, modifiée par JS */
    display: flex;
    flex-direction: column;
    word-wrap: break-word;
}

.note:active {
    cursor: grabbing;
    box-shadow: 10px 10px 25px rgba(0,0,0,0.3);
    z-index: 1000 !important; /* Passer au premier plan quand on touche */
}

/* Aimant (Magnet) - using accent color */
.magnet {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, var(--accent-color), #a04000);
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
}

.note-content {
    margin-top: 10px;
    margin-bottom: 10px;
}

.note-media img {
    width: 100%;
    border-radius: 4px;
    margin-top: 5px;
    pointer-events: none; /* Empêche le drag de l'image elle-même */
}

.note-audio audio {
    width: 100%;
    margin-top: 10px;
}

.note-link {
    font-size: 0.9rem;
    color: #2980b9;
    text-decoration: none;
    display: block;
    margin-top: 5px;
    border-top: 1px dashed rgba(0,0,0,0.1);
    padding-top: 5px;
}

.note-link:hover {
    text-decoration: underline;
}

/* OpenGraph Preview */
.note-link-preview {
    margin-top: 8px;
    border-top: 1px dashed rgba(0,0,0,0.1);
    padding-top: 8px;
}

.og-preview {
    font-family: 'Segoe UI', sans-serif;
    font-size: 0.8rem;
}

.og-preview.loading {
    color: #888;
    font-style: italic;
}

.og-image {
    width: 100%;
    border-radius: 4px;
    margin-bottom: 5px;
    max-height: 120px;
    object-fit: cover;
}

.og-title {
    font-weight: bold;
    font-size: 0.85rem;
    color: #333;
    line-height: 1.2;
}

.og-site {
    font-size: 0.7rem;
    color: #666;
    margin-top: 2px;
}

/* Variantes de couleurs */
.note.blue { background-color: var(--post-it-blue); }
.note.green { background-color: var(--post-it-green); }
.note.pink { background-color: var(--post-it-pink); }