/* ======================
   Tower of Hanoi Styles
   ====================== */

/* Base Container Styles */
.tower-of-hanoi-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    position: relative;
    background-color: #f9f9f9;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Game Controls Section */
.game-controls {
    margin: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stats {
    font-size: 1.1em;
    font-weight: 600;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    color: #333;
}

.buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.buttons button, 
.buttons select {
    padding: 8px 15px;
    font-size: 1em;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: #f5f5f5;
    cursor: pointer;
    transition: all 0.2s ease;
}

.buttons button {
    background-color: #4a6fa5;
    color: white;
    border: none;
}

.buttons button:hover {
    background-color: #3a5a8f;
    transform: translateY(-2px);
}

.buttons button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #ccc;
}

.buttons select {
    padding: 8px 12px;
    background-color: white;
}

/* Towers and Disks Layout */
.towers-container {
    display: flex;
    justify-content: space-around;
    margin: 30px 0;
    height: 300px;
    position: relative;
    gap: 20px;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tower {
    width: 22%;
    min-width: 80px;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    border-bottom: 8px solid #666;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tower::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 200px;
    background: linear-gradient(to bottom, #777, #555);
    bottom: 8px;
    z-index: 1;
    border-radius: 6px;
}

.tower:hover::before {
    background: linear-gradient(to bottom, #888, #666);
}

/* Disk Styles */
.disk {
    height: 30px;
    margin: 2px 0;
    border-radius: 15px;
    z-index: 2;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
    color: white;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    user-select: none;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16);
}

/* Disk Colors by Size */
.disk[data-size="1"] { width: 25%; background: linear-gradient(145deg, #FF5252, #e04848); }
.disk[data-size="2"] { width: 35%; background: linear-gradient(145deg, #FF9800, #e08800); }
.disk[data-size="3"] { width: 45%; background: linear-gradient(145deg, #FFEB3B, #e8d432); color: #333; }
.disk[data-size="4"] { width: 55%; background: linear-gradient(145deg, #4CAF50, #3d9c41); }
.disk[data-size="5"] { width: 65%; background: linear-gradient(145deg, #2196F3, #1a80d6); }
.disk[data-size="6"] { width: 75%; background: linear-gradient(145deg, #9C27B0, #8a1fa0); }
.disk[data-size="7"] { width: 85%; background: linear-gradient(145deg, #607D8B, #546e7a); }

.disk.selected {
    opacity: 0.9;
    transform: scale(1.08);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
    z-index: 3;
}

/* Message Display */
.message {
    margin: 20px 0;
    font-size: 1.2em;
    min-height: 30px;
    color: #4CAF50;
    font-weight: 600;
    padding: 10px;
    background-color: #f0f8f0;
    border-radius: 5px;
}

/* Win Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    animation: scaleUp 0.3s ease forwards;
}

.modal h2 {
    color: #4CAF50;
    margin-top: 0;
    font-size: 2em;
}

.modal p {
    font-size: 1.2em;
    margin: 15px 0;
}

.modal button {
    padding: 12px 25px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1em;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.2s ease;
}

.modal button:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Share Buttons */
.share-buttons {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.btn-twitter {
    background-color: #000000;
    color: white;
}

.btn-twitter:hover {
    background-color: #333333;
}

.btn-facebook {
    background-color: #1877f2;
    color: white;
}

.btn-facebook:hover {
    background-color: #166fe5;
}

/* Font Awesome icons */
.fab {
    margin-right: 8px;
}


/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleUp {
    to { transform: scale(1); }
}

/* Confetti Effect */
.confetti {
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: #f00;
    border-radius: 50%;
    pointer-events: none;
    animation: fall 3s linear forwards;
}

@keyframes fall {
    to { transform: translateY(100vh) rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .towers-container {
        height: 250px;
        gap: 10px;
    }
    
    .tower::before {
        height: 180px;
    }
    
    .disk {
        height: 26px;
        font-size: 0.7em;
    }
    
    .game-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .stats {
        justify-content: center;
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .tower-of-hanoi-container {
        padding: 15px;
    }
    
    .towers-container {
        height: 200px;
        padding: 10px;
    }
    
    .tower::before {
        height: 150px;
        width: 10px;
    }
    
    .disk {
        height: 22px;
    }
    
    .buttons button, 
    .buttons select {
        padding: 6px 12px;
        font-size: 0.9em;
    }
}