/* ==========================================================================
   Realtime Comments Styles
   ========================================================================== */

/* Comment List Transitions */
#realtime-comments ul {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

#realtime-comments ul.fade-out {
    opacity: 0;
}

/* Pagination Styles */
.realtime-pagination {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    justify-content: center;
    align-items: center;
}

.realtime-pagination .page-btn,
.realtime-pagination .page-number {
    padding: 5px 10px;
    cursor: pointer;
}

.realtime-pagination .page-number.current {
    font-weight: bold;
}

.realtime-pagination .dots {
    padding: 5px 8px;
    opacity: 0.5;
}

.realtime-pagination .page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ==========================================================================
   RSVP Table Styles
   ========================================================================== */

/* Table Wrapper */
.rsvp-table-wrapper {
    margin: 20px 0;
    font-family: inter;
    font-size: 0.9rem;
}

.rsvp-table-wrapper h3 {
    color: var(--bs-blue);
    margin-bottom: 5px;
    font-size: 18px;
}

/* Custom DataTables Styling - Ucapan Table */
table.rsvp-table thead th {
    background-color: var(--bs-blue) !important;
    color: white !important;
    font-weight: 600;
    border-bottom: 0px solid #005a87;
}

.rsvp-table th,
.rsvp-table td {
    vertical-align: middle !important;
}

table.rsvp-table tbody tr:hover {
    background-color: #e3f2fd !important;
}

table.rsvp-table tbody td {
    padding: 12px 8px;
}

/* Kolom Ucapan - Word Wrap */
table.rsvp-table td.ucapan-cell {
    max-width: 300px;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    overflow-wrap: break-word;
}

/* Custom DataTables Styling - Konfirmasi Table */
table.rsvp-table-konfirmasi thead th {
    background-color: var(--bs-teal) !important;
    color: white !important;
    font-weight: 600;
    border-bottom: 0px solid #3d8b3f;
}

.rsvp-table-konfirmasi th,
.rsvp-table-konfirmasi td {
    vertical-align: middle !important;
}

table.rsvp-table-konfirmasi tbody tr:hover {
    background-color: #e8f5e9 !important;
}

table.rsvp-table-konfirmasi tbody td {
    padding: 12px 8px;
}

/* Responsive control button - Ucapan Table */
table.rsvp-table.dtr-inline.collapsed > tbody > tr > td.dtr-control:before,
table.rsvp-table.dtr-inline.collapsed > tbody > tr > th.dtr-control:before {
    background-color: var(--bs-blue);
    border: 0px solid var(--bs-blue);
    box-shadow: 0 0 3px rgba(0,115,170,0.3);
}

table.rsvp-table.dtr-inline.collapsed > tbody > tr.parent > td.dtr-control:before,
table.rsvp-table.dtr-inline.collapsed > tbody > tr.parent > th.dtr-control:before {
    background-color: #d9534f;
    border-color: #d9534f;
}

/* Responsive control button - Konfirmasi Table */
table.rsvp-table-konfirmasi.dtr-inline.collapsed > tbody > tr > td.dtr-control:before,
table.rsvp-table-konfirmasi.dtr-inline.collapsed > tbody > tr > th.dtr-control:before {
    background-color: var(--bs-teal);
    border: 0px solid var(--bs-teal);
    box-shadow: 0 0 3px rgba(71,168,74,0.3);
}

table.rsvp-table-konfirmasi.dtr-inline.collapsed > tbody > tr.parent > td.dtr-control:before,
table.rsvp-table-konfirmasi.dtr-inline.collapsed > tbody > tr.parent > th.dtr-control:before {
    background-color: #d9534f;
    border-color: #d9534f;
}

/* Child row styling - Both Tables */
table.rsvp-table tr.child,
table.rsvp-table-konfirmasi tr.child {
    background-color: #f8f9fa;
}

table.rsvp-table tr.child ul.dtr-details,
table.rsvp-table-konfirmasi tr.child ul.dtr-details {
    display: block;
    padding-left: 20px;
}

table.rsvp-table tr.child ul.dtr-details > li,
table.rsvp-table-konfirmasi tr.child ul.dtr-details > li {
    border-bottom: 0px solid #e0e0e0;
    padding: 8px 0;
}

table.rsvp-table tr.child span.dtr-title {
    font-weight: bold;
    color: var(--bs-blue);
    display: inline-block;
    min-width: 150px;
}

table.rsvp-table-konfirmasi tr.child span.dtr-title {
    font-weight: bold;
    color: var(--bs-teal);
    display: inline-block;
    min-width: 150px;
}

table.rsvp-table tr.child span.dtr-data,
table.rsvp-table-konfirmasi tr.child span.dtr-data {
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
}

table.dataTable.no-footer {
    border: 0px !important;
}

table.dataTable.row-border>tbody>tr>th, table.dataTable.row-border>tbody>tr>td, table.dataTable.display>tbody>tr>th, table.dataTable.display>tbody>tr>td {
    border: 0px !important;
}

table.dataTable.display>tbody>tr.odd>.sorting_1, table.dataTable.order-column.stripe>tbody>tr.odd>.sorting_1 {
    box-shadow: inset 0 0 0 0 rgba(0, 0, 0, 0.054) !important;
}

table.dataTable.stripe>tbody>tr.odd>*, table.dataTable.display>tbody>tr.odd>* {
    box-shadow: inset 0 0 0 0 rgba(0, 0, 0, 0.054) !important;
}

table.dataTable.display>tbody>tr.even>.sorting_1, table.dataTable.order-column.stripe>tbody>tr.even>.sorting_1 {
    box-shadow: inset 0 0 0 0 rgba(0, 0, 0, 0.054) !important;
}

table td, table th {
    border: 0px !important;
}

table.dataTable>thead>tr>th, table.dataTable>thead>tr>td {
    border: 0px !important
}

thead {
    font-size: 0.9rem;
}

tbody {
    font-size: 0.85rem;
}

table.dataTable {
    margin-bottom: 1rem !important;
}

/* DataTables Pagination */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 5px 10px;
    margin: 2px;
    border-radius: 3px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #ffffff00 !important;
    color: white !important;
    border: 0px solid #0073aa !important;
    font-weight: 600;
    text-decoration: underline !important;
}

/* DataTables Responsive Control Icons */
@media (min-width: 1024px) {
table.dataTable.dtr-column>tbody>tr>td.dtr-control:before,
table.dataTable.dtr-column>tbody>tr>th.dtr-control:before,
table.dataTable.dtr-column>tbody>tr>td.control:before,
table.dataTable.dtr-column>tbody>tr>th.control:before {
        content: none !important;
}
}

table.dataTable.dtr-column.collapsed > tbody > tr > td.dtr-control:before,
table.dataTable.dtr-column.collapsed > tbody > tr > th.dtr-control:before,
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control:before {
    top: 50%;
    left: 0;
    height: 1rem;
    width: 1rem;
    line-height: 1;
    text-indent: -999px!important;
    margin-top: -.675rem;
    margin-right: .675rem;
    display: inline-block;
    position: relative;
    font-size: 1.05rem;
    border: 0;
    box-shadow: none;
    mask-size: 85%;
    -webkit-mask-size: 85%;
    content: ".";
}

:root table.dataTable.dtr-column.collapsed > tbody > tr > td.dtr-control:before,
:root table.dataTable.dtr-column.collapsed > tbody > tr > th.dtr-control:before,
:root table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before,
:root table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control:before,
[data-bs-theme=light] table.dataTable.dtr-column.collapsed > tbody > tr > td.dtr-control:before,
[data-bs-theme=light] table.dataTable.dtr-column.collapsed > tbody > tr > th.dtr-control:before,
[data-bs-theme=light] table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before,
[data-bs-theme=light] table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control:before {
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    background-color: #78829d;
    -webkit-mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3e%3crect opacity='0.3' x='2' y='2' width='20' height='20' rx='5' fill='%2378829D'/%3e%3crect x='10.8891' y='17.8033' width='12' height='2' rx='1' transform='rotate%28-90 10.8891 17.8033%29' fill='%2378829D'/%3e%3crect x='6.01041' y='10.9247' width='12' height='2' rx='1' fill='%2378829D'/%3e%3c/svg%3e");
    mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3e%3crect opacity='0.3' x='2' y='2' width='20' height='20' rx='5' fill='%2378829D'/%3e%3crect x='10.8891' y='17.8033' width='12' height='2' rx='1' transform='rotate%28-90 10.8891 17.8033%29' fill='%2378829D'/%3e%3crect x='6.01041' y='10.9247' width='12' height='2' rx='1' fill='%2378829D'/%3e%3c/svg%3e");
}

[data-bs-theme=dark] table.dataTable.dtr-column.collapsed > tbody > tr > td.dtr-control:before,
[data-bs-theme=dark] table.dataTable.dtr-column.collapsed > tbody > tr > th.dtr-control:before,
[data-bs-theme=dark] table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before,
[data-bs-theme=dark] table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control:before {
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    background-color: #808290;
    -webkit-mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3e%3crect opacity='0.3' x='2' y='2' width='20' height='20' rx='5' fill='%23808290'/%3e%3crect x='10.8891' y='17.8033' width='12' height='2' rx='1' transform='rotate%28-90 10.8891 17.8033%29' fill='%23808290'/%3e%3crect x='6.01041' y='10.9247' width='12' height='2' rx='1' fill='%23808290'/%3e%3c/svg%3e");
    mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3e%3crect opacity='0.3' x='2' y='2' width='20' height='20' rx='5' fill='%23808290'/%3e%3crect x='10.8891' y='17.8033' width='12' height='2' rx='1' transform='rotate%28-90 10.8891 17.8033%29' fill='%23808290'/%3e%3crect x='6.01041' y='10.9247' width='12' height='2' rx='1' fill='%23808290'/%3e%3c/svg%3e");
}

table.dataTable.dtr-column.collapsed > tbody > tr > td.dtr-control.dtr-control-last:before,
table.dataTable.dtr-column.collapsed > tbody > tr > th.dtr-control.dtr-control-last:before,
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control.dtr-control-last:before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control.dtr-control-last:before {
    left: 100%;
    right: 0;
}

table.dataTable.dtr-column.collapsed > tbody > tr.parent > td.dtr-control:before,
table.dataTable.dtr-column.collapsed > tbody > tr.parent > th.dtr-control:before,
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td.dtr-control:before,
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > th.dtr-control:before {
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    background-color: #1b84ff;
    -webkit-mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3e%3crect opacity='0.3' x='2' y='2' width='20' height='20' rx='5' fill='%231B84FF'/%3e%3crect x='6.0104' y='10.9247' width='12' height='2' rx='1' fill='%231B84FF'/%3e%3c/svg%3e");
    mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3e%3crect opacity='0.3' x='2' y='2' width='20' height='20' rx='5' fill='%231B84FF'/%3e%3crect x='6.0104' y='10.9247' width='12' height='2' rx='1' fill='%231B84FF'/%3e%3c/svg%3e");
}

/* Refresh Button Styling */
.refresh-table-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    font-size: 0.9rem !important;
    border: 1px solid #e0e0e0;
    background: #f5f5f5;
    transition: all 0.3s ease;
}

.refresh-table-btn:hover {
    background: #e3f2fd;
    border-color: var(--bs-blue);
}

/* Export Dropdown Styling */
.card-toolbar {
    margin-top: 15px;
}

.dropdown-toggle {
    font-size: 0.9rem !important;
}

.dropdown-menu {
    min-width: 180px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.dropdown-item {
    padding: 8px 16px;
    font-size: 14px;
}

.dropdown-item:hover {
    background-color: #f1faff;
    color: var(--bs-blue);
}

/* Hide default DataTables buttons */
.dt-buttons {
    display: none !important;
}

/* ==========================================================================
   Custom Search Box in Toolbar
   ========================================================================== */

.search-wrapper {
    flex: 1;
    max-width: 400px;
}

/* DataTables filter styling */
.dataTables_filter {
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
}

.dataTables_filter label {
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    white-space: nowrap !important;
}

.dataTables_filter input {
    padding: 0.5rem 0.75rem !important;
    border: 1px solid #ddd !important;
    border-radius: 0.375rem !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 250px !important;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
}

.dataTables_filter input:focus {
    border-color: var(--bs-blue) !important;
    outline: 0 !important;
    box-shadow: 0 0 0 0.2rem rgba(0,115,170,0.25) !important;
}

/* Card toolbar adjustments */
.card-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.75rem 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-wrapper {
        max-width: 100%;
        order: -1; /* Search di atas di mobile */
    }
    
    .dataTables_filter input {
        max-width: 100%;
    }
}

/* Custom Pagination with Ellipsis */
.dataTables_paginate {
    display: flex !important;
    gap: 0.25rem !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 1rem 0 !important;
    flex-wrap: wrap !important;
}

.dataTables_paginate .paginate_button {
    padding: 0.375rem 0.75rem !important;
    min-width: 40px !important;
    text-align: center !important;
    border: 0px solid #dee2e6 !important;
    border-radius: 0.25rem !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    text-decoration: none !important;
    color: #0073aa !important;
    background: white !important;
    margin: 0 !important;
}

.dataTables_paginate .paginate_button:hover:not(.disabled):not(.current) {
    background-color: #e3f2fd !important;
    border-color: #0073aa !important;
}

.dataTables_paginate .paginate_button.current {
    background-color: #0073aa !important;
    color: white !important;
    border-color: #0073aa !important;
    font-weight: 600 !important;
}

.dataTables_paginate .paginate_button.disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    color: #6c757d !important;
}

.dataTables_paginate .ellipsis {
    padding: 0.375rem 0.5rem !important;
    color: #6c757d !important;
    user-select: none !important;
}

/* Responsive */
@media (max-width: 576px) {
    .dataTables_paginate .paginate_button {
        min-width: 35px !important;
        padding: 0.25rem 0.5rem !important;
        font-size: 13px !important;
    }
}

/* ==========================================================================
   RSVP Stats Styles
   ========================================================================== */

/* Cards Style */
.rsvp-stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.stat-card.stat-total {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stat-card.stat-hadir {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.stat-card.stat-tidak-hadir {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
    color: white;
}

.stat-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.2);
    border-radius: 0.5rem;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.stat-percent {
    font-size: 0.875rem;
    margin-top: 0.25rem;
    opacity: 0.9;
}

/* Inline Style */
.rsvp-stats-inline {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.rsvp-stats-inline .stat-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.rsvp-stats-inline .stat-separator {
    color: #dee2e6;
}

.rsvp-stats-inline .stat-hadir {
    color: #28a745;
}

.rsvp-stats-inline .stat-tidak-hadir {
    color: #dc3545;
}

/* List Style */
.rsvp-stats-list {
    margin: 1rem 0;
}

.rsvp-stats-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rsvp-stats-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.rsvp-stats-list li:last-child {
    border-bottom: none;
}

.rsvp-stats-list .stat-label {
    font-weight: 600;
}

.rsvp-stats-list .stat-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.rsvp-stats-list .stat-hadir .stat-value {
    color: #28a745;
}

.rsvp-stats-list .stat-tidak-hadir .stat-value {
    color: #dc3545;
}

/* Responsive */
@media (max-width: 768px) {
    .rsvp-stats-cards {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 1.75rem;
    }
}