/* Update the font imports at the top of the file */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Inter:wght@400;500;600;700&display=swap');

/* Update the base font settings */
.page-content-wrapper {
    font-family: 'Inter', sans-serif;  /* Changed from Playfair Display */
    background-color: #f9f5ed;
    color: #333;
}

/* Keep decorative elements with Playfair Display */
.undangan-title, 
.card-title {
    font-family: 'Playfair Display', serif;
}

/* Improve table readability */
.table {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

.table th {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 14px;
}

/* Improve form readability */
.form-control,
.custom-select,
input[type="number"],
input[type="tel"] {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

/* Improve number readability */
.table td:nth-child(3), /* Assuming the third column contains numbers */
.nominal,
[class*="nominal"],
.currency,
[class*="currency"] {
    font-family: 'Inter', sans-serif;
    font-feature-settings: "tnum" on, "lnum" on;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Improve button text readability */
.btn {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Improve badge readability */
.badge {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.3px;
}

/* Improve modal content readability */
.modal-body {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

.modal-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
}

/* Improve form label readability */
label {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #444;
    margin-bottom: 0.5rem;
}

/* Improve placeholder text readability */
::placeholder {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #888;
}

/* Improve status text readability */
#perwakilanStatus {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

/* Improve card text readability */
.card-body p {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #333;
}

/* Improve strong text readability */
strong {
    font-weight: 600;
    color: #222;
}

/* Custom styles for undangan page */
.undangan-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    background-color: #fff;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card-title {
    color: #b8860b;
    font-weight: 700;
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.card-body {
    padding: 30px;
}

.poster-image {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background-color: #b8860b;
    border-color: #b8860b;
    color: #fff;
    font-weight: 400;
    padding: 5px 15px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #a67c00;
    border-color: #a67c00;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(184, 134, 11, 0.3);
}

.table-responsive {
    overflow-x: auto;
}

.table th,
.table td {
    padding: 1rem;
    vertical-align: top;
    border-top: 1px solid #e0e0e0;
}

.table thead th {
    vertical-align: bottom;
    border-bottom: 2px solid #b8860b;
    color: #b8860b;
    font-weight: 700;
    text-transform: uppercase;
}

.peserta-thumbnail {
    width: 60px;
    height: 60px;
    min-width: 60px;
    min-height: 60px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #b8860b;
    transition: transform 0.3s ease;
    display: block;
    margin: 0 auto;
    flex-shrink: 0;
}

.peserta-thumbnail:hover {
    transform: scale(1.1);
}


.kartu-undangan-preview {
    width: 638px;
    height: 1016px;
    background-color: #fff;
    margin: 0 auto;
    padding: 40px;
    box-shadow: 0 0 30px rgba(184, 134, 11, 0.2);
    position: relative;
    border: 2px solid #b8860b;
    border-radius: 15px;
}

.kartu-undangan {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    background-image: url('path/to/gold-pattern-background.png');
    background-size: cover;
    color: #333;
}

.kartu-undangan-photo {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 20px;
    border: 4px solid #b8860b;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.kartu-undangan-qr {
    width: 150px;
    height: 150px;
    margin-top: 20px;
    border: 2px solid #b8860b;
    padding: 5px;
    background-color: #fff;
}

@media (max-width: 768px) {
    .kartu-undangan-preview {
        width: 100%;
        height: auto;
        aspect-ratio: 638 / 1016;
    }
}

.embed-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    max-width: 100%;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 15px;
}

#perwakilanStatus {
    background-color: #f9f5ed;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid #b8860b;
}

#perwakilanStatus p {
    margin-bottom: 10px;
    font-size: 16px;
}

.custom-file-label::after {
    content: "Pilih File";
    background-color: #b8860b;
    color: #fff;
}

.modal-content {
    border-radius: 15px;
    border: none;
}

.modal-header {
    background-color: #b8860b;
    color: #fff;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    padding: 20px;
}

.modal-footer {
    background-color: #f9f5ed;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    padding: 20px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.fade-in {
    animation: fadeIn 1s ease-out;
}

.slide-in-up {
    animation: slideInUp 0.5s ease-out;
}

/* Gold decorative elements */
.gold-divider {
    height: 2px;
    background: linear-gradient(to right, transparent, #b8860b, transparent);
    margin: 20px 0;
}

.gold-border {
    border: 2px solid #b8860b;
    border-radius: 15px;
    padding: 20px;
}

.custom-select,
.form-control-lg,
.btn-lg {
    height: 50px;
    font-size: 1.1rem;
}

.custom-select {
    height: calc(1.5em + 1rem + 2px);
    padding: .5rem 1rem;
    font-size: 1.25rem;
    line-height: 1.5;
    border-radius: .3rem;
}

#imagePreview {
    border: 1px solid #b8860b; /* Optional: Add a border to the preview */
    border-radius: 5px; /* Optional: Add rounded corners */
    margin-top: 10px; /* Space above the image */
}

/* Add these styles at the end of the file */
.kartu-qr-preview {
    width: 320px;
    height: 480px;
    background: linear-gradient(135deg, #f6e6b4 0%, #d3b76c 100%);
    margin: 0 auto;
    padding: 15px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    position: relative;
    overflow: visible;
    transform-origin: top left;
    transform: scale(1);
}
.kartu-qr-preview-panitia {
    width: 320px;
    height: 480px;
    background: linear-gradient(135deg, #f0f0f0 0%, #d0d0d0 100%); /* Updated gradient colors for an even lighter gray theme */
    margin: 0 auto;
    padding: 15px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1); /* Reduced shadow for a lighter feel */
    border-radius: 10px;
    position: relative;
    overflow: visible;
    transform-origin: top left;
    transform: scale(1);
}



.kartu-qr-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, rgba(255,215,0,0.1) 0%, rgba(184,134,11,0.1) 100%);
    border: 2px solid #8B4513;
    border-radius: 8px;
    padding: 2px;
}

.kartu-qr-header {
    text-align: center;
    margin-bottom: 10px;
}

.kartu-qr-nama-kegiatan {
    font-size: 14px;
    font-weight: bold;
    color: #8B4513;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.kartu-qr-title {
    font-size: 18px;
    font-weight: bold;
    color: #8B4513;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
    line-height: 1.2;
}

.kartu-qr-photo {
    position: relative;
    width: 120px;
    height: 120px;
    min-width: 120px;
    min-height: 120px;
    margin: 5px auto;
    border-radius: 50%;
    border: 3px solid #8B4513;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    background-color: #f5f5f5;
    flex-shrink: 0;
}

.kartu-qr-nama {
    font-size: 20px;
    font-weight: bold;
    margin-top: 5px;
    margin-bottom: 2px;
    color: #8B4513;
    text-align: center;
}

.kartu-qr-perwakilan {
    font-size: clamp(12px, calc(16px - (0.2px * var(--text-length, 20))), 16px);
    margin-bottom: 2px;
    color: #8B4513;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    font-weight: bold;
}

.kartu-qr-jabatan {
    font-size: 16px;
    margin-bottom: 5px;
    color: #8B4513;
    font-style: italic;
    text-align: center;
}

.kartu-qr-footer {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    width: 100%;
}

.kartu-qr-code {
    width: 120px;  /* Increased from 100px */
    height: 120px; /* Increased from 100px */
    padding: 5px;
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* .kartu-qr-ornament {
    position: absolute;
    width: 30px;
    height: 30px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23D4AF37"><path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5"/></svg>');
    background-size: contain;
    opacity: 0.3;
    z-index: 2;
}

.kartu-qr-ornament.top-left {
    top: 5px;
    left: 5px;
}

.kartu-qr-ornament.top-right {
    top: 5px;
    right: 5px;
    transform: rotate(90deg);
}

.kartu-qr-ornament.bottom-left {
    bottom: 5px;
    left: 5px;
    transform: rotate(270deg);
}

.kartu-qr-ornament.bottom-right {
    bottom: 5px;
    right: 5px;
    transform: rotate(180deg);
} */

/* #downloadKartuQR {
    background-color: #8B4513;
    border-color: #8B4513;
    color: white;
    font-size: 18px;
    padding: 10px 20px;
}

#downloadKartuQR:hover {
    background-color: #7a3b00;
    border-color: #7a3b00;
} */

/* Add this new style to ensure the photo maintains its aspect ratio */
#kartuQRPhoto {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    border-radius: 50%;
}

/* Add these styles at the end of the file */
.back-button {
    background-color: #b8860b;
    border-color: #b8860b;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: 600;
    box-shadow: 0 4px 6px rgba(184, 134, 11, 0.2);
    transition: all 0.3s ease;
}

.back-button:hover {
    background-color: #a67c00;
    border-color: #a67c00;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(184, 134, 11, 0.3);
}

.back-button i {
    margin-right: 10px;
    font-size: 1.3rem;
    vertical-align: middle;
}

/* Add responsive handling */
@media screen and (max-width: 768px) {
    .kartu-qr-photo {
        width: 100px;
        height: 100px;
    }
}

/* Add aspect ratio container to maintain circle */
.kartu-qr-photo::before {
    content: "";
    display: block;
    padding-top: 100%;
}

/* Ensure the preview modal maintains aspect ratio */
.modal-body .kartu-qr-preview .kartu-qr-photo .kartu-qr-preview-panitia {
    width: 120px;
    height: 120px;
    margin: 10px auto;
}

/* Add container class for better control */
.kartu-qr-photo-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 5px auto;
    flex-shrink: 0;
}

/* Common styles for all circular images */
.peserta-thumbnail,
.profile-pic,
.kartu-qr-photo,
.kartu-undangan-photo {
    position: relative;
    overflow: hidden;
    border-radius: 50%;
    background-color: #f5f5f5; /* Fallback background */
    flex-shrink: 0; /* Prevent shrinking */
    display: inline-block;
}

/* Set dimensions for each type */
.peserta-thumbnail {
    width: 60px;
    height: 60px;
    border: 2px solid #b8860b;
}

.profile-pic {
    width: 100px;
    height: 100px;
    border: 3px solid #b8860b;
}

.kartu-undangan-photo {
    width: 200px;
    height: 200px;
    border: 4px solid #b8860b;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Common image styling for all circular images */
.peserta-thumbnail img,
.profile-pic img,
.kartu-qr-photo img,
.kartu-undangan-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Aspect ratio maintainer */
.peserta-thumbnail::before,
.profile-pic::before,
.kartu-qr-photo::before,
.kartu-undangan-photo::before {
    content: "";
    display: block;
    padding-top: 100%; /* Forces 1:1 aspect ratio */
}

/* Hover effects */
.peserta-thumbnail:hover,
.profile-pic:hover {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

/* Container classes for better control */
.photo-container {
    display: inline-block;
    position: relative;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .profile-pic {
        width: 80px;
        height: 80px;
    }
    
    .peserta-thumbnail {
        width: 50px;
        height: 50px;
    }
    
    .kartu-undangan-photo {
        width: 160px;
        height: 160px;
    }
}

/* Remove any conflicting styles */
.peserta-thumbnail {
    margin: 0; /* Remove any existing margins */
}

/* Ensure images inside table cells are properly centered */
.table td .peserta-thumbnail,
.table td .profile-pic {
    display: block;
    margin: 0 auto;
}

/* Add these styles for the jabatan input */
input[list="jabatan-suggestions"] {
    background-color: #fff;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

input[list="jabatan-suggestions"]:focus {
    border-color: #b8860b;
    box-shadow: 0 0 0 0.2rem rgba(184, 134, 11, 0.25);
}

/* Style for the datalist options when shown */
input[list="jabatan-suggestions"]::-webkit-calendar-picker-indicator {
    color: #b8860b;
    opacity: 0.5;
}

input[list="jabatan-suggestions"]:hover::-webkit-calendar-picker-indicator {
    opacity: 0.7;
}

/* Ensure consistent styling across browsers */
input[list="jabatan-suggestions"]:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px white inset;
    -webkit-text-fill-color: #333;
}

/* Add these styles for the panduan button */
.panduan-button {
    border: 2px solid #b8860b;
    color: #b8860b;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 30px;
    transition: all 0.3s ease;
    font-size: 1rem;
    letter-spacing: 0.5px;
}

.panduan-button:hover {
    background-color: #b8860b;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(184, 134, 11, 0.2);
}

.panduan-button i {
    margin-right: 8px;
}

.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideIn 0.3s ease-out;
}

.toast-success {
    background-color: #28a745;
    color: white;
}

.toast-error {
    background-color: #dc3545;
    color: white;
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.image-upload-preview {
    position: relative;
    width: 200px;
    height: 200px;
    border: 2px dashed #b8860b;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-upload-preview:hover {
    border-color: #8B4513;
    background-color: rgba(184, 134, 11, 0.1);
}

.image-upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-upload-preview:hover .image-upload-overlay {
    opacity: 1;
}

@media print {
    .no-print {
        display: none !important;
    }
    
    .card {
        break-inside: avoid;
        border: 1px solid #000;
        box-shadow: none;
    }
    
    .undangan-title {
        color: #000 !important;
    }
    
    body {
        background: none;
    }
}

@media (max-width: 768px) {
    .card-body {
        padding: 15px;
    }
    
    .table-responsive {
        margin: 0 -15px;
        width: calc(100% + 30px);
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .btn-group {
        display: flex;
        flex-direction: column;
    }
    
    .modal-dialog {
        margin: 10px;
    }
}

.modal-body {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    min-height: 520px;
}

/* Add specific table cell styling */
.table td:first-child {
    width: 80px; /* Add fixed width */
    min-width: 80px; /* Prevent shrinking */
    text-align: center; /* Center the image */
    vertical-align: middle; /* Center vertically */
    padding: 10px; /* Add some padding */
}

/* Ensure the container maintains aspect ratio */
.table td:first-child > div {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 0 auto;
}

/* Update image styles */
.peserta-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Add these styles for the kartuQRModal */
#kartuQRModal .modal-content {
    height: 90vh;
}

#kartuQRModal .modal-body {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background-color: #f8f9fa;
}

.kartuQRPreview {
    max-height: 100%;
    width: auto;
    object-fit: contain;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #kartuQRModal .modal-dialog {
        margin: 10px;
        max-width: 95%;
    }
}

/* Add these styles at the end of the file */
#filterNama,
#filterBidang,
#filterJabatan {
    margin-bottom: 15px;
}

th[data-sort] {
    position: relative;
}

th[data-sort]::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid #b8860b;
    margin-left: 5px;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

th[data-sort]:hover::after {
    opacity: 1;
}

th[data-sort].asc::after {
    border-bottom-color: #b8860b;
    opacity: 1;
}

th[data-sort].desc::after {
    border-top: 5px solid #b8860b;
    border-bottom: none;
    opacity: 1;
}

/* Add these styles at the end of the file */
#filterType,
#columnSelect,
#filterValue,
#sortDirection {
    margin-bottom: 15px;
}

.filter-controls {
    margin-bottom: 20px;
}

.filter-controls .form-control {
    margin-right: 10px;
}

@media (max-width: 768px) {
    .filter-controls .form-control {
        margin-bottom: 10px;
        margin-right: 0;
    }
}