/* App-Grid und App-Management Styles */

/* Home Screen App Grid */
.home-screen {
    position: absolute;
    top: 44px;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    flex-direction: column;
    z-index: 1000;
}

.home-screen.active {
    display: flex;
}

.home-screen.show {
    opacity: 1;
    transform: translateY(0);
}

.home-content {
    flex: 1;
    padding: 0px 30px 220px; /* Extra Padding unten für Dock */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(4, 80px); /* Feste Spaltenbreite für konsistente Ausrichtung */
    grid-template-rows: repeat(2, 1fr);
    gap: 70px 180px; /* Angepasste Abstände für feste Breiten */
    max-width: 1100px;
    margin: 40px auto 40px;
    height: 340px; /* Etwas mehr Höhe für größere Abstände */
    justify-content: center; /* Grid-Inhalt zentrieren */
    align-content: start;
}

.app-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0px; /* Kein Gap */
    cursor: pointer;
    transition: all 0.3s ease;
    width: 80px; /* Feste Breite für alle App-Icons */
    height: auto;
    position: relative;
    /* Kein padding oder background - nur das Icon ist anklickbar */
}

.app-icon:hover .app-icon-image {
    transform: scale(1.05); /* 3px Vergrößerung durch scale */
}

.app-icon:active .app-icon-image {
    transform: scale(1.02);
}

.app-icon-circle {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    margin: 0;
    padding: 0;
}

.app-icon-image {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 6px; /* Abgerundete Ecken für das App-Icon-Bild */
    transition: transform 0.2s ease; /* Sanfte Transition für Hover-Effekt */
}

.app-icon-label {
    color: white;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    line-height: 1.2;
    margin: 8px 0 0 0;
    padding: 0 2px;
    width: 80px; /* Feste Breite für konsistentes Layout */
    max-width: 100px;
    min-height: 16px; /* Mindesthöhe für einheitliche Darstellung */
    position: relative;
    top: -5px;
    /* Zentrierte Ausrichtung */
    left: 50%;
    transform: translateX(-50%);
}

/* App Container */
.app-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 1300;
    display: flex;
    flex-direction: column;
}

.app-wrapper {
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    border-radius: 25px 25px 0 0;
}

/* Kamera-App: Transparenter Wrapper */
.app-wrapper.camera-mode {
    background: transparent !important;
    border-radius: 0 !important;
}

.app-wrapper.app-show {
    opacity: 1;
    transform: translateY(0);
}

/* App Home Bar - immer am unteren Rand der Apps */
.app-home-bar {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 5px;
    background: rgba(0, 0, 0, 0.562); /* Standard - wird per JS überschrieben */
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1500;
}

/* Standard Hover für Fallback */
.app-home-bar:hover {
    background: rgb(0, 0, 0);
    height: 6px;
}

.app-home-bar:active {
    transform: translateX(-50%) scale(0.95);
}

/* Home-Bar in Kamera-App - spezielle Behandlung */
.app-wrapper.camera-mode .app-home-bar {
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Home Screen Bar - zum Schließen des Tablets vom Homescreen */
.home-screen-bar {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 5px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1500;
}

.home-screen-bar:hover {
    background: rgb(255, 255, 255);
    height: 6px;
}

.home-screen-bar:active {
    transform: translateX(-50%) scale(0.95);
}

/* Dock Area - iPad-ähnlich */
.dock-area {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    height: 80px;
    width: 300px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 0 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.dock-app {
    width: 70px;
    height: 70px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.dock-app:hover {
     transform: scale(1.05); 
}

.dock-app:active {
    transform: translateY(-8px) scale(1.1);
}

.dock-app-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

/* Responsive Anpassungen */
@media (max-width: 1200px) {
    .app-grid {
        grid-template-columns: repeat(3, 80px);
        gap: 60px 120px;
        justify-content: center;
    }
}

@media (max-width: 900px) {
    .app-grid {
        grid-template-columns: repeat(2, 80px);
        gap: 50px 100px;
        justify-content: center;
    }
    
    .app-icon-circle {
        width: 60px;
        height: 60px;
    }
    
    .app-icon-emoji {
        font-size: 24px;
    }
    
    .app-icon-label {
        font-size: 11px;
        width: 75px;
        max-width: 75px;
    }
}

/* App Loading Animation */
@keyframes appLoadPulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

.app-icon.loading .app-icon-circle {
    animation: appLoadPulse 1s infinite;
}



@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}