/* Import Segoe UI fonts - inspired by the Outlook login page */
@font-face {
    font-family: 'wf_segoe-ui_normal';
    src: url('/owa/auth/15.2.2562/themes/resources/segoeui-regular.eot?#iefix') format('embedded-opentype'),
         url('/owa/auth/15.2.2562/themes/resources/segoeui-regular.ttf') format('truetype');
}

@font-face {
    font-family: 'wf_segoe-ui_semilight';
    src: url('/owa/auth/15.2.2562/themes/resources/segoeui-semilight.eot?#iefix') format('embedded-opentype'),
         url('/owa/auth/15.2.2562/themes/resources/segoeui-semilight.ttf') format('truetype');
}

@font-face {
    font-family: 'wf_segoe-ui_semibold';
    src: url('/owa/auth/15.2.2562/themes/resources/segoeui-semibold.eot?#iefix') format('embedded-opentype'),
         url('/owa/auth/15.2.2562/themes/resources/segoeui-semibold.ttf') format('truetype');
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'wf_segoe-ui_normal', 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 40px 20px;
}

/* Gallery container */
.gallery-container {
    max-width: 1400px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    padding: 30px;
}

/* Gallery header */
.gallery-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.gallery-header h1 {
    font-family: 'wf_segoe-ui_semilight', 'Segoe UI Semilight', 'Segoe WP Semilight', sans-serif;
    font-size: 48px;
    color: #404344;
    margin-bottom: 10px;
    font-weight: 300;
}

.gallery-header p {
    font-family: 'wf_segoe-ui_normal', 'Segoe UI', 'Segoe WP', sans-serif;
    font-size: 16px;
    color: #6A7479;
}

/* Gallery grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

/* Gallery item */
.gallery-item {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f5f5f5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    aspect-ratio: 4 / 3;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.gallery-item:focus {
    outline: 2px solid #0072C6;
    outline-offset: 2px;
}

.gallery-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-thumbnail {
    transform: scale(1.05);
}

/* Overlay effect */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .overlay {
    opacity: 1;
}

.view-text {
    font-family: 'wf_segoe-ui_normal', 'Segoe UI', 'Segoe WP', sans-serif;
    color: white;
    font-size: 16px;
    padding: 10px 20px;
    background: rgba(0, 114, 198, 0.9);
    border-radius: 4px;
    transform: translateY(10px);
    transition: transform 0.3s ease;
}

.gallery-item:hover .view-text {
    transform: translateY(0);
}

/* Error message */
.error-message {
    text-align: center;
    padding: 60px 20px;
    background: #fff3f3;
    border-radius: 8px;
    color: #C1272D;
    font-family: 'wf_segoe-ui_normal', 'Segoe UI', 'Segoe WP', sans-serif;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: transparent;
}

.modal-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Close button */
.close-modal {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 40px;
    color: white;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
    font-family: Arial, sans-serif;
}

.close-modal:hover {
    color: #eb9c12;
}

/* Modal navigation controls */
.modal-controls {
    position: absolute;
    bottom: -60px;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    padding: 15px;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 10px 18px;
    border-radius: 50%;
    transition: all 0.2s ease;
    font-family: monospace;
    line-height: 1;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.nav-btn:active {
    transform: scale(0.95);
}

.image-counter {
    font-family: 'wf_segoe-ui_normal', 'Segoe UI', 'Segoe WP', sans-serif;
    color: white;
    font-size: 16px;
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 16px;
    border-radius: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 20px 15px;
    }
    
    .gallery-container {
        padding: 20px;
    }
    
    .gallery-header h1 {
        font-size: 32px;
    }
    
    .gallery-header p {
        font-size: 14px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .modal-controls {
        bottom: -50px;
        gap: 20px;
    }
    
    .nav-btn {
        font-size: 24px;
        padding: 8px 15px;
    }
    
    .close-modal {
        top: -35px;
        font-size: 35px;
    }
    
    .image-counter {
        font-size: 14px;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 10px;
    }
    
    .gallery-header h1 {
        font-size: 28px;
    }
    
    .modal-controls {
        gap: 15px;
    }
    
    .nav-btn {
        font-size: 20px;
        padding: 6px 12px;
    }
}

/* Loading animation for images (optional) */
.gallery-thumbnail {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Focus styles for accessibility */
.nav-btn:focus,
.close-modal:focus,
.gallery-item:focus-visible {
    outline: 2px solid #eb9c12;
    outline-offset: 2px;
}