/**
 * File CSS Utama
 * Lokasi: root/assets/css/style.css
 * 
 * Fungsi:
 * - Styling untuk seluruh halaman
 * - Responsive untuk mobile dan desktop
 * - Animasi ringan dan smooth
 * - Optimized untuk performa cepat
 */

/* ========================================
   RESET & BASE STYLES
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

/* Fix untuk halaman login agar footer tidak ada gap */
body:has(.login-box) {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
}

body:has(.login-box) .form-group {
    margin-bottom: 15px;
}

body:has(.login-box) .checkbox-group {
    margin-bottom: 15px;
}

body:has(.login-box) .text-center {
    margin-bottom: 15px;
}

/* Fix untuk halaman login agar footer tidak ada gap */
body:has(.login-box) {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
}

/* ========================================
   HEADER STYLES
   Fungsi: Navigation bar di atas dengan menu dropdown
   ======================================== */
.main-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo h1 {
    color: white;
    font-size: 20px;
    font-weight: 700;
}

.main-nav {
    display: flex;
    gap: 15px;
    align-items: center;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
    transition: all 0.3s;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255,255,255,0.2);
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.dropdown-btn:hover {
    background: rgba(255,255,255,0.3);
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background: white;
    min-width: 180px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background 0.3s;
}

.dropdown-content a:hover {
    background: #f5f5f5;
}

/* ========================================
   MAIN CONTAINER
   Fungsi: Container untuk content utama
   ======================================== */
.main-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    min-height: calc(100vh - 200px);
}

.content-box {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

/* ========================================
   FORM STYLES
   ======================================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.form-group input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s;
    line-height: 1.2;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #999;
    font-size: 12px;
}

/* Searchable select */
#serviceSelect {
    height: 200px;
    overflow-y: auto;
}

#serviceSearch {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
}

/* Select search wrapper */
.select-search-wrapper {
    position: relative;
}

.select-search-wrapper input[type="text"] {
    margin-bottom: 0;
}

.service-dropdown {
    display: none;
    margin-top: 2px;
    position: absolute;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    margin-top: 2px;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.service-item {
    padding: 10px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
}

.service-item:last-child {
    border-bottom: none;
}

.service-item:hover {
    background: #f0f0f0;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 15px 25px;
    border-radius: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: bottom 0.3s;
    z-index: 10000;
    font-size: 14px;
}

.toast.show {
    bottom: 30px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 30px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #333;
}

/* Checkbox untuk Remember Me */
.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
}

.checkbox-group label {
    margin: 0;
    font-weight: normal;
    cursor: pointer;
}

/* ========================================
   BUTTON STYLES
   ======================================== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%);
    color: white;
}

/* ========================================
   INFO BOX & ALERTS
   ======================================== */
.info-box {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    font-weight: 500;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.note-box {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    padding: 15px 20px;
    border-radius: 10px;
    border-left: 4px solid #ff6a00;
    margin-top: 20px;
}

/* ========================================
   TABLE STYLES
   ======================================== */
.table-responsive {
    overflow-x: auto;
    margin-top: 20px;
    border-radius: 10px;
    background: white;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
}

table th,
table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: middle;
}

table td:nth-child(5) {
    line-height: 1.2;
}

table td:nth-child(7) {
    white-space: nowrap;
    vertical-align: middle;
}

table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
}

table tr:hover {
    background: #f8f9ff;
}

/* Fix kolom status agar compact */
table tbody td:nth-child(5) span {
    display: inline-block;
    line-height: 1.2;
    vertical-align: middle;
}

/* Paksa semua row sama tinggi */
table tbody tr {
    height: 50px;
}

table tbody td {
    vertical-align: middle !important;
}

/* Copy phone number */
.phone-copy {
    cursor: pointer;
    color: #667eea;
    font-weight: bold;
    transition: color 0.3s;
    user-select: none;
}

.phone-copy:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Status icons */
.status-icon {
    font-size: 18px;
    margin-right: 5px;
}

/* Time display di bawah status - untuk semua device */

/* ========================================
   LOGIN BOX
   ======================================== */
.login-box {
    max-width: 550px;
    margin: 30px auto;
    background: white;
    padding: 35px 50px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-box h2 {
    margin-bottom: 20px;
    text-align: center;
    color: #333;
    font-size: 28px;
}

/* ========================================
   FOOTER STYLES
   Fungsi: Footer dengan link dan animasi roket
   ======================================== */
.main-footer {
    background: linear-gradient(135deg, #434343 0%, #000000 100%);
    color: white;
    padding: 15px 20px;
    text-align: center;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-link {
    color: #ffd700;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s;
}

.footer-link:hover {
    color: #ffed4e;
}

/* Animasi Roket - Terbang saat hover */
.rocket {
    display: inline-block;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.footer-link:hover .rocket {
    transform: translateY(-20px) rotate(-45deg);
    animation: rocket-fly 1s ease-in-out;
}

@keyframes rocket-fly {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(-45deg); }
}

.footer-info {
    margin-top: 10px;
    font-size: 12px;
    color: #ccc;
}

/* ========================================
   MOBILE RESPONSIVE
   Optimized untuk tampilan mobile
   ======================================== */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        text-align: center;
        padding: 10px;
    }
    
    .logo h1 {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .main-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        width: 100%;
    }
    
    .nav-link {
        font-size: 11px;
        padding: 6px 10px;
        flex: 0 0 auto;
    }
    
    .dropdown {
        width: 100%;
        margin-top: 5px;
    }
    
    .dropdown-btn {
        font-size: 11px;
        padding: 6px 10px;
        width: 100%;
    }
    
    .dropdown-content {
        width: 100%;
        left: 0;
        right: 0;
    }
    
    .main-container {
        padding: 0 10px;
    }
    
    .content-box {
        padding: 15px;
    }
    
    .form-group input,
    .form-group select {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    /* Mobile responsive for order history table */
    .table-responsive table {
        font-size: 11px;
    }
    
    .table-responsive th:nth-child(1),
    .table-responsive td:nth-child(1) {
        display: none; /* Hide Order ID */
    }
    
    .table-responsive th,
    .table-responsive td {
        padding: 8px 4px;
    }
    
    .table-responsive td:nth-child(7) {
        font-size: 9px;
    }
    
    
    
    #serviceSelect {
        height: 150px;
        font-size: 11px;
    }
    
    /* Login box mobile - fit tanpa gap */
    .login-box {
        margin: 10px 15px;
        padding: 20px;
    }
    
    .login-box h2 {
        font-size: 22px;
        margin-bottom: 12px;
    }
    
    /* Body login mobile - hilangkan scroll berlebih */
    body:has(.login-box) {
        min-height: auto;
        height: 100vh;
        overflow: hidden;
        justify-content: flex-start;
        padding-top: 40px;
    }
    
    body:has(.login-box) .form-group {
        margin-bottom: 12px;
    }
    
    body:has(.login-box) .checkbox-group {
        margin-bottom: 12px;
    }
    
    body:has(.login-box) .text-center {
        margin-bottom: 10px;
        font-size: 14px;
    }
    
    /* Footer mobile - fixed di bawah */
    body:has(.login-box) .main-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin-top: 0;
        padding: 10px;
    }
    
    .footer-content p {
        margin: 2px 0;
        font-size: 11px;
    }
    
    .footer-info {
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 16px;
    }
    
    table {
        font-size: 11px;
    }
    
    table th,
    table td {
        padding: 6px 3px;
    }
}

/* Force fix alignment desktop only */
@media (min-width: 769px) {
    .table-responsive tbody tr {
        height: 55px !important;
    }
    
    .table-responsive tbody td {
        vertical-align: middle !important;
        padding-top: 12px !important;
        padding-bottom: 12px !important;
    }
}

/* Password input wrapper dengan icon mata */
.password-input-wrapper {
    position: relative;
}

.password-input-wrapper input {
    padding-right: 45px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 20px;
    user-select: none;
    transition: opacity 0.3s;
}

.toggle-password:hover {
    opacity: 0.7;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.w-100 { width: 100%; }