/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #252e76;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
}

/* Background with overlay */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('images/background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
}

.background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
}

/* Container */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Logo */
.logo {
    margin-bottom: 2rem;
    text-align: center;
}

.logo-img {
    max-width: 250px;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
}

/* Navigation Grid */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 600px;
    width: 100%;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #252e76;
    padding: 30px 20px;
    background-color: white;
    border-radius: 15px;
    transition: all 0.3s ease;
    min-height: 200px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: none;
}

.nav-item:hover, .nav-item:focus {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(37, 46, 118, 0.2);
    outline: none;
}

.nav-icon {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    background-color: transparent;
    padding: 0;
}

.icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.nav-label {
    font-size: 1.2rem;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Touch target optimization for tablets */
@media (max-width: 1024px) {
    .nav-grid {
        gap: 20px;
        max-width: 800px;
        padding: 0 20px;
    }
    
    .nav-item {
        min-height: 250px;
        padding: 30px 20px;
    }
    
    .nav-icon {
        width: 150px;
        height: 150px;
        margin-bottom: 20px;
    }
    
    .nav-label {
        font-size: 1.4rem;
    }
}

/* Landscape optimization */
@media (max-height: 600px) {
    .logo {
        margin-bottom: 1rem;
    }
    
    .logo img {
        max-width: 150px;
    }
    
    .nav-item {
        min-height: 150px;
        padding: 15px;
    }
    
    .nav-icon {
        width: 80px;
        height: 80px;
        margin-bottom: 10px;
    }
}
