/* Font e Variabili */
:root {
    --primary: #4CAF50;
    --secondary: #8BC34A;
    --accent: #FFC107;
    --error: #F44336;
    --background: #F5F5F5;
    --text: #333;
    --card-shadow: 0 4px 8px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    padding: 20px;
}

/* Game Container */
.game-container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--card-shadow);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--secondary);
}

.game-header h1 {
    font-size: 2rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.score-box {
    background: var(--primary);
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.2rem;
}

/* Game Board */
.game-board {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.items-container {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.draggable-item {
    background: white;
    border-radius: 12px;
    padding: 15px;
    width: 120px;
    text-align: center;
    cursor: grab;
    transition: var(--transition);
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.draggable-item img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.draggable-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.draggable-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

/* Bins Section */
.bins-container {
    display: flex;
    justify-content: space-around;
    gap: 15px;
}

.bin {
    flex: 1;
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.bin.highlight {
    background: #E8F5E9;
    transform: scale(1.02);
}

.bin-icon img {
    width: 50px;
    height: 50px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.bin-label {
    font-weight: bold;
    color: var(--primary);
    font-size: 1.1rem;
}

.drop-zone {
    width: 100%;
    min-height: 100px;
    border: 2px dashed #BDBDBD;
    border-radius: 8px;
    transition: var(--transition);
}

.drop-zone.active {
    border-color: var(--primary);
    background: rgba(139, 195, 74, 0.1);
}

/* Feedback */
.feedback {
    margin-top: 30px;
    text-align: center;
    display: none;
}

.feedback.success {
    display: block;
    background: #E8F5E9;
    padding: 20px;
    border-radius: 10px;
    animation: fadeIn 0.5s;
}

#feedback-message {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--primary);
}

.game-button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.game-button:hover {
    background: #388E3C;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* SCORM Panel */
.scorm-panel {
    margin-top: 40px;
    background: #F5F5F5;
    padding: 15px;
    border-radius: 8px;
}

.scorm-log {
    max-height: 150px;
    overflow-y: auto;
    background: white;
    padding: 10px;
    margin-top: 10px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 0.9rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Responsive */
@media (max-width: 768px) {
    .game-board {
        flex-direction: column;
    }
    
    .bins-container {
        flex-direction: column;
    }
}

/* Animazioni aggiuntive */
.confetti {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://media4.giphy.com/media/v1.Y2lkPTc5MGI3NjExOGE1YXZkaXExcHh3dGQ5cGxsNWRod2F6cjRreHIxdnlvMWJyNTYzNyZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9dg/recgbnM8e4B9WGqkTN/giphy.gif') center/cover;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.7;
}

.celebration {
    font-size: 1.8rem;
    font-weight: bold;
    margin: 10px 0;
    animation: bounce 0.5s infinite alternate;
}

/* Effetti per gli elementi corretti */
.correct {
    position: relative;
}

.correct::after {
    content: "✓";
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--primary);
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}