/* static/css/my_account.css */

/* Floating Elements (jika ada) */
.floating-element {
    /* Gaya untuk elemen mengambang Anda */
    position: absolute;
    background: rgba(135, 206, 235, 0.1); /* Sky Blue */
    border-radius: 50%;
    animation: floatEffect 15s infinite ease-in-out;
    z-index: 0;
}

.floating-element:nth-child(1) { top: 10%; left: 5%; width: 100px; height: 100px; animation-delay: 0s; }
.floating-element:nth-child(2) { top: 50%; right: 10%; width: 150px; height: 150px; animation-delay: 5s; }
.floating-element:nth-child(3) { bottom: 20%; left: 20%; width: 80px; height: 80px; animation-delay: 10s; }

@keyframes floatEffect {
    0% { transform: translateY(0) rotate(0deg); opacity: 0.7; }
    50% { transform: translateY(-20px) rotate(180deg); opacity: 0.5; }
    100% { transform: translateY(0) rotate(360deg); opacity: 0.7; }
}

/* Main Container for My Account Page */
.my-account-box-main {
    background: linear-gradient(135deg, #F0F8FF 0%, #E0F6FF 50%, #F8FDFF 100%);
    min-height: 100vh;
    padding: 80px 0;
    position: relative;
    overflow: hidden; /* Penting untuk mencegah scroll horizontal dari floating elements */
    z-index: 1; /* Pastikan konten utama di atas floating elements */
}

/* Ensure the Bootstrap row uses flex for proper column stacking */
.profile-layout-row {
    display: flex;
    flex-wrap: wrap; /* Allow columns to wrap on smaller screens */
    margin-left: -15px; /* Sesuaikan dengan padding default Bootstrap col */
    margin-right: -15px; /* Sesuaikan dengan padding default Bootstrap col */
}

/* Styling for profile info and order history sections */
.profile-info,
.order-history {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 15px 35px rgba(135, 206, 235, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 30px; /* Jarak antar bagian di mobile */
    position: relative;
    z-index: 2;
}

.profile-info h2,
.order-history h2 {
    font-size: 2.2rem;
    font-weight: 700;
    color: #4682B4;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0f6ff;
    text-align: center;
}

.profile-info p {
    font-size: 1rem;
    margin-bottom: 10px;
    color: #555;
}

.profile-info p strong {
    color: #333;
}

.profile-info h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #4682B4;
    margin-top: 25px;
    margin-bottom: 15px;
}

.profile-info .form-group label {
    font-weight: 500;
    color: #444;
    margin-bottom: 5px;
    display: block;
}

.profile-info .form-group input[type="text"],
.profile-info .form-group input[type="tel"] {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    color: #333;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
    transition: border-color 0.3s ease;
}

.profile-info .form-group input[type="text"]:focus,
.profile-info .form-group input[type="tel"]:focus {
    border-color: #87CEEB;
    outline: none;
    box-shadow: 0 0 0 3px rgba(135, 206, 235, 0.3);
}

.btn.hvr-hover {
    background: linear-gradient(135deg, #4682B4 0%, #87CEEB 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(135, 206, 235, 0.3);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn.hvr-hover:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(135, 206, 235, 0.4);
    color: white;
    text-decoration: none;
}

/* Order History Table */
.order-history .table-responsive {
    overflow-x: auto; /* Penting: Tambahkan scroll horizontal untuk tabel */
    -webkit-overflow-scrolling: touch; /* Untuk scrolling yang lebih halus di iOS */
    margin-bottom: 0; /* Hindari margin bawah ganda */
}

.order-history .table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0 5px; /* Jarak antar baris tabel */
}

.order-history .table thead {
    background: linear-gradient(135deg, #4682B4, #87CEEB);
    color: white;
    border-radius: 10px 10px 0 0;
}

.order-history .table th {
    padding: 12px 15px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    border: none;
    vertical-align: middle;
}

.order-history .table tbody tr {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.order-history .table tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.order-history .table td {
    padding: 12px 15px;
    vertical-align: middle;
    border-top: none;
    border-bottom: none;
    font-size: 0.9rem;
}

/* Status Badges */
.status-selesai, .status-proses, .status-lain {
    padding: .3em .6em;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: .3rem;
    white-space: nowrap; /* Pastikan teks status tidak pecah baris */
}

.status-selesai { background-color: #d4edda; color: #155724; }
.status-proses { background-color: #fff3cd; color: #856404; }
.status-lain { background-color: #e2e3e5; color: #383d41; }

/* Buttons inside table cells */
.order-history .table td .btn {
    font-size: 0.75rem;
    padding: 6px 10px;
    margin-right: 5px;
    white-space: nowrap; /* Penting untuk mencegah tombol pecah baris */
    display: inline-flex; /* Untuk ikon dan teks sejajar */
    align-items: center;
    gap: 5px;
}

/* Modal Styling (sudah cukup baik, hanya memastikan responsivitas) */
.modal-dialog {
    margin: 10% auto;
    width: 90%;
    max-width: 500px;
}

@media (max-width: 767.98px) {
    .modal-dialog {
        margin: 5% auto; /* Kurangi margin atas di mobile */
        width: 95%;
    }
    .modal-header, .modal-body, .modal-footer {
        padding: 10px 15px;
    }
    .modal-title {
        font-size: 1.1rem;
    }
    .modal-body p, .modal-body ul li {
        font-size: 0.9rem;
    }
    .modal-footer .btn {
        font-size: 0.9rem;
        padding: 8px 12px;
    }
}


/* Responsive Adjustments for My Account Page */
@media (max-width: 991.98px) { /* For tablets and smaller desktops */
    .my-account-box-main {
        padding: 60px 0;
    }
    .profile-info,
    .order-history {
        padding: 20px;
        margin-bottom: 20px; /* Jarak antar bagian */
    }
    .profile-info h2,
    .order-history h2 {
        font-size: 1.8rem;
        margin-bottom: 15px;
        padding-bottom: 10px;
    }
    .profile-info p,
    .profile-info .form-group label,
    .profile-info .form-group input {
        font-size: 0.95rem;
    }
    .btn.hvr-hover {
        padding: 10px 20px;
        font-size: 0.95rem;
    }
    .order-history .table th,
    .order-history .table td {
        padding: 10px;
        font-size: 0.85rem;
    }
    .order-history .table td .btn {
        font-size: 0.7rem;
        padding: 5px 8px;
    }
}

@media (max-width: 767.98px) { /* For mobile devices */
    .my-account-box-main {
        padding: 40px 0;
    }
    /* Bootstrap col-lg-6 sudah akan menumpuk di bawah 992px,
       tapi kita bisa pastikan lebar penuh di mobile */
    .profile-info-col,
    .order-history-col {
        width: 100%;
        flex: 0 0 100%;
        max-width: 100%;
    }
    .profile-info,
    .order-history {
        padding: 15px;
        margin-bottom: 15px;
    }
    .profile-info h2,
    .order-history h2 {
        font-size: 1.6rem;
        margin-bottom: 10px;
        padding-bottom: 8px;
    }
    .profile-info p,
    .profile-info .form-group label,
    .profile-info .form-group input {
        font-size: 0.9rem;
    }
    .btn.hvr-hover {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    /* Penyesuaian spesifik untuk tabel riwayat pesanan di mobile */
    .order-history .table th,
    .order-history .table td {
        padding: 8px 10px; /* Kurangi padding lebih lanjut */
        font-size: 0.7rem; /* Kurangi ukuran font */
        white-space: normal; /* Izinkan teks memecah baris jika terlalu panjang */
    }
    .order-history .table td .btn {
        font-size: 0.65rem; /* Ukuran tombol lebih kecil */
        padding: 4px 6px;
        margin-right: 3px;
    }
    /* Pastikan tombol "Lihat Detail" dan "Invoice" tidak terpotong */
    .order-history .table td:last-child {
        min-width: 120px; /* Beri lebar minimal pada kolom aksi */
    }
}

/* Modal adjustments for smaller screens */
@media (max-width: 575.98px) { /* Extra small devices (phones) */
    .modal-dialog {
        margin: 20px auto;
        width: 98%;
    }
    .modal-body ul li {
        font-size: 0.85rem;
    }
}
