/* Reset dan base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 10px;
}

/* Navigation */
.main-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: white;
    color: #667eea;
    border-color: white;
}

/* Menu Content */
.menu-content {
    display: none;
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
}

.menu-content.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

.menu-content h2 {
    color: #667eea;
    font-size: 1.8rem;
    margin-bottom: 25px;
    text-align: center;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.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);
}

/* Batch Input */
.batch-input {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.batch-prefix {
    background: #667eea;
    color: white;
    padding: 12px 15px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
}

.batch-input select,
.batch-input input {
    flex: 1;
    min-width: 80px;
}

.batch-preview {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    font-family: monospace;
    font-size: 1.1rem;
}

/* Quantity Input */
.quantity-input {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.quantity-input input {
    flex: 2;
    min-width: 120px;
}

.quantity-input select {
    flex: 1;
    min-width: 100px;
}

/* QR Scanner */
.qr-scanner-container {
    text-align: center;
    margin: 20px 0;
}

.scan-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    margin: 10px 5px;
    transition: background-color 0.3s ease;
}

.scan-btn:hover {
    background: #218838;
}

.scan-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* Buttons */
.add-btn,
.submit-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    margin: 10px 5px;
}

.add-btn:hover,
.submit-btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.submit-btn {
    background: #28a745;
    width: 100%;
    margin-top: 20px;
    padding: 15px;
    font-size: 1.1rem;
}

.submit-btn:hover {
    background: #218838;
}

/* Tables */
.table-container {
    margin: 20px 0;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

table th,
table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e1e5e9;
}

table th {
    background: #667eea;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
}

table tr:hover {
    background: #f8f9fa;
}

.delete-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.delete-btn:hover {
    background: #c82333;
}

/* Search Container */
.search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-container input {
    flex: 1;
    min-width: 200px;
}

.search-container button {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.search-container button:hover {
    background: #5a6fd8;
}

/* Export Buttons */
.export-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.export-buttons button {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.export-buttons button:hover {
    background: #138496;
}

/* Removing Info */
.removing-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #667eea;
}

.removing-info h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.removing-info p {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-content h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.modal-content p {
    margin-bottom: 25px;
    font-size: 1.1rem;
    color: #555;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-yes,
.btn-no {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-yes {
    background: #dc3545;
    color: white;
}

.btn-yes:hover {
    background: #c82333;
}

.btn-no {
    background: #6c757d;
    color: white;
}

.btn-no:hover {
    background: #5a6268;
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .menu-content {
        padding: 20px;
    }
    
    .batch-input {
        flex-direction: column;
        align-items: stretch;
    }
    
    .batch-input select,
    .batch-input input {
        margin-bottom: 10px;
    }
    
    .search-container {
        flex-direction: column;
    }
    
    .export-buttons {
        flex-direction: column;
    }
    
    .modal-content {
        margin: 20% auto;
        padding: 20px;
    }
    
    .modal-buttons {
        flex-direction: column;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    table th,
    table td {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .nav-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .form-group input,
    .form-group select {
        padding: 10px;
    }
    
    table {
        font-size: 0.8rem;
    }
    
    table th,
    table td {
        padding: 6px;
    }
}



/* ===== LOGIN SYSTEM STYLES ===== */

/* Header with user info */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.user-greeting {
    color: white;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 15px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 500;
}

.user-greeting strong {
    color: #FFD700;
    font-weight: 600;
}

.logout-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(238, 90, 82, 0.3);
}

.logout-btn:hover {
    background: linear-gradient(135deg, #ee5a52, #ff6b6b);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(238, 90, 82, 0.4);
}

.logout-btn:active {
    transform: translateY(0);
}

/* User field styles */
.user-field {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.user-field:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.user-field[readonly] {
    background-color: #f8f9fa;
    color: #495057;
    cursor: not-allowed;
    border-color: #e9ecef;
}

/* Responsive adjustments for header */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .header-content h1 {
        font-size: 24px;
        margin: 0;
    }
    
    .user-info {
        justify-content: center;
        gap: 10px;
        width: 100%;
    }
    
    .user-greeting {
        font-size: 13px;
        padding: 6px 12px;
    }
    
    .logout-btn {
        font-size: 13px;
        padding: 6px 14px;
    }
}

@media (max-width: 480px) {
    .user-info {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    
    .user-greeting,
    .logout-btn {
        width: 100%;
        text-align: center;
        justify-content: center;
        max-width: 250px;
    }
}

/* Loading animation for user name */
#user-name {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Stop animation when loaded */
#user-name.loaded {
    animation: none;
}



/* ===== CHANGE PASSWORD FEATURE STYLES ===== */

/* Change password button */
.change-password-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(40, 167, 69, 0.3);
}

.change-password-btn:hover {
    background: linear-gradient(135deg, #20c997, #28a745);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

.change-password-btn:active {
    transform: translateY(0);
}

/* Modal header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.modal-header h3 {
    margin: 0;
    color: #495057;
    font-size: 20px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background-color: #f8f9fa;
    color: #495057;
}

/* Form styling for change password */
#change-password-form .form-group {
    margin-bottom: 20px;
}

#change-password-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

#change-password-form input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    box-sizing: border-box;
}

#change-password-form input[type="password"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

#change-password-form input[type="password"]:invalid {
    border-color: #dc3545;
}

#change-password-form input[type="password"]:valid {
    border-color: #28a745;
}

.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
}

/* Modal buttons for change password */
#change-password-form .modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.btn-primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 123, 255, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0056b3, #007bff);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Responsive adjustments for change password */
@media (max-width: 768px) {
    .user-info {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    
    .change-password-btn,
    .logout-btn {
        width: 100%;
        text-align: center;
        justify-content: center;
        max-width: 250px;
    }
    
    .change-password-btn {
        font-size: 13px;
        padding: 8px 16px;
    }
    
    #change-password-form .modal-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        padding: 14px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        margin: 10px;
        padding: 20px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-header h3 {
        font-size: 18px;
    }
    
    #change-password-form input[type="password"] {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Password strength indicator (optional enhancement) */
.password-strength {
    margin-top: 5px;
    height: 4px;
    border-radius: 2px;
    background: #e9ecef;
    overflow: hidden;
    transition: all 0.3s ease;
}

.password-strength.weak {
    background: linear-gradient(90deg, #dc3545 30%, #e9ecef 30%);
}

.password-strength.medium {
    background: linear-gradient(90deg, #ffc107 60%, #e9ecef 60%);
}

.password-strength.strong {
    background: linear-gradient(90deg, #28a745 100%, #e9ecef 100%);
}


/* ===== MANUAL INPUT FIELDS STYLES ===== */

/* Manual batch input */
#batch-manual {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

#batch-manual:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    background: white;
}

#batch-manual:valid {
    border-color: #28a745;
    background: #f8fff9;
}

/* BIN input container */
.bin-input-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.manual-input-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 2px dashed #dee2e6;
    transition: all 0.3s ease;
}

.manual-input-section:hover {
    border-color: #007bff;
    background: #f0f8ff;
}

.manual-input-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.manual-input-section input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    background: white;
    box-sizing: border-box;
}

.manual-input-section input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.manual-input-section input:valid {
    border-color: #28a745;
}

/* Manual removing section */
.manual-removing-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 2px dashed #dee2e6;
    margin: 20px 0;
    transition: all 0.3s ease;
}

.manual-removing-section:hover {
    border-color: #dc3545;
    background: #fff5f5;
}

.manual-removing-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.manual-removing-section input {
    width: calc(100% - 120px);
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    background: white;
    display: inline-block;
    margin-right: 10px;
    box-sizing: border-box;
}

.manual-removing-section input:focus {
    outline: none;
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.search-btn {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    vertical-align: top;
    box-shadow: 0 2px 10px rgba(220, 53, 69, 0.3);
}

.search-btn:hover {
    background: linear-gradient(135deg, #c82333, #dc3545);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
}

.search-btn:active {
    transform: translateY(0);
}

/* Form hints */
.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
    line-height: 1.4;
}

/* Batch auto group conditional styling */
#batch-auto-group.disabled {
    opacity: 0.5;
    pointer-events: none;
}

#batch-auto-group.disabled input,
#batch-auto-group.disabled select {
    background-color: #f8f9fa;
    color: #6c757d;
}

/* Responsive adjustments for manual inputs */
@media (max-width: 768px) {
    .bin-input-container {
        gap: 15px;
    }
    
    .manual-input-section,
    .manual-removing-section {
        padding: 15px;
    }
    
    .manual-removing-section input {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .search-btn {
        width: 100%;
        padding: 14px;
    }
}

@media (max-width: 480px) {
    #batch-manual,
    .manual-input-section input,
    .manual-removing-section input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .manual-input-section,
    .manual-removing-section {
        padding: 12px;
    }
}

/* Visual separator between QR and manual input */
.qr-scanner-container::after {
    content: "ATAU";
    display: block;
    text-align: center;
    margin: 15px 0;
    font-weight: 600;
    color: #6c757d;
    font-size: 14px;
    position: relative;
}

.qr-scanner-container::after::before,
.qr-scanner-container::after::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #dee2e6;
}

.qr-scanner-container::after::before {
    left: 0;
}

.qr-scanner-container::after::after {
    right: 0;
}

