/* global styles */
* {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

.show {
    display: block !important;
}

.hide {
    display: none !important;
}

body {
    font-family: Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
}

main {
    max-width: 1200px;
    min-height: 680px;
    margin: 15px auto;
    padding: 20px;
}

header {
    background-color: #fff;
    box-shadow: 0 5px 5px rgba(0, 0, 0, 0.1);
    height: 50px;
    position: relative;
    z-index: 100;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: auto;
}

.mobile-menu {
    display: none;
}

.mobile-menu i {
    line-height: 50px;
    padding: 0 18px;
    font-size: 20px;
    cursor: pointer;
    user-select: none;
}

.mobile-menu i:hover {
    background-color: #eee;
}

.logo {
    float: left;
    margin: 0px 10px;
    height: 48px;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    height: 50px;
}

nav li {
    height: 50px;
    line-height: 50px;
    padding: 0 10px;
    cursor: pointer;
}

nav li a {
    padding: 17px 10px;
    color: #333;
}

nav li:hover {
    background-color: #4285f4;
}

nav li:hover a {
    color: #fff;
}

nav a {
    text-decoration: none;
}

.search-container {
    width: 350px;
    z-index: 1;
}

.search-container form {
    display: flex;
    width: 100%;
}

.search-container input[type="text"] {
    padding: 10px;
    margin-right: -5px;
    outline: none;
    font-size: 14px;
    border: 1px solid #ccc;
    width: 250px;
}

.search-container button {
    border: none;
    background-color: #000;
    color: #fff;
    padding: 10px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
    border-top-right-radius: 50px;
    border-bottom-right-radius: 50px;
}

.search-container button:hover {
    background-color: #333;
}

.search-container i {
    margin-right: 10px;
}

.select-dropdown {
    position: absolute;
    background-color: #eee;
    border-radius: 4px;
}

.select-dropdown option {
    font-size: 12px;
    max-width: 250px;
    padding: 8px 24px 8px 10px;
    border: none;
    background-color: transparent;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.certificate {
    position: relative;
    width: 70%;
    min-height: 500px;
    float: left;
    margin-right: 20px;
    border: 1px solid #ccc;
}

#pdfViewer {
    width: 100%;
    /* Đảm bảo canvas co giãn theo section */
    height: auto;
    display: block;
    margin: auto;
}

#error-message {
    position: absolute;
    width: 85%;
    text-align: center;
    font-size: 20px;
    line-height: 200%;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.description {
    text-align: justify;
}

.dialog .close {
    font-size: 20px;
    cursor: pointer;
    user-select: none;
}

.details {
    margin-top: 0;
    margin-bottom: 20px;
}

.details h1 {
    font-size: 25px;
    margin: 0;
}

.details p {
    margin: 5px 0;
    font-size: 16px;
}

.description h2 {
    font-size: 20px;
    margin: 0;
}

.buttons {
    margin-top: 15px;
    display: flex;
    justify-content: space-around;
}

.download,
.share {
    border: none;
    color: #fff;
    padding: 10px;
    text-align: center;
    text-decoration: none;
    font-size: 12px;
    margin: 5px;
    cursor: pointer;
}

.download {
    background-color: #4CAF50;
    /* Green */
}

.download:hover {
    background-color: #3e8e41;
}

.share {
    background-color: #3B5998;
    /* Facebook blue */
}

.share:hover {
    background-color: #2d4373;
}

.dialog {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.2);
    display: none;
}

.dialog-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 20px;
    border-radius: 5px;
    width: 500px;
    height: 250px;
    animation: fadeIn 0.5s ease;
}

.dialog-title {
    font-size: 20px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dialog-body p {
    margin: 20px 5px 15px;
}

.dialog-body form {
    display: flex;
    margin: 35px 0px;
}

.dialog-body form input {
    flex: 1;
    padding: 10px;
    outline: none;
    border: 1px solid #ccc;
    color: #999;
    font-size: 14px;
    overflow-y: scroll;
    height: 38px;
}

.dialog-body form button {
    border: none;
    background-color: #0e8bf1;
    color: #fff;
    padding: 10px;
    cursor: pointer;
    font-size: 16px;
}

footer {
    background-color: #333;
    color: #fff;
    padding: 15px;
}

.footer {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin: 0 20px;
}

/* keyframe fade in */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* responsive styles */
@media screen and (max-width: 880px) {
    .certificate {
        width: 100%;
        min-height: 300px;
        float: none;
        margin-right: 0;
        margin-bottom: 20px;
    }

    #error-message {
        font-size: 16px;
    }

    .footer {
        flex-direction: column;
        margin: 0 10px;
    }

    .mobile-menu {
        display: block;
        position: absolute;
        top: 0;
        right: 0;
    }

    nav ul {
        position: absolute;
        top: 50px;
        left: 0;
        right: 0;
        margin: 5px;
        display: none;
    }

    nav ul li {
        background-color: #f2f2f2;
        color: #000;
        box-shadow: 0 5px 5px rgba(0, 0, 0, 0.2);
    }

    nav .search-container {
        position: absolute;
        top: 50px;
        right: 0;
        animation: fadeIn 0.5s ease;
        display: none;
    }
}