body{

margin:0;

min-height:100vh;

background:#0f172a;

color:white;

font-family:Arial, sans-serif;

display:flex;

flex-direction:column;

align-items:center;

}



header{

margin-top:80px;

text-align:center;

}


h1{

font-size:50px;

}


header p{

color:#94a3b8;

font-size:20px;

}



.menu{

margin-top:60px;

display:flex;

gap:30px;

flex-wrap:wrap;

}



.card{

width:280px;

height:220px;

background:#1e293b;

border-radius:20px;

text-decoration:none;

color:white;

display:flex;

flex-direction:column;

justify-content:center;

align-items:center;

transition:.3s;

padding: 15px 0;

}


.card:hover{

transform:scale(1.05);

background:#334155;

}



.icon{

font-size:60px;

}

.drag-handle{

    cursor:grab;

}


.drag-handle:active{

    cursor:grabbing;

}




























/* DASHBOARD */

.dashboard{

    width:100%;
    box-sizing:border-box;

    display:flex;
    flex-wrap:wrap;

    justify-content:center;
    align-items:flex-start;

    gap:20px;
    padding:20px;

    position:relative;
}

.dashboard-loading .dashboard{
    visibility:hidden;
}

.dashboard-loading .slot.active{
    transition:none !important;
}



.slot{

position:absolute;

width:250px;

min-height:250px;

height:auto;

background:#1e293b;

border-radius:20px;

display:flex;

justify-content:center;

align-items:center;

border:2px dashed #475569;

transition:none;

overflow:hidden;

}


/* Slot qui contient un module */

.slot.active{

    border:2px solid #475569;

    padding:0;

    min-height:250px;

    height:auto;

    display:flex;

    flex-direction:column;

    align-items:stretch;

    overflow:hidden;

    will-change:transform;

    cursor:default;

    user-select:none;

    /* box-shadow:0 10px 25px rgba(0,0,0,0.25); */

}

.slot.active > .calculator,
.slot.active > .compter{

    padding:15px;

}

.slot.dragging{

    transition:none !important;

    z-index:1000;

    filter:brightness(1.15);

    transform-origin:center;

}

.slot.locked {
    cursor: default;
}
.slot:hover{

border-color:#6366f1;

background:#263449;

}

.slot button{

width:80px;

height:80px;

border-radius:50%;

border:none;

background:#334155;

color:white;

font-size:40px;

cursor:pointer;

transition:.3s;

}



.slot button:not(.lock-module):not(.delete-module):hover{

background:#6366f1;

transform:scale(1.1);

}



.slot.new-module {
    border: 2px solid #facc15;
}

.slot.new-module .module-header {
    border-bottom: 1px solid #facc15;
}



.lock-module:hover,
.delete-module:hover{

    transform:none;

}

.back{

position:fixed;

top:20px;

left:20px;

color:white;

text-decoration:none;

font-size:18px;

background:#1e293b;

padding:10px 18px;

border-radius:12px;

transition:.3s;

}


.back:hover{

background:#6366f1;

}

/* Boutons Dashboard */


.dashboard-buttons{
    position:fixed;
    left:20px;
    top:50%;
    transform:translateY(-50%);

    display:flex;
    flex-direction:column;
    gap:15px;

    z-index:1000;
}


.dashboard-buttons button{

    padding:15px 30px;

    border:none;

    border-radius:12px;

    background:#334155;

    color:white;

    font-size:18px;

    cursor:pointer;

}



.dashboard-buttons button:hover{

    background:#6366f1;

}



/* Bouton suppresion du module  */
.module-header{

    width:100%;

    height:40px;

    display:flex;

    justify-content:space-between;

    align-items:center;

    padding:0 12px;

    background:#111827;

    border-bottom:1px solid #334155;

    box-sizing:border-box;

    flex-shrink:0;

    cursor:grab;

}

.module-header:first-child{

    border-radius:18px 18px 0 0;

}

.module-title{

    display:flex;

    align-items:center;

    gap:8px;

}


.module-title h3{

    margin:0;

    font-size:18px;

}

.module-actions{

    margin-left:auto;

    display:flex;

    align-items:center;

    gap:6px;

}

.module-header:hover{

    background:#1e293b;

}

.module-header:active{

    cursor:grabbing;

    background:#1e293b;

}





.lock-module,
.delete-module{

    width:30px !important;

    height:30px !important;

    padding:0;

    display:flex;

    justify-content:center;

    align-items:center;

    background:none !important;

    border:none;

    font-size:16px !important;

    color:white;

    cursor:pointer;

    border-radius:8px;

    transition:.2s;

}

.lock-module:hover,
.delete-module:hover{

    background:rgba(255,255,255,0.08) !important;

}

.slot.locked .lock-module{

    opacity:0.8;

}

.delete-module:hover{

    color:red;

}
.drag-icon{

    width:18px;

    height:18px;

    display:flex;

    align-items:center;

    justify-content:center;

    color:#64748b;

    font-size:20px;

    opacity:0.7;

}

.calculator-screen,
.buttons{

    margin-left:15px;
    margin-right:15px;

}












/* POPUP */


.popup{

display:none;

position:fixed;

top:0;

left:0;

width:100%;

height:100%;

background:rgba(0,0,0,0.7);

justify-content:center;

align-items:center;

}



.popup-content{

background:#1e293b;

padding:40px;

border-radius:20px;

display:flex;

flex-direction:column;

gap:20px;

}



.popup-content button{

width:100%;

padding:15px;

border:none;

border-radius:10px;

background:#334155;

color:white;

cursor:pointer;

font-size:18px;

}


.popup-content button:hover{

background:#6366f1;

}










/* SETTINGS*/
.module-button{

display:inline-block;

margin-top:15px;

padding:12px 25px;

border-radius:12px;

background:#334155;

color:white;

text-decoration:none;

font-size:16px;

transition:.3s;

}


.module-button:hover{

background:#6366f1;

transform:scale(1.05);

}


.module-error-slot{

display:flex;

justify-content:center;

align-items:center;

width:250px ;

height:250px ;

color:#334155;

font-size:18px;

background-color: #f87171;

text-align:center;

}

.module-actions{

    display:flex;

    gap:8px;

    align-items:center;

}




/* Curseur déplacement */

.slot:not(.locked) .drag-handle{

    cursor:grab;

}


/* Curseur module verrouillé */

.slot.locked .drag-handle{

    cursor:default;

}


