/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Fredoka', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    transition: background 0.5s ease;
    overflow-x: hidden;
}

/* Day/Night Cycle */
body.night-mode {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

body.day-mode {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

header h1 {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.day-night-toggle button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.day-night-toggle button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Pet Selection Styles */
.pet-selection {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.pet-selection h2 {
    color: white;
    text-align: center;
    margin-bottom: 30px;
    font-size: 2rem;
    font-weight: 600;
}

.pet-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.pet-option {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.pet-option:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.5);
}

.pet-option.selected {
    background: rgba(255, 255, 255, 0.3);
    border-color: #4CAF50;
    transform: scale(1.05);
}

.pet-preview {
    font-size: 3rem;
    margin-bottom: 10px;
    transition: transform 0.3s ease;
}

.pet-option:hover .pet-preview {
    transform: scale(1.2);
}

.pet-option span {
    color: white;
    font-weight: 500;
    font-size: 1.1rem;
}

/* Game Area Styles */
.game-area {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Pet Container Styles */
.pet-container {
    text-align: center;
    margin-bottom: 30px;
}

.pet {
    display: inline-block;
    position: relative;
}

.pet-emoji {
    font-size: 8rem;
    transition: all 0.3s ease;
    animation: bounce 2s infinite;
    transform-origin: center;
}

/* Face change animation */
.pet-emoji.face-change {
    animation: faceChange 0.5s ease;
}

.pet.hungry .pet-emoji {
    animation: shake 0.5s infinite;
    filter: grayscale(0.3);
}

.pet.veryHungry .pet-emoji {
    animation: shake 0.3s infinite;
    filter: grayscale(0.8);
    transform: scale(0.9);
}

.pet.sleepy .pet-emoji {
    animation: sleep 3s infinite;
    opacity: 0.7;
}

.pet.verySleepy .pet-emoji {
    animation: sleep 2s infinite;
    opacity: 0.5;
    transform: scale(0.85);
}

.pet.happy .pet-emoji {
    animation: bounce 1s infinite;
    filter: brightness(1.2);
}

.pet.veryHappy .pet-emoji {
    animation: bounce 0.8s infinite;
    filter: brightness(1.4) saturate(1.3);
    transform: scale(1.1);
}

.pet.sleeping .pet-emoji {
    animation: sleep 4s infinite;
    opacity: 0.6;
    filter: brightness(0.8);
}

.pet-name {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 10px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.pet-status {
    color: #FFD700;
    font-size: 1.2rem;
    font-weight: 500;
    margin-top: 5px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    transition: color 0.3s ease;
}

/* Pet status colors based on state */
.pet.happy .pet-status,
.pet.veryHappy .pet-status {
    color: #4CAF50;
}

.pet.hungry .pet-status,
.pet.veryHungry .pet-status {
    color: #FF6B6B;
}

.pet.sleepy .pet-status,
.pet.verySleepy .pet-status,
.pet.sleeping .pet-status {
    color: #FFA726;
}

.pet.normal .pet-status {
    color: #FFD700;
}

/* Attributes Styles */
.attributes {
    margin-bottom: 30px;
}

.attribute {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.attribute label {
    color: white;
    font-weight: 600;
    min-width: 100px;
    font-size: 1.1rem;
}

.progress-bar {
    flex: 1;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    margin: 0 15px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

#hungerBar {
    background: linear-gradient(90deg, #FF6B6B, #FF8E8E);
}

#happinessBar {
    background: linear-gradient(90deg, #4ECDC4, #44A08D);
}

#energyBar {
    background: linear-gradient(90deg, #FFE66D, #FFD93D);
}

.attribute-value {
    color: white;
    font-weight: 600;
    min-width: 50px;
    text-align: right;
}

/* Interaction Buttons */
.interactions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.action-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.action-btn:active {
    transform: translateY(-1px);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    font-size: 2rem;
}

.btn-text {
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Stats Styles */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    color: white;
    font-weight: 500;
}

.stat-value {
    color: #FFD700;
    font-weight: 600;
}

/* Notifications */
.notifications {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.notification {
    background: rgba(76, 175, 80, 0.9);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideIn 0.5s ease;
    max-width: 300px;
}

.notification.achievement {
    background: rgba(255, 193, 7, 0.9);
}

.notification.warning {
    background: rgba(244, 67, 54, 0.9);
}

/* Reset Button */
.reset-section {
    text-align: center;
}

.reset-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 15px;
    padding: 15px 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
}

.reset-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Animations */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

@keyframes sleep {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
}

@keyframes faceChange {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .pet-emoji {
        font-size: 6rem;
    }
    
    .interactions {
        grid-template-columns: 1fr;
    }
    
    .pet-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    header {
        flex-direction: column;
        gap: 15px;
    }
    
    .pet-emoji {
        font-size: 5rem;
    }
    
    .pet-options {
        grid-template-columns: 1fr;
    }
}
