/*/
Version: 3.0.0
Author: Ankit Hingarajiya - DeskApp
*/
body, html {
    /*-webkit-font-smoothing: antialiased;*/
    width: 100%;
    min-height: 100%; /* Changed from height to min-height */
}

html {
    -webkit-text-size-adjust: none;
    -moz-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: #ecf0f4;
}

input[type=submit] {
    -webkit-appearance: none
}

*, :after, :before {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

body {
    display: flex;
    flex-direction: column;
    max-width: 32rem;
    margin: 0 auto;
    background-color: #ffffff;
    min-height: 100vh; /* Ensure at least full viewport height */
}

.wrapper {
    position: relative;
    background-color: #ffffff; /* Tambahkan background putih */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    flex: 1; /* Allow wrapper to grow */
}

.wrapper > :not(footer) {
    flex: 1;
}

header {
    position: fixed;
    top: 0;
    left: 50%; /* Center the header */
    transform: translateX(-50%); /* Center the header */
    max-width: 32rem; /* Match body max-width */
    width: 100%; /* Full width up to max-width */
    z-index: 999;
    background: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
    transition: opacity 0.3s ease, background-color 0.3s ease; /* Smooth transition */
}

header.scrolled {
    opacity: 0.7; /* Transparan 70% */
    background-color: rgba(255, 255, 255, 0.95); /* Background semi-transparan */
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    padding: 8px 20px;
}

.logo a {
    flex: 1;
    flex-direction: row;
    gap: 10px;
}

.logo img {
    height: auto;
    max-width: 100%;
    max-height: 32px; /* Set maximum height for the logo */
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 20px;
    padding-top: 65px; /* Kompensasi tinggi header (32px logo + 16px padding + margin) */
    padding-bottom: 60px; /* Kompensasi tinggi footer agar tidak tertutup */
    min-height: calc(100vh - 65px); /* Ensure main fills viewport height minus header */
    width: 100%;
}

/* Search Input Styling */
.search-container {
    display: flex;
    justify-content: space-between;
}

.search-container input {
    border: 2px solid #689bd7;
    border-radius: 50px;
    padding: 5px 20px;
    font-size: 15px;
    outline: none;
}

.card-home-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.card-home {
    background-color: #ffffff;
    border: 1px solid #ffffff;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    height: 100px;
    box-shadow: 0 2px 5px #00000019;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

.card-home span {
    font-weight: 500;
    font-size: 15px;
    color: #000000;
}

.card-home img {
    margin-bottom: 3px;
    width: 40px;
    height: 40px;
}

/* Login button style */
.login-menu {
    cursor: pointer;
    border: 1px solid #1B7AEAFF;
    border-radius: 4px;
    font-weight: 600;
    width: 4rem;
    padding: 10px 0;
    box-shadow: 0 0 20px #6855E033;
    transition: all 0.4s ease;
    color: #1B7AEAFF;
    background-color: #ffffff;
}

/* Hover for Login button */
.login-menu:hover {
    color: #ffffff;
    box-shadow: 0 0 20px #063A77FF;
    background-color: #1B7AEAFF;
    transform: translateY(-2px);
}

/* Hamburger Menu Button */
.hamburger-menu {
    background: transparent;
    border: none;
    font-size: 24px;
    color: #1B7AEAFF;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.hamburger-menu:hover {
    color: #1b7aea;
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Sidebar Menu */
.sidebar-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 400px;
    height: 100%;
    background: #ffffff;
    z-index: 999;
    transition: right 0.3s ease;
    overflow-y: auto;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-menu.active {
    right: 0;
}

/* Sidebar Header */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid #f0f0f0;
    background: #0c5fb2;
    color: white;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.sidebar-close {
    background: transparent;
    border: none;
    font-size: 24px;
    color: white;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-close:hover {
    opacity: 0.8;
}

/* Patient Card */
.patient-card {
    margin: 20px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    color: white;
    position: relative;
    overflow: hidden;
}

/* Patient Card with background image - will be set via inline style or CSS variable */
.patient-card.with-bg {
    background-blend-mode: multiply;
    background-size: cover;
    background-position: center;
}

.patient-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.patient-card-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.card-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    background: white;
    padding: 8px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.hospital-info h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.hospital-info p {
    margin: 2px 0;
    font-size: 10px;
    opacity: 0.95;
    line-height: 1.3;
}

.patient-card-body {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 10px;
    position: relative;
    z-index: 1;
}

.patient-info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.patient-info-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.patient-info-row .label {
    font-weight: 600;
    font-size: 13px;
    opacity: 0.9;
}

.patient-info-row .value {
    font-weight: 700;
    font-size: 13px;
    text-align: right;
}

/* Card Actions */
.card-actions {
    padding: 0 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-change-bg,
.btn-download-card {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-change-bg {
    background: #667eea;
    color: white;
}

.btn-change-bg:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-download-card {
    background: #0c5fb2;
    color: white;
}

.btn-download-card:hover {
    background: #09498a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgb(9, 73, 138);
}

/* Sidebar Menu Items */
.sidebar-menu-items {
    padding: 20px;
}

.sidebar-menu-item {
    width: 100%;
    padding: 15px 20px;
    background: #f8f9fa;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.sidebar-menu-item:hover {
    background: #dc3545;
    color: white;
    transform: translateX(-5px);
}

.sidebar-menu-item i {
    font-size: 18px;
}

/* Responsive */
@media (max-width: 480px) {
    .sidebar-menu {
        width: 90%;
    }

    .patient-card {
        margin: 15px;
        padding: 15px;
    }

    .card-logo {
        width: 50px;
        height: 50px;
    }

    .hospital-info h4 {
        font-size: 11px;
    }

    .hospital-info p {
        font-size: 9px;
    }
}

.main_title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 15px;
    /*background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);*/
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 123, 255, 0.2);
}

.main_title .title {
    color: #000000;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-search-card,
.btn-back-card {
    background: transparent;
    border: 2px solid #000000;
    color: #000000;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 16px;
}

.btn-create-card {
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s;
    padding: 10px 20px;
    border-radius: 10px;
    background: #1f5eba;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    font-size: 15px;
    color: #ffffff;

    position: fixed;
    bottom: 35px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

.btn-search-card:hover,
.btn-create-card:hover {
    background: white;
    color: #000000;
    transform: scale(1.1);
}

.btn-create-card:hover {
    transform: translateX(-50%) scale(1.1);
}

.btn-search-card:active,
.btn-create-card:active {
    transform: scale(0.95);
}

.btn-create-card:active {
    transform: translateX(-50%) scale(0.95);
}

/* Search Card Styles - Slide Down Animation */
.search-card {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out, margin 0.3s ease-out;
    margin-bottom: 0;
}

.search-card.active {
    max-height: 100px;
    opacity: 1;
    margin-bottom: 15px;
}

.search-card input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #007bff;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.search-card input:focus {
    border-color: #0056b3;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.search-card input::placeholder {
    color: #999;
}

.card-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card {
    background-color: #ffffff;
    border: 1px solid #ffffff;
    border-radius: 10px;
    padding: 10px;
    text-align: left;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.card .card-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card .card-title .title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #000000;
}

.card .card-details {
    display: flex;
    flex-direction: column;
}

.card .card-details .detail-item {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.card .card-details .detail-item span {
    font-weight: 400;
    color: #000000;
}

.card h3 {
    font-weight: 600;
    color: #000000;
}

/* Pop-up styling */
.popup-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #fff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    border-radius: 15px 15px 0 0;
    padding: 20px;
    max-width: 95%;
    margin: 0 auto;
    max-height: 75vh; /* Set maximum height for scrolling */
    overflow-y: auto; /* Enable vertical scrolling */
    transform: translateY(100%); /* Mulai di bawah layar */
    transition: transform 0.3s ease;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    z-index: 999; /* Di atas overlay */
    display: flex;
    flex-direction: column;
    gap: 15px;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Kelas untuk menampilkan pop-up */
.popup-container.show {
    transform: translateY(0); /* Pindahkan ke posisi normal (tampil) */
}

.btn-check {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #2366be;
    padding: 2px 10px;
    border-radius: 50px;
    font-weight: bold;
    color: #ffffff
}

.popup-title {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
}

.popup-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Button Kirim Aduan */
.popup-container .popup-content .btn-submit {
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #0f3ba8 0%, #2367bf 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(10, 73, 124, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.popup-container .popup-content .btn-submit:hover {
    background: linear-gradient(135deg, #0f3ba8 0%, #2367bf 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(10, 73, 124, 0.3);
}

.popup-container .popup-content .btn-submit:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(10, 73, 124, 0.3);
}

.popup-container .popup-content .btn-submit i {
    font-size: 18px;
}

/* Button Kirim Aduan - Disabled State */
.popup-container .popup-content .btn-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.popup-container .popup-content .btn-submit:disabled:hover {
    background: #ccc;
    transform: none;
}

.popup-container .btn-close {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    background-color: #dc143c;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
}

/* Search Results - Positioned Below Input */
#search_results {
    position: absolute;
    top: 100%; /* Position below the input */
    left: 0;
    width: 100%;
    max-height: 250px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    display: none;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 6px 6px;
    margin-top: 0;
}

.loading-container {
    text-align: center;
    color: #666;
    padding: 10px;
}

/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 50%; /* Center the footer */
    transform: translateX(-50%); /* Center the footer */
    max-width: 32rem; /* Match body max-width */
    width: 100%; /* Full width up to max-width */
    background: linear-gradient(0deg, #0c5fb2 70%, transparent 100%);
    color: #ffffff;
    text-align: center;
    padding: 5px 10px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 998; /* Below header (999) but above content */
}

.footer-content p {
    margin: 0;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.3;
}

/* SweetAlert2 Fix - Keep centered when body width changes */
.swal-fixed-center {
    position: fixed !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
}

.swal2-container {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 9999 !important;
}

.swal2-popup {
    position: relative !important;
}

