/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3498db;
    --primary-dark: #2980b9;
    --accent-color: #f39c12;
    --text-color: #2c3e50;
    --background-color: #ecf0f1;
    --bottle-color: rgba(255, 255, 255, 0.9);
    --bottle-border: #bdc3c7;
    --success-color: #2ecc71;
    --error-color: #e74c3c;
    --card-bg: white;
    --modal-bg: rgba(0, 0, 0, 0.7);
    --star-color: #f1c40f;
    --hint-color: #9b59b6;
    --menu-hover: #f5f5f5;
    --danger-color: #e74c3c;
    --achievement-bg: #f1c40f;
    --achievement-text: #2c3e50;
    --tutorial-dot: #bdc3c7;
    --tutorial-dot-active: #3498db;
    --notification-bg: rgba(52, 152, 219, 0.9);
    --notification-text: white;
}

/* Dark theme colors */
.dark-theme {
    --primary-color: #2980b9;
    --primary-dark: #1f6aa1;
    --accent-color: #d35400;
    --text-color: #ecf0f1;
    --background-color: #2c3e50;
    --bottle-color: rgba(44, 62, 80, 0.8);
    --bottle-border: #34495e;
    --card-bg: #34495e;
    --modal-bg: rgba(0, 0, 0, 0.8);
    --menu-hover: #2c3e50;
    --achievement-bg: #d35400;
    --achievement-text: #ecf0f1;
    --tutorial-dot: #34495e;
    --tutorial-dot-active: #3498db;
    --notification-bg: rgba(41, 128, 185, 0.9);
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: background-color 0.3s ease;
}

.game-container {
    width: 100%;
    max-width: 800px;
    background-color: var(--card-bg);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: background-color 0.3s ease;
    position: relative;
}

/* Header */
header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

header h1 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 2rem;
}

.game-info {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Menu bar */
.menu-bar {
    position: absolute;
    right: 0;
    top: 0;
    display: flex;
    gap: 10px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Timer */
.timer-container {
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: -10px;
}

.best-time {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Bottles container */
.bottles-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    min-height: 200px;
    padding: 20px 0;
}

.bottles-container.mini {
    min-height: 120px;
    transform: scale(0.7);
    margin: -30px 0;
}

/* Bottle styling */
.bottle {
    width: 60px;
    height: 180px;
    background-color: var(--bottle-color);
    border: 3px solid var(--bottle-border);
    border-radius: 5px 5px 30px 30px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.3s ease;
    transform-origin: bottom center;
}

.bottle:hover {
    transform: translateY(-5px);
}

.bottle.selected {
    border-color: var(--accent-color);
    transform: translateY(-10px);
}

.bottle.hint {
    border-color: var(--hint-color);
    box-shadow: 0 0 10px var(--hint-color);
    animation: pulse 1.5s infinite alternate;
}

@keyframes pulse {
    from { box-shadow: 0 0 5px var(--hint-color); }
    to { box-shadow: 0 0 15px var(--hint-color); }
}

.water-section {
    position: absolute;
    width: 100%;
    height: 25%;
    bottom: 0;
    transition: transform 0.5s ease, background-color 0.5s ease;
}

.water-section:nth-child(1) {
    bottom: 0;
}

.water-section:nth-child(2) {
    bottom: 25%;
}

.water-section:nth-child(3) {
    bottom: 50%;
}

.water-section:nth-child(4) {
    bottom: 75%;
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(1px);
}

.btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.9rem;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    text-decoration: underline;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    padding: 0;
}

.btn-link:hover {
    color: var(--primary-dark);
}

/* Level selector */
.level-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.level-selector label {
    font-size: 0.9rem;
}

.level-selector select {
    padding: 5px 10px;
    border-radius: 5px;
    border: 1px solid var(--bottle-border);
    background-color: var(--card-bg);
    color: var(--text-color);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h2 {
    color: var(--accent-color);
    margin-bottom: 15px;
}

.modal-content p {
    margin-bottom: 15px;
}

/* Stars for level completion */
.stars-container {
    margin: 15px 0;
    font-size: 2rem;
    color: var(--star-color);
}

.star.inactive {
    opacity: 0.3;
}

/* Achievement unlocked */
.achievement-unlocked {
    background-color: var(--achievement-bg);
    color: var(--achievement-text);
    padding: 10px;
    border-radius: 5px;
    margin: 15px 0;
    animation: bounce 0.5s ease;
}

.achievement-unlocked h3 {
    margin-bottom: 5px;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* Menu grid */
.menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.menu-btn {
    background-color: var(--card-bg);
    border: 1px solid var(--bottle-border);
    color: var(--text-color);
    padding: 15px;
    border-radius: 5px;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: background-color 0.3s;
}

.menu-btn:hover {
    background-color: var(--menu-hover);
}

.menu-btn.danger {
    color: var(--danger-color);
    border-color: var(--danger-color);
}

.menu-btn.danger:hover {
    background-color: var(--danger-color);
    color: white;
}

/* Achievements container */
.achievements-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 20px;
    text-align: left;
}

.achievement-item {
    padding: 10px;
    border-radius: 5px;
    border: 1px solid var(--bottle-border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.achievement-item.unlocked {
    border-color: var(--star-color);
    background-color: rgba(241, 196, 15, 0.1);
}

.achievement-icon {
    font-size: 1.5rem;
    opacity: 0.3;
}

.achievement-item.unlocked .achievement-icon {
    opacity: 1;
    color: var(--star-color);
}

.achievement-details {
    flex: 1;
}

.achievement-title {
    font-weight: 600;
    margin-bottom: 3px;
}

.achievement-description {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.stat-item {
    padding: 10px;
    border-radius: 5px;
    background-color: rgba(52, 152, 219, 0.1);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.8;
}

.stats-chart {
    margin: 20px 0;
    height: 200px;
}

/* Tutorial */
.tutorial-content {
    max-width: 500px;
}

.tutorial-step {
    display: none;
}

.tutorial-step.active {
    display: block;
}

.tutorial-image {
    height: 150px;
    background-color: rgba(52, 152, 219, 0.1);
    margin: 15px 0;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

#tutorial-image-1 {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="120" height="120" viewBox="0 0 120 120"><rect x="40" y="10" width="40" height="100" rx="5" ry="5" fill="white" stroke="%23bdc3c7" stroke-width="3"/><rect x="45" y="85" width="30" height="20" fill="%233498db"/><rect x="45" y="65" width="30" height="20" fill="%232ecc71"/><rect x="45" y="45" width="30" height="20" fill="%23f1c40f"/><path d="M60,30 L75,15 L80,20 L65,35 Z" fill="%23e74c3c"/><circle cx="60" cy="30" r="10" fill="%23e74c3c" stroke="white" stroke-width="2"/></svg>');
}

#tutorial-image-2 {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="240" height="120" viewBox="0 0 240 120"><rect x="40" y="10" width="40" height="100" rx="5" ry="5" fill="white" stroke="%23bdc3c7" stroke-width="3"/><rect x="45" y="85" width="30" height="20" fill="%233498db"/><rect x="45" y="65" width="30" height="20" fill="%232ecc71"/><rect x="45" y="45" width="30" height="20" fill="%23f1c40f"/><rect x="160" y="10" width="40" height="100" rx="5" ry="5" fill="white" stroke="%23bdc3c7" stroke-width="3"/><rect x="165" y="85" width="30" height="20" fill="%233498db"/><path d="M100,60 L140,60" stroke="%233498db" stroke-width="4" stroke-dasharray="5,5"/><path d="M135,55 L140,60 L135,65" fill="none" stroke="%233498db" stroke-width="4"/></svg>');
}

#tutorial-image-3 {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="240" height="120" viewBox="0 0 240 120"><rect x="40" y="10" width="40" height="100" rx="5" ry="5" fill="white" stroke="%23bdc3c7" stroke-width="3"/><rect x="45" y="85" width="30" height="20" fill="%233498db"/><rect x="45" y="65" width="30" height="20" fill="%232ecc71"/><rect x="160" y="10" width="40" height="100" rx="5" ry="5" fill="white" stroke="%23bdc3c7" stroke-width="3"/><rect x="165" y="85" width="30" height="20" fill="%233498db"/><path d="M100,60 L140,60" stroke="%233498db" stroke-width="4"/><path d="M135,55 L140,60 L135,65" fill="none" stroke="%233498db" stroke-width="4"/><text x="120" y="50" font-family="Arial" font-size="12" text-anchor="middle" fill="%233498db">Same color</text><circle cx="120" cy="85" r="15" fill="%23e74c3c" stroke="white" stroke-width="2"/><path d="M110,85 L130,85" stroke="white" stroke-width="3"/><path d="M120,75 L120,95" stroke="white" stroke-width="3"/></svg>');
}

#tutorial-image-4 {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="240" height="120" viewBox="0 0 240 120"><rect x="40" y="10" width="40" height="100" rx="5" ry="5" fill="white" stroke="%23bdc3c7" stroke-width="3"/><rect x="45" y="25" width="30" height="80" fill="%233498db"/><rect x="100" y="10" width="40" height="100" rx="5" ry="5" fill="white" stroke="%23bdc3c7" stroke-width="3"/><rect x="105" y="25" width="30" height="80" fill="%232ecc71"/><rect x="160" y="10" width="40" height="100" rx="5" ry="5" fill="white" stroke="%23bdc3c7" stroke-width="3"/><rect x="165" y="25" width="30" height="80" fill="%23f1c40f"/><path d="M60,15 L60,5 L180,5 L180,15" stroke="%23f1c40f" stroke-width="2" fill="none"/><path d="M120,5 L120,15" stroke="%23f1c40f" stroke-width="2" fill="none"/><text x="120" y="20" font-family="Arial" font-size="12" text-anchor="middle" fill="%23f1c40f">COMPLETE!</text></svg>');
}

.tutorial-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 20px 0;
}

.tutorial-dots {
    display: flex;
    gap: 5px;
}

.tutorial-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--tutorial-dot);
    cursor: pointer;
    transition: background-color 0.3s;
}

.tutorial-dot.active {
    background-color: var(--tutorial-dot-active);
}

/* Custom level creator */
.custom-level-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.option-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.option-group input {
    width: 100%;
    padding: 5px;
    border-radius: 5px;
    border: 1px solid var(--bottle-border);
    background-color: var(--card-bg);
    color: var(--text-color);
}

.color-picker-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 15px;
    justify-content: center;
}

.color-picker {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--bottle-border);
}

.custom-level-preview {
    margin: 15px 0;
    border: 1px dashed var(--bottle-border);
    padding: 10px;
    border-radius: 5px;
}

.custom-level-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Settings */
.settings-group {
    margin-bottom: 15px;
    text-align: left;
}

.settings-group label {
    display: block;
    margin-bottom: 5px;
}

.settings-group input[type="range"] {
    width: 100%;
}

.settings-group.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-group.checkbox label {
    margin-bottom: 0;
}

/* Notification system */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    background-color: var(--notification-bg);
    color: var(--notification-text);
    padding: 10px 15px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease forwards;
    max-width: 300px;
}

.notification.success {
    background-color: var(--success-color);
}

.notification.error {
    background-color: var(--error-color);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

.notification.removing {
    animation: slideOut 0.3s ease forwards;
}

/* Footer */
footer {
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 10px;
}

/* Animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
}

.shake {
    animation: shake 0.4s ease-in-out;
}

/* Pouring animations - different directions based on position */
@keyframes pour-right {
    0% { transform: translateY(0) rotate(0); }
    25% { transform: translateY(-20px) rotate(25deg); }
    75% { transform: translateY(-30px) rotate(35deg); }
    100% { transform: translateY(0) rotate(0); }
}

@keyframes pour-left {
    0% { transform: translateY(0) rotate(0); }
    25% { transform: translateY(-20px) rotate(-25deg); }
    75% { transform: translateY(-30px) rotate(-35deg); }
    100% { transform: translateY(0) rotate(0); }
}

.pouring {
    animation: pour-right 1s ease-in-out;
    z-index: 10;
}

.pouring.pour-left {
    animation: pour-left 1s ease-in-out;
}

/* Responsive design */
@media (max-width: 600px) {
    .game-container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .bottle {
        width: 50px;
        height: 150px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .game-info {
        font-size: 0.9rem;
    }
    
    .level-selector {
        flex-direction: column;
        gap: 5px;
    }
    
    .menu-grid, .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .custom-level-options {
        grid-template-columns: 1fr;
    }
    
    .custom-level-buttons {
        grid-template-columns: 1fr;
    }
    
    .menu-bar {
        position: relative;
        justify-content: center;
        margin-top: 10px;
    }
} 