* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    /* padding: 20px; */
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    background: white;
    padding: 30px 20px 15px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    max-width: 70px;
    height: auto;
    border-radius: 8px;
    display: block;
}

main {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.filter-section {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid #ddd;
    background: white;
    color: #333;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.filter-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    justify-items: center;
}

.gallery-item {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.item-thumbnail {
    width: 100%;
    height: 180px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.item-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-thumbnail video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-icon {
    position: absolute;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667eea;
}

.pdf-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    font-size: 60px;
    font-weight: bold;
    color: white;
}

.item-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.item-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-type {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #667eea;
    font-size: 18px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 0;
    max-width: 100vw;
    max-height: 100vh;
    overflow: hidden;
    position: relative;
    animation: slideIn 0.3s ease;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
}

@keyframes slideIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #667eea;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.close-btn:hover {
    background: #764ba2;
}

#modal-body {
    padding: 0;
    margin: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#modal-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

#modal-body video {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

#modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    display: block;
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
        padding: 15px;
    }

    body {
        padding: 0;
    }

    main {
        padding: 0;
        margin-top: 0;
        border-radius: 0;
        box-shadow: none;
    }

    header {
        padding: 12px 15px;
    }

    .logo-section {
        flex-direction: column;
        gap: 15px;
    }

    .logo {
        max-width: 70px;
    }

    header h1 {
        font-size: 22px;
    }

    .filter-section {
        padding: 0 15px;
    }

    .modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        width: 100vw;
        height: 100vh;
    }

    #modal-body iframe {
        height: 100vh;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
        padding: 15px;
    }

    header {
        padding: 15px 20px;
    }

    .logo {
        max-width: 80px;
    }

    header h1 {
        font-size: 18px;
    }

    main {
        padding: 0;
        margin-top: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .filter-section {
        gap: 8px;
        margin-bottom: 20px;
        padding: 0 15px;
    }

    .filter-btn {
        padding: 8px 15px;
        font-size: 12px;
    }

    .modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        width: 100vw;
        height: 100vh;
    }

    #modal-body iframe {
        height: 100vh;
    }
}
