.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.show {
    opacity: 1;
    transform: translateY(0);
}

.post-author-avatar {
    min-width: 50px;
    max-height: 50px;
    margin-right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e0e0e0;
    font-weight: bold;
    font-size: 16px;
    color: #333;
}

.post-author-avatar img {
    border-radius: 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}


.small-thumb-img img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 50% !important;
    overflow: hidden;
}

#village-data-summary .village-data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

#village-data-summary .village-data-card {
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.06);
    background-color: #fff;
    border-left: 6px solid transparent;
    transition: transform 0.2s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

#village-data-summary .village-data-card:hover {
    transform: translateY(-4px);
}

#village-data-summary .village-data-card .icon-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: #374151;
}

#village-data-summary .village-data-card .icon-label .icon {
    font-size: 1.5rem;
}

#village-data-summary .village-data-card .value {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
}

.date-note {
    font-size: 1rem;
    font-style: italic;
    padding: 4px 8px;
    border-radius: 4px;
}

/* button */
button.xbtn,
a.xbtn,
input[type="submit"].xbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    border-radius: 0.75rem;
    padding: 1.2rem 1.5rem;
    font-size: 1.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    user-select: none;
}

.xbtn-primary {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.xbtn-primary:hover {
    background-color: #4a78e0;
}

.xbtn-secondary {
    background-color: var(--color-secondary);
    color: var(--color-white);
}

.xbtn-secondary:hover {
    background-color: #ff658f;
}

.xbtn-tertiary {
    background-color: var(--color-tertiary);
    color: var(--color-white);
}

.xbtn-tertiary:hover {
    background-color: #f9a4b3;
}

.xbtn-success {
    background-color: var(--color-success);
    color: var(--color-white);
}

.xbtn-success:hover {
    background-color: #34a94f;
}

.xbtn-danger {
    background-color: var(--color-danger);
    color: var(--color-white);
}

.xbtn-danger:hover {
    background-color: #e60000;
}

.xbtn-warning {
    background-color: var(--color-warning);
    color: var(--color-white);
}

.xbtn-warning:hover {
    background-color: #ff9d58;
}

.xbtn-info {
    background-color: var(--color-info);
    color: var(--color-white);
}

.xbtn-info:hover {
    background-color: #1895cb;
}

.xbtn-outline-primary {
    background-color: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.xbtn-outline-primary:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.xbtn-outline-secondary {
    background-color: transparent;
    border: 2px solid var(--color-secondary);
    color: var(--color-secondary);
}

.xbtn-outline-secondary:hover {
    background-color: var(--color-secondary);
    color: var(--color-white);
}

.xbtn-outline-tertiary {
    background-color: transparent;
    border: 2px solid var(--color-tertiary);
    color: var(--color-tertiary);
}

.xbtn-outline-tertiary:hover {
    background-color: var(--color-tertiary);
    color: var(--color-white);
}

.xbtn-outline-success {
    background-color: transparent;
    border: 2px solid var(--color-success);
    color: var(--color-success);
}

.xbtn-outline-success:hover {
    background-color: var(--color-success);
    color: var(--color-white);
}

.xbtn-outline-danger {
    background-color: transparent;
    border: 2px solid var(--color-danger);
    color: var(--color-danger);
}

.xbtn-outline-danger:hover {
    background-color: var(--color-danger);
    color: var(--color-white);
}

.xbtn-outline-warning {
    background-color: transparent;
    border: 2px solid var(--color-warning);
    color: var(--color-warning);
}

.xbtn-outline-warning:hover {
    background-color: var(--color-warning);
    color: var(--color-white);
}

.xbtn-outline-info {
    background-color: transparent;
    border: 2px solid var(--color-info);
    color: var(--color-info);
}

.xbtn-outline-info:hover {
    background-color: var(--color-info);
    color: var(--color-white);
}

.xbtn-sm {
    font-size: 0.875rem !important;
    padding: 0.5rem 1rem !important;
}

.xbtn-lg {
    font-size: 1.25rem !important;
    padding: 1rem 2rem !important;
}

/* invalid feedback */
.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #e85347;
}

/* radio button */
.radio-option {
    display: inline-block;
    margin-right: 10px;
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-option label {
    display: inline-block;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 11.5px 16px;
    font-size: 14px;
    font-weight: 400;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    min-width: 100px;
    text-align: center;
    user-select: none;
}

.radio-option label:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
    color: #374151;
}

.radio-option label:active {
    background-color: #f3f4f6;
    transform: translateY(1px);
}

.radio-option input[type="radio"]:focus+label {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.radio-option input[type="radio"]:checked+label {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
}

.radio-option input[type="radio"]:checked+label:hover {
    background-color: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

/* address card */
.card-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.address-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    position: relative;
    transition: box-shadow 0.2s ease;
}

.address-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.location-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.default-badge {
    color: #3577f0;
    background-color: transparent;
    border: 1px solid #3577f0;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
}

.address-info {
    margin-bottom: 20px;
}

.address-line {
    color: #666;
    line-height: 1.4;
    margin-bottom: 4px;
}

.phone {
    color: #666;
    margin-top: 8px;
}

.add-card {
    background: white;
    border: 2px dashed #d0d0d0;
    border-radius: 12px;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-card:hover {
    border-color: #4c5bff;
    background-color: #fafbff;
}

.add-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 24px;
    color: #999;
    transition: all 0.2s ease;
}

.add-card:hover .add-icon {
    background-color: #4c5bff;
    color: white;
}

.add-text {
    color: #4c5bff;
    font-weight: 500;
    font-size: 14px;
}

@media (max-width: 768px) {
    .card-container {
        grid-template-columns: 1fr;
    }

    body {
        padding: 10px;
    }
}

/* modal */

.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-dialog {
    max-width: 800px;
    margin: 1.75rem auto;
}

.modal-content {
    border-radius: 8px;
    border: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.modal-header {
    background-color: #ffffff;
    border-bottom: 1px solid #e5e5e5;
    padding: 20px 24px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.btn-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    opacity: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.2s ease, background-color 0.2s ease;
    position: relative;
}

.btn-close::before {
    content: "×";
    font-size: 30px;
    line-height: 1;
}

.btn-close:focus {
    box-shadow: none;
    opacity: 1;
}

.modal-body {
    padding: 24px;
    color: #666;
    line-height: 1.6;
    font-size: 14px;
    background-color: #ffffff;
}

.modal-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #e5e5e5;
    padding: 20px 24px;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    justify-content: flex-end;
}


.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
    transform: translate(0, -50px) scale(0.95);
}

.modal.show .modal-dialog {
    transform: none;
}

@media (max-width: 576px) {
    .modal-dialog {
        max-width: calc(100% - 2rem);
        margin: 1rem;
    }

    .modal-header {
        padding: 16px 20px;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-footer {
        padding: 12px 20px;
    }
}

/* sweetalert */
.swal2-popup {
    background-color: #fef9f4;
    padding: 20px;
    font-size: 1.2rem;
    width: 600px;
}

.swal2-title {
    color: #333;
    font-size: 2rem;
    font-weight: bold;
}

.swal2-confirm {
    background-color: var(--color-danger);
    color: white;
    padding: 12px 32px;
    border-radius: 10px;
    font-size: 1.1rem;
}

.swal2-cancel {
    background-color: #d1d5db;
    color: #111827;
    padding: 12px 32px;
    border-radius: 10px;
    font-size: 1.1rem;
}

.swal2-popup {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 40px 30px 30px 30px;
    width: 400px;
    max-width: 90vw;
}

.swal2-title {
    color: #2D3748;
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.swal2-html-container {
    font-size: 14px;
    margin: 0 0 30px 0;
}


/* address */
.current-address {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    background: #f9f9f9;
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    cursor: pointer;
}

.address-display {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.address-info strong {
    color: #000;
    font-weight: 600;
}

.address:hover {
    border-color: #007bff;
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.2);
    transform: translateY(-2px);
}

.address.active {
    border-color: #007bff;
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.2);
    transform: translateY(-2px);
}

/* checkout page */
.section {
    margin-bottom: 40px;
}

.section h2 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #333;
}

.order-summary h3 {
    font-size: 16px;
    margin-bottom: 20px;
    color: #333;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.summary-row.total {
    font-weight: 600;
    font-size: 16px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    margin-top: 15px;
}

.product-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.product-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.product-details {
    flex: 1;
}

.product-name {
    font-weight: 500;
    margin-bottom: 5px;
    color: #333;
}

.product-info {
    font-size: 12px;
    color: #666;
    margin-bottom: 2px;
}

.product-price {
    font-weight: 600;
    color: #333;
}

.price-original {
    text-decoration: line-through;
    color: #999;
    margin-right: 5px;
}

@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 15px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}


/* table */
.x-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    border-radius: 8px;
    overflow: hidden;
}

.x-thead {
    background-color: #f5f6fa;
    text-align: left;
}

.x-th,
.x-td {
    padding: 16px 20px;
    white-space: nowrap;
}

.x-th {
    font-weight: 600;
    color: #526484;
    font-size: 13px;
    border-bottom: 1px solid #e5e9f2;
}

.x-tr {
    border-bottom: 1px solid #e5e9f2;
    transition: background-color 0.3s ease;
}

.x-tr:hover {
    background-color: #f7f9fc;
}

.x-td {
    color: #364a63;
    font-weight: 500;
}

/* Responsive wrapper untuk tabel */
.x-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
}

/* Optional: agar scrollbar tidak terlalu besar */
.x-table-wrapper::-webkit-scrollbar {
    height: 6px;
}

.x-table-wrapper::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}
