/* Villums App - Styles for kids */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Marker Felt', sans-serif;
}

body {
    background-color: #f9f3e5;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    touch-action: manipulation;
    /* Add padding for safe areas on mobile devices */
    padding-bottom: env(safe-area-inset-bottom, 20px);
}

.app-container {
    display: flex;
    flex-direction: column;
    /* Account for safe area insets */
    height: calc(100vh - env(safe-area-inset-bottom, 20px));
}

.top-bar {
    background-color: #ff9933;
    color: white;
    padding: 15px;
    padding-top: calc(15px + env(safe-area-inset-top, 0px));
    text-align: left;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.top-bar h1 {
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 20px;
    padding: 20px;
    /* Add extra padding at bottom to prevent cut-off */
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 20px));
    flex: 1;
}

.grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    border: none;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    padding: 20px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.grid-item:active {
    transform: scale(0.95);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.grid-item img {
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
}

/* Colorful buttons */
#videos {
    background-color: #ff5252; /* Red */
}

#games {
    background-color: #4285f4; /* Blue */
}

#music {
    background-color: #ffca28; /* Yellow */
}

#pictures {
    background-color: #0f9d58; /* Green */
}

#stories {
    background-color: #9c27b0; /* Purple */
}

#drawing {
    background-color: #ff7043; /* Orange */
}

/* For better touch experience */
button {
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

/* Media query for tablets */
@media (max-width: 768px) {
    .grid-item {
        font-size: 1.5rem;
    }
    
    .grid-item img {
        width: 50px;
        height: 50px;
    }
}

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

.grid-item:hover {
    animation: bounce 0.5s ease;
}

/* Handle PWA display modes */
@media all and (display-mode: standalone), 
       all and (display-mode: fullscreen) {
    /* Extra adjustments for PWA mode */
    body {
        /* More bottom padding in PWA mode */
        padding-bottom: env(safe-area-inset-bottom, 30px);
    }
    
    .app-container {
        /* Ensure container has enough room */
        height: calc(100vh - env(safe-area-inset-bottom, 30px));
    }
    
    .grid-container {
        /* Ensure bottom row isn't cut off in PWA mode */
        padding-bottom: calc(30px + env(safe-area-inset-bottom, 30px));
    }
} 