/* Base Container Styles */
.news-container {
    display: grid;
    gap: 0.5rem;
    padding: 0.5rem;
}

/* Card Styles */
.news-card {
    background: white;
    border-radius: 0;
    padding: 0.75rem;
    box-shadow: none;
    border: 1px solid #e5e7eb;
    margin-bottom: 0.25rem;
}

.news-content {
    display: grid;
    grid-template-columns: 50px minmax(200px, 2fr) minmax(100px, 1fr) 100px 80px 80px 160px;
    align-items: center;
    gap: 0.5rem;
}

.news-number {
    background: #f3f4f6;
    padding: 0.25rem 0.75rem;
    border-radius: 0;
    font-size: 0.875rem;
    color: #6b7280;
    text-align: center;
}

.news-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Header untuk label kolom */
.news-header {
    display: grid;
    grid-template-columns: 50px minmax(200px, 2fr) minmax(100px, 1fr) 100px 80px 80px 160px;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 0;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #4b5563;
}

/* Badges dan Status */
.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 0;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.badge-category {
    background-color: #e0e7ff;
    color: #4f46e5;
}

.status-icon-btn {
    padding: 0.4rem;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-public {
    background-color: #dcfce7;
    color: #15803d;
}

.btn-pribadi {
    background-color: #fef3c7;
    color: #92400e;
}

.btn-khusus {
    background-color: #fee2e2;
    color: #dc2626;
}

/* Action Buttons */
.action-btn {
    padding: 0.4rem;
    border-radius: 0;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.15rem;
    width: 32px;
    height: 32px;
}

.btn-view {
    background-color: #dbeafe;
    color: #2563eb;
}

.btn-edit {
    background-color: #fef3c7;
    color: #92400e;
}

.btn-delete {
    background-color: #fee2e2;
    color: #dc2626;
}

.news-actions {
    display: flex;
    gap: 0.15rem;
    align-items: center;
    justify-content: flex-end;
}

.news-actions form {
    display: inline;
    margin: 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 0;
}

.empty-state i {
    font-size: 3rem;
    color: #9ca3af;
    margin-bottom: 1rem;
}

.empty-state p {
    color: #6b7280;
}

/* Filter Card */
.filter-card {
    border-radius: 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .news-content {
        grid-template-columns: 50px 1fr;
        gap: 0.5rem;
    }
    
    .news-header {
        display: none;
    }
    
    .news-card {
        padding: 1rem;
    }
    
    .news-content > div:not(.news-number):not(.news-title) {
        grid-column: 1 / -1;
    }
    
    .news-actions {
        display: flex;
        justify-content: flex-start;
        margin-top: 0.5rem;
        gap: 0.5rem;
    }
}

.news-actions a, 
.news-actions button {
    margin: 0 5px;
    cursor: pointer;
}

.news-actions i:hover,
.news-status i:hover {
    opacity: 0.8;
}

.news-status i {
    cursor: default;
}

/* Icon Colors */
.news-status i.fa-globe-americas {
    color: #15803d;  /* green */
}

.news-status i.fa-user-shield {
    color: #92400e;  /* orange */
}

.news-status i.fa-user-lock {
    color: #dc2626;  /* red */
}

.news-actions i.fa-users {
    color: #2563eb;  /* blue */
}

.news-actions i.fa-eye {
    color: #6366f1;  /* indigo */
}

.news-actions i.fa-edit {
    color: #92400e;  /* orange */
}

.news-actions i.fa-trash {
    color: #dc2626;  /* red */
}

.news-actions a:hover i,
.news-actions button:hover i {
    opacity: 0.8;
}

/* Remove old button styles */
.btn-view, .btn-edit, .btn-delete, 
.btn-public, .btn-pribadi, .btn-khusus,
.status-icon-btn, .action-btn {
    background: none;
    padding: 0;
    width: auto;
    height: auto;
}

/* Table Container Styles */
.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Table Header Styles */
.table-header {
    display: grid;
    grid-template-columns: 60px 2fr 1fr 1fr 100px 1fr 120px;
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: bold;
}

.header-cell {
    padding: 12px 16px;
    color: #495057;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Table Body Styles */
.table-body {
    background-color: white;
}

.table-row {
    display: grid;
    grid-template-columns: 60px 2fr 1fr 1fr 100px 1fr 120px;
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.2s;
}

.table-row:hover {
    background-color: #f8f9fa;
}

.table-cell {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    color: #212529;
    font-size: 0.95rem;
}

/* Badge Styles */
.badge-category {
    background-color: #6c757d;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Action Buttons Styles */
.action-buttons {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 6px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.action-btn:hover {
    opacity: 0.8;
}

.btn-view {
    background-color: #17a2b8;
}

.btn-edit {
    background-color: #ffc107;
}

.btn-delete {
    background-color: #dc3545;
}

/* Empty State Styles */
.empty-state {
    padding: 40px;
    text-align: center;
    color: #6c757d;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 1rem;
    margin: 0;
}

/* Filter Card Styles */
.filter-card {
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.filter-input {
    border-radius: 0 4px 4px 0;
    border: 1px solid #ced4da;
}

.filter-input:focus {
    box-shadow: none;
    border-color: #86b7fe;
}

/* Pagination Styles */
.pagination {
    margin: 0;
}

.page-link {
    padding: 8px 12px;
    color: #007bff;
    background-color: #fff;
    border: 1px solid #dee2e6;
}

.page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
}

.page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    background-color: #fff;
    border-color: #dee2e6;
}

.pagination-info {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
    .table-header,
    .table-row {
        grid-template-columns: 60px 2fr 1fr 1fr 80px 1fr 100px;
    }
}

@media (max-width: 992px) {
    .table-header,
    .table-row {
        grid-template-columns: 50px 2fr 1fr 1fr 70px 120px;
    }
    
    .header-cell:nth-child(4),
    .table-cell:nth-child(4) {
        display: none;
    }
}

@media (max-width: 768px) {
    .table-header,
    .table-row {
        grid-template-columns: 50px 2fr 1fr 70px 100px;
    }
    
    .header-cell:nth-child(4),
    .table-cell:nth-child(4),
    .header-cell:nth-child(6),
    .table-cell:nth-child(6) {
        display: none;
    }
}

@media (max-width: 576px) {
    .table-header,
    .table-row {
        grid-template-columns: 2fr 100px;
        gap: 8px;
    }
    
    .header-cell:not(:nth-child(2)):not(:last-child),
    .table-cell:not(:nth-child(2)):not(:last-child) {
        display: none;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 4px;
    }
}

.table-list td {
    max-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle !important;
}

.table-list th {
    white-space: nowrap;
    background-color: #f8f9fa;
}

.table-list .text-truncate {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tambahkan hover tooltip untuk melihat teks lengkap */
.table-list td:hover {
    position: relative;
}

.table-list td:hover::after {
    content: attr(title);
    position: absolute;
    left: 0;
    top: 100%;
    z-index: 1;
    background: #fff;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    white-space: nowrap;
    display: none; /* Sembunyikan tooltip by default */
}

.table-list td[title]:hover::after {
    display: block; /* Tampilkan tooltip saat hover */
}

/* Table scroll styles */
.table-scroll {
    position: relative;
    width: 100%;
    z-index: 1;
    margin: auto;
    overflow-x: auto; /* Ubah ke overflow-x saja */
    overflow-y: hidden; /* Hindari scroll vertikal */
    /* Tambahkan smooth scroll */
    scroll-behavior: smooth;
}

.table-scroll::-webkit-scrollbar {
    height: 6px; /* Lebih kecil agar tidak terlalu mencolok */
}

.table-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.table-scroll::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.table-scroll::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.table-list {
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.table-list th,
.table-list td {
    padding: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle !important;
    max-width: 0; /* Penting untuk text truncation */
}

/* Freeze first column option */
.table-list th:first-child,
.table-list td:first-child {
    position: sticky;
    left: 0;
    background-color: #fff;
    z-index: 1;
}

.table-list th:first-child {
    background-color: #f8f9fa;
    z-index: 2;
}

/* Hover styles */
.table-list tbody tr:hover {
    background-color: #f8f9fa;
}

/* Remove old tooltip styles */
.table-list td:hover::after {
    display: none;
}

/* Perbaikan layout utama */
.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    min-width: 0; /* Penting untuk mencegah overflow */
    overflow-x: hidden; /* Mencegah horizontal scroll pada main content */
}

/* Perbaikan container fluid */
.container-fluid {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
    max-width: 100%;
}

/* Perbaikan card styles */
.card {
    margin-bottom: 1rem;
    border: none;
    box-shadow: 0 0 0.875rem 0 rgba(33,37,41,.05);
}

.card-body {
    padding: 1.25rem;
    min-width: 0; /* Penting untuk text truncation */
}

/* Table responsive wrapper */
.table-responsive {
    min-width: 100%;
    margin-bottom: 0;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .wrapper {
        display: block; /* Stack layout on mobile */
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
}

/* Table Styles */
.table-scroll {
    overflow-x: auto;
}

.table-list {
    width: 100%;
    margin-bottom: 1rem;
    background-color: transparent;
}

.table-list th {
    padding: 0.75rem;
    vertical-align: middle;
    border-top: 1px solid #dee2e6;
    background-color: #f8f9fa;
    white-space: nowrap;
}

.table-list td {
    padding: 0.75rem;
    vertical-align: middle;
    border-top: 1px solid #dee2e6;
}

/* Search Styles */
.search-wrapper {
    position: relative;
    max-width: 300px;
}

.search-input {
    padding-right: 40px;
}

.search-button {
    position: relative;
    transition: opacity 0.3s;
}

.search-wrapper.searching .search-button {
    opacity: 0.5;
    pointer-events: none;
}

.search-wrapper.searching::after {
    content: '';
    position: absolute;
    right: 45px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    border: 2px solid #ccc;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Avatar Styles */
.avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.avatar-sm {
    width: 24px;
    height: 24px;
}

.avatar-title {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
}

.bg-primary-soft {
    background-color: rgba(0, 123, 255, 0.1);
}

/* Animation */
@keyframes spin {
    to { 
        transform: translateY(-50%) rotate(360deg); 
    }
}

/* Responsive */
@media (max-width: 768px) {
    .search-wrapper {
        max-width: 100%;
    }
    
    .table-responsive {
        margin-bottom: 1rem;
    }
}

.table th {
    font-weight: 600;
    white-space: nowrap;
}

.badge {
    font-weight: 500;
    padding: 0.5em 1em;
}

.badge.bg-success {
    background-color: #198754 !important;
}

.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

.badge.bg-danger {
    background-color: #dc3545 !important;
}

.empty-state {
    text-align: center;
    padding: 2rem;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
}

.table td {
    vertical-align: middle;
}

.form-control {
    max-width: 250px;
}

.gap-2 {
    gap: 0.5rem !important;
} 