body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: auto;
    position: relative;
}

.background-image {
    position: fixed;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
}

#vanta-birds {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.8;
}

.container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    width: 90%;
    max-width: 1000px;
    padding: 20px;
    margin: 20px auto;
    border-radius: 8px;
    /*background: rgba(255, 255, 255, 0.85);*/
    box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    transform-style: preserve-3d;
    transform: perspective(1000px) rotateX(60deg);
    transition: all 0.5s ease;
}

.container:hover {
    transform: perspective(1000px) rotateX(0deg) scale(1.02);
    box-shadow: 0px 15px 40px rgba(0, 0, 0, 0.4);
}

.box {
    width: 100%;
    min-height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: #333;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease-in-out;
    cursor: pointer;
    background: rgba(241, 241, 241, 0.9);
    border: 1px solid rgba(204, 204, 204, 0.5);
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.15);
    position: relative;
    transform-style: preserve-3d;
    transform: translateZ(0);
    padding: 10px;
    text-align: center;
    word-break: break-word;
}

.box:hover {
    transform: scale(1.05) translateZ(20px);
    box-shadow: 4px 4px 15px rgba(0, 0, 0, 0.3);
}

.box::after {
    content: '✔';
    font-size: 18px;
    color: #3498db;
    position: absolute;
    top: 10px;
    right: 15px;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.box:hover::after {
    opacity: 1;
}

.box.accounting { background-color: rgba(223, 230, 233, 0.9); border-left: 5px solid #3498db; }
.box.home { background-color: rgba(213, 245, 227, 0.9); border-left: 5px solid #2ecc71; }
.box.cctv { background-color: rgba(250, 219, 216, 0.9); border-left: 5px solid #e74c3c; }
.box.album { background-color: rgba(249, 231, 159, 0.9); border-left: 5px solid #f39c12; }
.box.calendar { background-color: rgba(252, 243, 207, 0.9); border-left: 5px solid #f1c40f; }
.box.photos { background-color: rgba(210, 180, 222, 0.9); border-left: 5px solid #8e44ad; }

/* For 8 boxes (4x4) */
.container:has(:nth-child(8):last-child) {
    grid-template-columns: repeat(4, 1fr);
}

/* For 7-8 boxes (3x3x2) */
.container:has(:nth-child(7):last-child),
.container:has(:nth-child(8):last-child) {
    grid-template-columns: repeat(3, 1fr);
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .container {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* For 8 boxes on medium screens (3x3x2) */
    .container:has(:nth-child(8):last-child) {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        grid-template-columns: repeat(2, 1fr);
        width: 95%;
        padding: 15px;
    }
    
    .box {
        min-height: 70px;
        font-size: 14px;
    }
    
    /* For 8 boxes on tablets (4x4) */
    .container:has(:nth-child(8):last-child) {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 600px) {
    .container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* For 8 boxes on small screens (4x4) */
    .container:has(:nth-child(8):last-child) {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .container {
        grid-template-columns: 1fr;
        transform: perspective(1000px) rotateX(0deg);
    }
    
    .box {
        min-height: 60px;
    }
    
    body {
        height: auto;
        padding: 20px 0;
    }
}

/* Mobile touch improvements */
@media (hover: none) {
    .box:hover {
        transform: scale(1) translateZ(0);
    }
    
    .box:active {
        transform: scale(0.98);
    }
}