:root {
    --download-primary: #1598b8;
    --download-primary-dark: #087e9b;
    --download-primary-soft: #e8f8fb;
    --download-success: #51af1c;
    --download-success-dark: #3e9410;
    --download-text: #172136;
    --download-muted: #68758a;
    --download-border: #dce5ee;
    --download-background: #f7f9fc;
    --download-card: #ffffff;
    --download-warning: #f5a623;
    --download-danger: #dc3545;
    --download-radius-lg: 14px;
    --download-radius-md: 10px;
    --download-shadow: 0 16px 42px rgba(25, 43, 68, 0.08);
}

.modern-download-page {
    padding-top: 36px;
    padding-bottom: 64px;
}

.modern-download-layout {
    color: var(--download-text);
}

.modern-download-layout *,
.modern-download-layout *::before,
.modern-download-layout *::after {
    box-sizing: border-box;
}


/* File header */

.modern-file-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    overflow: hidden;
    margin-bottom: 24px;
    background: var(--download-card);
    border: 1px solid var(--download-border);
    border-radius: var(--download-radius-lg);
    box-shadow: var(--download-shadow);
}

.modern-file-main {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
    min-height: 132px;
    padding: 25px 28px;
    background: linear-gradient( 105deg, #e2f5f4 0%, #f4f7ed 100%);
}

.modern-file-icon {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    color: var(--download-primary);
    background: rgba(255, 255, 255, 0.68);
    border-radius: 11px;
}

.modern-file-content {
    min-width: 0;
}

.modern-file-label,
.modern-section-label {
    margin-bottom: 5px;
    color: #10837f;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.modern-file-name {
    margin: 0 0 8px;
    overflow: hidden;
    color: var(--download-text);
    font-size: 27px;
    font-weight: 760;
    letter-spacing: -0.025em;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modern-file-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 17px;
}

.modern-file-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #65758a;
    font-size: 13px;
}

.modern-file-meta-item a {
    color: inherit;
    text-decoration: none;
}

.modern-file-meta-item a:hover {
    color: var(--download-primary-dark);
    text-decoration: underline;
}

.modern-file-side {
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* giữa theo chiều dọc */
    align-items: center;
    /* giữa theo chiều ngang */
    text-align: center;
    min-width: 190px;
    padding: 22px 26px;
    background: #fffdf8;
    border-left: 1px solid var(--download-border);
}

.modern-size-label {
    color: #8c96a6;
    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
}

.modern-size-value {
    margin-top: 3px;
    color: var(--download-text);
    font-size: 25px;
    font-weight: 760;
}

.modern-file-actions {
    display: flex;
    gap: 7px;
    margin-top: 13px;
}

.modern-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    color: #65758a;
    background: #ffffff;
    border: 1px solid var(--download-border);
    border-radius: 8px;
    text-decoration: none;
}

.modern-icon-button:hover {
    color: var(--download-primary-dark);
    background: var(--download-primary-soft);
}

.modern-icon-button-danger:hover {
    color: var(--download-danger);
    background: #fff1f2;
    border-color: #f2bec3;
}

.modern-share-menu {
    min-width: 180px;
    padding: 15px;
}

.modern-share-title {
    margin-bottom: 11px;
    color: var(--download-text);
    font-size: 13px;
    font-weight: 750;
}

.modern-social-buttons {
    display: flex;
    gap: 9px;
}

.modern-social-buttons a {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modern-social-buttons img {
    display: block;
    width: 28px;
    height: 28px;
}


/* Alerts */

.modern-alert {
    margin-bottom: 24px;
    border-radius: var(--download-radius-md);
}

.modern-captcha-wrapper {
    margin-bottom: 24px;
    text-align: center;
}


/* Preview */

.modern-preview-card {
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
    background: #10151e;
    border: 1px solid var(--download-border);
    border-radius: var(--download-radius-lg);
    box-shadow: var(--download-shadow);
}

.modern-preview-card iframe,
.modern-preview-card video {
    width: 100%;
    height: 100%;
}

.modern-preview-card #player_img,
.modern-preview-card #player_code {
    width: 100%;
    height: 100%;
}

.modern-preview-card #player_img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modern-image-preview img {
    width: 100%;
    height: 100%;
    cursor: zoom-in;
    object-fit: contain;
}

.modern-expand-button {
    position: absolute;
    right: 15px;
    bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    color: #ffffff;
    background: rgba(10, 18, 30, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 9px;
}

.modern-audio-preview {
    padding: 28px;
    background: #ffffff;
}

.modern-audio-meta {
    margin-top: 17px;
    text-align: center;
}

.modern-audio-meta h2 {
    margin: 0 0 5px;
    font-size: 18px;
    font-weight: 750;
}


/* Download grid */

.modern-download-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 22px;
    margin-bottom: 24px;
}

.modern-download-information,
.modern-download-action,
.modern-video-information,
.modern-share-card,
.modern-comments-section,
.modern-related-card {
    background: var(--download-card);
    border: 1px solid var(--download-border);
    border-radius: var(--download-radius-lg);
    box-shadow: var(--download-shadow);
}

.modern-download-information {
    padding: 24px;
}

.modern-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.modern-section-heading h2 {
    margin: 0;
    color: var(--download-text);
    font-size: 21px;
    font-weight: 760;
    letter-spacing: -0.02em;
}

.modern-section-heading p {
    margin: 7px 0 0;
    color: var(--download-muted);
    font-size: 14px;
    line-height: 1.6;
}

.modern-size-badge {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    min-height: 31px;
    padding: 5px 11px;
    color: var(--download-primary-dark);
    background: var(--download-primary-soft);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 750;
}

.modern-information-list {
    margin-top: 20px;
    border-top: 1px solid var(--download-border);
}

.modern-information-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 13px 0;
    color: var(--download-muted);
    border-bottom: 1px solid rgba(220, 229, 238, 0.75);
    font-size: 14px;
}

.modern-information-row strong {
    max-width: 60%;
    overflow: hidden;
    color: var(--download-text);
    font-weight: 680;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modern-information-row a {
    color: inherit;
    text-decoration: none;
}

.modern-report-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 17px;
    color: #9a6570;
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
}

.modern-report-link:hover {
    color: var(--download-danger);
}


/* Download action */

.modern-download-action {
    padding: 27px 22px 22px;
    text-align: center;
    background: linear-gradient( 145deg, #eefafb 0%, #fffbed 100%);
}

.modern-download-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    margin-bottom: 16px;
    color: var(--download-primary);
    background: rgba(255, 255, 255, 0.75);
    border-radius: 13px;
}

.modern-download-action h2 {
    margin: 0;
    color: var(--download-text);
    font-size: 21px;
    font-weight: 760;
}

.modern-download-action>p {
    margin: 9px 0 19px;
    color: var(--download-muted);
    font-size: 13px;
    line-height: 1.6;
}

.modern-password-field {
    position: relative;
    margin-bottom: 14px;
}

.modern-password-field svg {
    position: absolute;
    top: 50%;
    left: 13px;
    z-index: 2;
    color: #7c8798;
    transform: translateY(-50%);
}

.modern-password-field input {
    min-height: 48px;
    padding-left: 42px;
    border-color: var(--download-border);
    border-radius: 8px;
}

.modern-download-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 58px;
    padding: 12px 18px;
    color: #ffffff;
    background: linear-gradient( 180deg, #58b91e 0%, var(--download-success) 100%);
    border: 1px solid #429810;
    border-radius: 9px;
    box-shadow: 0 12px 24px rgba(77, 171, 24, 0.23);
    font-size: 16px;
    font-weight: 760;
}

.modern-download-button:hover {
    background: var(--download-success-dark);
}

.modern-button-normal,
.modern-button-countdown {
    align-items: center;
    justify-content: center;
    gap: 9px;
}

.modern-button-normal {
    display: flex;
}

.modern-button-countdown {
    display: none;
}

.modern-button-normal[data-status="disabled"] {
    display: none;
}

.modern-button-countdown[data-status="active"] {
    display: flex;
}

.modern-download-note {
    margin-top: 14px;
    color: #788598;
    font-size: 12px;
}

.modern-premium-link {
    display: inline-block;
    margin-top: 9px;
    color: var(--download-primary-dark);
    font-size: 12px;
    font-weight: 680;
    text-decoration: none;
}

.modern-premium-link:hover {
    text-decoration: underline;
}


/* Video information */

.modern-video-information {
    margin-bottom: 24px;
    padding: 24px;
}

.modern-video-thumbnail {
    overflow: hidden;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
}

.modern-video-thumbnail img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modern-media-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 24px;
}

.modern-media-grid>div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--download-border);
    font-size: 13px;
}

.modern-media-grid span {
    color: var(--download-muted);
}

.modern-media-grid strong {
    color: var(--download-text);
    font-weight: 680;
    text-align: right;
}

.modern-description {
    margin-top: 18px;
}

.modern-description strong {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
}

.modern-description p {
    margin: 0;
    color: var(--download-muted);
    font-size: 13px;
    line-height: 1.65;
}


/* Share code */

.modern-share-card {
    margin-bottom: 24px;
    padding: 24px;
}

.modern-code-tabs {
    display: flex;
    margin-top: 21px;
    overflow-x: auto;
    border: 1px solid var(--download-border);
    border-bottom: 0;
    border-radius: 9px 9px 0 0;
}

.modern-code-tab {
    position: relative;
    flex: 1 0 140px;
    min-height: 46px;
    padding: 9px 14px;
    color: #667389;
    background: #fafbfd;
    border: 0;
    border-right: 1px solid var(--download-border);
    font-size: 13px;
    font-weight: 700;
}

.modern-code-tab:last-child {
    border-right: 0;
}

.modern-code-tab.active {
    color: var(--download-primary-dark);
    background: #ffffff;
}

.modern-code-tab.active::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--download-primary);
    content: "";
}

.modern-code-content {
    border: 1px solid var(--download-border);
    border-radius: 0 0 9px 9px;
}

.modern-code-pane {
    display: none;
}

.modern-code-pane.active {
    display: block;
}

.modern-code-textarea {
    display: block;
    width: 100%;
    min-height: 115px;
    padding: 16px;
    resize: vertical;
    color: #526078;
    background: #ffffff;
    border: 0;
    outline: 0;
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
    line-height: 1.6;
}

.modern-copy-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 41px;
    margin-top: 14px;
    padding: 9px 17px;
    color: #ffffff;
    background: var(--download-primary);
    border: 0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 720;
}

.modern-copy-button:hover {
    background: var(--download-primary-dark);
}


/* Comments */

.modern-comments-section {
    margin-bottom: 24px;
    padding: 24px;
}

.modern-comment-textarea {
    margin-top: 20px;
    border-color: var(--download-border);
}

.modern-comment-button {
    min-height: 42px;
    margin-top: 13px;
    padding: 9px 18px;
    color: #ffffff;
    background: var(--download-primary);
    border: 0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 720;
}


/* Related files */

.modern-related-card {
    position: sticky;
    top: 90px;
    padding: 20px;
}

.modern-related-heading {
    margin-bottom: 14px;
    color: var(--download-text);
    font-size: 17px;
    font-weight: 760;
}

.modern-related-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modern-related-file {
    display: block;
    padding: 11px 12px;
    color: inherit;
    background: #fafbfd;
    border: 1px solid var(--download-border);
    border-radius: 8px;
    text-decoration: none;
}

.modern-related-file:hover {
    background: var(--download-primary-soft);
    border-color: #b9e2eb;
}

.modern-related-name,
.modern-related-size {
    display: block;
}

.modern-related-name {
    overflow: hidden;
    color: var(--download-text);
    font-size: 13px;
    font-weight: 680;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modern-related-size {
    margin-top: 4px;
    color: var(--download-muted);
    font-size: 11px;
}


/* Image modal */

.modern-image-modal {
    position: fixed;
    z-index: 99999;
    inset: 0;
}

#modal-image-cloak {
    position: absolute;
    background: rgba(0, 0, 0, 0.86);
    inset: 0;
}

#modal-image {
    position: absolute;
    top: 50%;
    left: 50%;
    max-width: 92vw;
    max-height: 90vh;
    transform: translate(-50%, -50%);
}

.modern-image-close {
    position: absolute;
    top: 18px;
    right: 20px;
    color: #ffffff;
    background: transparent;
    border: 0;
    font-size: 38px;
    line-height: 1;
}


/* Responsive */

@media (max-width: 991.98px) {
    .modern-download-grid {
        grid-template-columns: 1fr;
    }
    .modern-related-card {
        position: static;
    }
}

@media (max-width: 767.98px) {
    .modern-download-page {
        padding-top: 22px;
        padding-bottom: 40px;
    }
    .modern-file-header {
        grid-template-columns: 1fr;
    }
    .modern-file-main {
        min-height: auto;
        padding: 21px 19px;
    }
    .modern-file-side {
        min-width: 0;
        padding: 17px 20px;
        border-top: 1px solid var(--download-border);
        border-left: 0;
    }
    .modern-file-name {
        font-size: 21px;
    }
    .modern-file-side {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 5px 12px;
    }
    .modern-size-label {
        width: 100%;
    }
    .modern-file-actions {
        margin-top: 0;
        margin-left: auto;
    }
    .modern-download-information,
    .modern-download-action,
    .modern-video-information,
    .modern-share-card,
    .modern-comments-section {
        padding: 19px;
    }
    .modern-media-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 479.98px) {
    .modern-file-main {
        align-items: flex-start;
    }
    .modern-file-icon {
        width: 48px;
        height: 50px;
    }
    .modern-file-icon svg {
        width: 25px;
        height: 29px;
    }
    .modern-file-name {
        font-size: 18px;
    }
    .modern-file-meta {
        flex-direction: column;
        gap: 5px;
    }
    .modern-section-heading {
        flex-direction: column;
    }
    .modern-size-badge {
        align-self: flex-start;
    }
    .modern-information-row {
        flex-direction: column;
        gap: 5px;
    }
    .modern-information-row strong {
        max-width: none;
        text-align: left;
    }
}