body {
    font-family: sans-serif;
    margin: 0;
    background-color: #f0f2f5;
    color: #1c1e21;
}

header {
    background-color: #fff;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #dddfe2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

header h1 {
    margin: 0;
    font-size: 1.25rem;
}

#emoji-count {
    font-size: 0.8rem;
    font-weight: normal;
    background-color: #e4e6eb;
    color: #606770;
    padding: 2px 6px;
    border-radius: 8px;
    margin-left: 8px;
    vertical-align: middle;
    text-align: center;
}

#searchInput {
    width: 300px;
    padding: 0.5rem;
    border-radius: 20px;
    border: 1px solid #dddfe2;
    font-size: 1rem;
}

#emoji-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.emoji-item {
    background-color: #fff;
    border-radius: 8px;
    padding: 0.5rem;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
    cursor: pointer;
}

.emoji-item:hover {
    transform: scale(1.05);
}

.emoji-item img {
    max-width: 100%;
    height: auto;
}

.emoji-item p {
    margin: 0.5rem 0 0;
    font-size: 0.8rem;
    word-break: break-all;
    color: #606770;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    margin: auto;
    padding: 20px;
    border-radius: 10px;
    width: 80%;
    max-width: 350px;
    text-align: center;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.close-button {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: black;
}

#modal-emoji-img {
    max-width: 150px;
    margin-bottom: 15px;
}

#modal-emoji-name {
    font-weight: bold;
    margin-bottom: 20px;
    word-break: break-all;
    font-size: 1.1rem;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.modal-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background-color 0.2s, transform 0.2s;
}

.modal-actions button:hover {
    transform: translateY(-2px);
}

/* Specific button style for video download (as it's an 'a' tag) */
.modal-button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background-color 0.2s, transform 0.2s;
    background-color: #3BA55D; /* Discord Green */
    color: white;
    text-decoration: none;
    display: inline-block;
}

.modal-button:hover {
    transform: translateY(-2px);
    background-color: #2D7D46;
}

#copyLinkBtn.modal-button {
    background-color: #5865f2; /* Discord Blurple */
}

#copyLinkBtn.modal-button:hover {
    background-color: #4752c4;
}

#copyLinkBtn {
    background-color: #5865f2;
    color: white;
}

#copyLinkBtn:hover {
    background-color: #4752c4;
}

#downloadBtn {
    background-color: #3ba55d;
    color: white;
}

#downloadBtn:hover {
    background-color: #2d7d46;
}

/* Video Gallery Specific Styles */
/* Override the emoji gallery grid for the video page */
main#emoji-gallery.video-gallery {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.video-gallery .video-item {
    background-color: #fff;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    word-break: break-all;
}

.video-gallery .video-item:hover {
    transform: scale(1.05);
}

.video-item .video-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.video-modal-content {
    max-width: 90vw; /* Lebar modal bisa lebih besar untuk video */
    width: auto;
}

#modal-video-player {
    max-width: 100%;
    max-height: 75vh;
    margin-bottom: 15px;
    border-radius: 5px;
}

/* Loader Styles */
#loader {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: #f0f2f5;
    display: flex;
    justify-content: center;
    align-items: center;
}

.spinner {
    border: 8px solid #f3f3f3; /* Light grey */
    border-top: 8px solid #5865f2; /* Blurple */
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding: 0.5rem;
    }

    header h1 {
        font-size: 1.1rem;
        text-align: center;
    }

    #searchInput {
        width: 100%;
        box-sizing: border-box; /* Ensures padding doesn't add to width */
        font-size: 16px; /* Set font size to 16px to prevent auto-zoom on mobile */
    }

    #emoji-gallery {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.5rem;
        padding: 0.5rem;
    }

    .emoji-item {
        padding: 0.25rem;
    }

    .emoji-item p {
        font-size: 10px; /* Using px for very small text can be more precise */
        margin-top: 0.25rem;
    }

    .modal-content {
        width: 90%;
    }
} 