/* M Tự Hào — Frontend styles */

.c35gd-proud-wrap {
    max-width: 1440px;
    margin: 0 auto;
    padding:0 16px 16px 16px;
    font-family: inherit;
    box-sizing: border-box;
}

/* Notices */
.c35gd-proud-notice {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}
.c35gd-proud-notice--error   { background: #fff0f0; border-left: 4px solid #e00; color: #c00; }
.c35gd-proud-notice--success  { background: #f0fff0; border-left: 4px solid #0a0; color: #060; }
.c35gd-proud-notice--info     { background: #f0f4ff; border-left: 4px solid #36f; color: #235; }

/* Form */
.c35gd-proud-form { max-width: 640px; }
.c35gd-proud-form__group { margin-bottom: 10px; }
.c35gd-proud-form__group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
}
.c35gd-proud-form__group textarea,
.c35gd-proud-form__group input[type="url"],
.c35gd-proud-form__group input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color .2s;
}
.c35gd-proud-form__group textarea:focus,
.c35gd-proud-form__group input:focus {
    border-color: #e05c00;
    outline: none;
    box-shadow: 0 0 0 3px rgba(224,92,0,.12);
}
.c35gd-proud-form__group small { font-size: 12px; color: #777; margin-top: 4px; display: block; }
.c35gd-proud-charcount { font-size: 12px; color: #888; }
.c35gd-proud-required { color: #e00; }
.c35gd-proud-form__group--checkbox label { display: flex; align-items: flex-start; gap: 8px; font-weight: normal; }
.c35gd-proud-form__group--checkbox input { margin-top: 3px; flex-shrink: 0; }

/* Buttons */
.c35gd-proud-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: background .2s, transform .1s;
}
.c35gd-proud-btn--submit {
    background: #e05c00;
    color: #fff;
    width: 100%;
    text-align: center;
    font-size: 15px;
    padding: 12px;
}
.c35gd-proud-btn--submit:hover { background: #c44d00; }
.c35gd-proud-btn--submit:disabled { background: #aaa; cursor: not-allowed; }
.c35gd-proud-btn--video {
    background: #1877f2;
    color: #fff;
    width: 100%;
    text-align: center;
    margin: 8px 0;
}
.c35gd-proud-btn--video:hover { background: #145db2; }

/* Filters */
.c35gd-proud-filters { margin-bottom: 20px; }
.c35gd-proud-filters__row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}

/* SELECT - Chon don vi */
.c35gd-proud-select {
    appearance: none;
    -webkit-appearance: none;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23E84C1E' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    border: none;
    border-radius: 50px;
    padding: 10px 36px 10px 18px;
    font-size: 14px;
    color: #888;
    min-width: 180px;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.c35gd-proud-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(232,76,30,0.3);
}

/* INPUT wrapper */
.c35gd-proud-input-wrapper {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.c35gd-proud-input-label {
    background: #fff;
    color: #E84C1E;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 12px 10px 18px;
    white-space: nowrap;
    border-right: 1px solid #eee;
}
.c35gd-proud-input {
    border: none;
    outline: none;
    padding: 10px 8px;
    font-size: 14px;
    color: #333;
    border-radius: 50px;
    background: #fff;
    min-width: 140px;
}
.c35gd-proud-input-clear {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px 14px 10px 4px;
    color: #E84C1E;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
}
.c35gd-proud-input-clear:hover { opacity: 0.7; }

/* Grid */
.c35gd-proud-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}


/*update 24-6*/
/* Card media: image + video btn overlay */
.c35gd-proud-card__media {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
    --aspect-ratio: 6 / 8;
}

.c35gd-proud-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Nút video nằm đè lên ảnh */
.c35gd-proud-video-btn {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.35);
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
    z-index: 2;
}

.c35gd-proud-video-btn:hover {
    background: rgba(0, 0, 0, 0.55);
}

.c35gd-proud-video-btn__icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: #E84C1E;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 3px; /* căn icon play */
}

.c35gd-proud-video-btn__label {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* Khi không có ảnh — nút hiển thị trên nền tối */
.c35gd-proud-card__media:not(:has(.c35gd-proud-card__image)) {
    background: #1a1a1a;
    aspect-ratio: 16 / 5;
}

/* Card */
.c35gd-proud-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.c35gd-proud-card__header {
    display: flex;
    align-items: center;
    gap: 10px;
}
.c35gd-proud-card__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e05c00;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}
.c35gd-proud-card__meta { display: flex; flex-direction: column; gap: 2px; }
.c35gd-proud-card__name { font-size: 14px; }
.c35gd-proud-card__donvi { font-size: 12px; color: #777; }
.c35gd-proud-card__time  { font-size: 11px; color: #aaa; }
.c35gd-proud-card__content {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    word-break: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.c35gd-proud-card__footer { margin-top: auto; display: flex; align-items: center; }

/* Like button */
.c35gd-proud-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid #e5e5e5;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 14px;
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
    color: #555;
}
.c35gd-proud-like-btn:hover:not(:disabled) {
    background: #fff0ec;
    border-color: #e05c00;
    color: #e05c00;
}
.c35gd-proud-like-btn.liked,
.c35gd-proud-like-btn:disabled {
    background: #fff0ec;
    border-color: #e05c00;
    color: #e05c00;
    cursor: default;
}
.c35gd-proud-heart-icon { font-size: 16px; }

/* Iframe — inline card (legacy, kept for fallback) */
.c35gd-proud-iframe { display: block; border-radius: 6px; }

/* Facebook Reel iframe popup — 9:16 portrait */
#rs-fb-iframe-wrap {
    width: 100%;
    max-width: 400px;
    -max-height: 400px;
    margin: 0 auto;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    line-height: 0;
}
#rs-fb-iframe-wrap .fb-video {
    display: block;
    width: 100% !important;
}
#rs-fb-iframe-wrap .fb-video > span {
    display: block !important;
    width: 100% !important;
}
#rs-fb-iframe-wrap .fb-video iframe {
    display: block;
    width: 100% !important;
    border: none;
}

/* Pagination */
.c35gd-proud-pagination { text-align: center; margin-top: 16px; }
.c35gd-proud-page-btn {
    margin: 3px;
    padding: 6px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
}
.c35gd-proud-page-btn.active { background: #e05c00; color: #fff; border-color: #e05c00; }

/* Badge */
.c35gd-proud-badge--published { color: green; font-weight: 600; }
.c35gd-proud-badge--rejected  { color: red; font-weight: 600; }

/* My entry */
.c35gd-proud-my-entry {
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 16px;
    font-size: 14px;
}
.c35gd-proud-my-entry__content {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 12px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.c35gd-proud-loading,.c35gd-proud-empty{ text-align: center; color: #fff; padding: 40px 0; }

/* Admin */
.c35gd-proud-admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0;
}
.c35gd-proud-admin-content-row td { color: #444; }

/* Success state */
.success.text-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 24px;
    text-align: center;
}
.success.text-center img {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
}
.success.text-center .h2 {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}
.success.text-center p {
    font-size: 14px;
    color: #555;
    margin-bottom: 28px;
}
.btn-button-cam {
    width: 100%;
    padding: 14px 24px;
    background-color: #F26522;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: background .2s ease;
}
.btn-button-cam:hover  { background-color: #d9541a; }
.btn-button-cam:active { background-color: #c04a15; transform: translateY(1px); }
    
.wr_btn_mtron{     position: fixed;    bottom: 10px;    right: 30px; z-index:1 }
.btn-m-tron{width: 248px;
    height: 248px;
    cursor: pointer;
    justify-content: flex-end;
    flex-direction: column;
    padding-bottom: 20px;
    border-radius: 50%;
    border: 1px solid #FF8500;
    background: linear-gradient(to bottom, rgb(237 48 1 / 20%), rgb(239 76 22 / 20%) 61%, rgb(255 191 102 / 20%)); }
    .btn-m-tron b{ text-shadow:0px 2px 6px rgb(0 0 0 / 50%); line-height: 30px; font-size:20px; text-align:center; }
.wr_btn_mtron img{ margin-left: -60px;
    animation: mtronShakeX 2.5s infinite;
}

@keyframes mtronShakeX{
    0%, 80%, 100% {
        transform: translateX(0);
    }
    84% {
        transform: translateX(-8px);
    }
    88% {
        transform: translateX(8px);
    }
    92% {
        transform: translateX(-5px);
    }
    96% {
        transform: translateX(5px);
    }
}

/* ============================================================
   Masonry — JS-driven, dùng position absolute
   CSS columns bị clip bởi overflow:hidden của JetEngine/Elementor
   Giải pháp: CSS chuẩn bị container, JS tính toán vị trí từng item
   ============================================================ */

/* Container: position relative để JS đặt item tuyệt đối */
.jet-listing-grid__masonry {
    position: relative !important;
    display: block !important;
    /* width/height do JS set */
    overflow: visible !important;
    /* Reset flex của JetEngine */
    align-items: unset !important;
    flex-wrap: unset !important;
    margin: 0 !important;
}

/* Mỗi item: position absolute, JS set top/left */
.jet-listing-grid__masonry > .jet-listing-grid__item {
    position: absolute !important;
    box-sizing: border-box !important;
    padding: 12px;
    /* flex reset */
    flex: unset !important;
    max-width: unset !important;
}

/* Card full width, chiều cao tự nhiên */
.jet-listing-grid__masonry .c35gd-proud-card {
    height: auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    margin: 0;
}

/* Ảnh giữ nguyên tỉ lệ gốc */
.jet-listing-grid__masonry .c35gd-proud-card__media {
    aspect-ratio: unset;
    height: auto;
}
.jet-listing-grid__masonry .c35gd-proud-card__image {
    width: 100%;
    height: auto;
    object-fit: unset;
    display: block;
}

/* Responsive */
@media (max-width: 600px) {
    .c35gd-proud-grid { grid-template-columns: 1fr; }
    .c35gd-proud-filters__row { flex-direction: column; align-items: stretch; }
    .c35gd-proud-input-wrapper { width: 100%; }
    .c35gd-proud-select { width: 100%; }
    .c35gd-proud-input { min-width: 0; flex: 1; padding-left:18px; }
    .btn-m-tron{ width:108px; height:108px; }
    .btn-m-tron img{ width:58px;  }
    .btn-m-tron b{ font-size:13px; line-height:1.3  }
}
