/* General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
}

/* Backgrounds */
.login-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.public-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.public-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 50%;
    background: white;
    padding: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.public-input {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px 15px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.public-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-cek {
    border-radius: 10px;
    padding: 12px 25px;
    font-weight: 600;
}

.btn-login-public {
    border-radius: 10px;
    padding: 12px 30px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-login-public:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.bill-item-public {
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.bill-group-public {
    border-radius: 10px;
    overflow: hidden;
}

.bill-header-public {
    background: rgba(0, 0, 0, 0.2);
    padding: 10px 15px;
    border-radius: 10px 10px 0 0;
}

.bill-header-public h5 {
    color: #dc3545;
    font-weight: bold;
}

.bill-item-row {
    padding: 12px 15px;
    margin-bottom: 2px;
}

.bill-item-row:last-child {
    margin-bottom: 0;
    border-radius: 0 0 10px 10px;
}

.bill-item-row:first-child {
    border-radius: 0 0 0 10px;
}

.bg-aktif {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.bg-lunas {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
}

.dashboard-bg {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    min-height: 100vh;
}

/* Login Container */
.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 50%;
    background: white;
    padding: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.login-input {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px 15px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.login-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-login-cool {
    padding: 12px 20px;
    font-weight: 600;
    font-size: 1.1rem;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.btn-login-cool:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.5s ease;
}

/* Public Container */
.public-container {
    width: 100%;
    max-width: 600px;
    padding: 20px;
}

.public-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 0.5s ease;
}

/* Gradient Button */
.btn-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    transition: all 0.3s ease;
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
    color: white;
}

/* Navbar Gradient */
.bg-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.navbar-sm {
    padding: 0.5rem 1rem;
}

.navbar-sm .navbar-brand {
    font-size: 1.1rem;
    padding: 0;
}

.welcome-text {
    font-size: 0.85rem;
}

.logout-btn {
    padding: 0.5rem;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.custom-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
}

.logo-icon {
    font-size: 2rem;
    background: rgba(255, 255, 255, 0.2);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 50%;
}

.bg-gradient-lunas {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

/* Dashboard Cards */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.card-body {
    padding: 10px 12px;
}

.card-icon {
    font-size: 1.2rem;
}

.card-title {
    color: #666;
    font-weight: 600;
    font-size: 0.75rem;
}

.card-value {
    font-size: 0.95rem;
    font-weight: 700;
}

.btn-edit-icon {
    font-size: 1rem;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-edit-icon:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

/* Card Colors */
.card-saldo {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

.card-saldo .card-value {
    color: #e67e22;
}

.card-tagihan {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
}

.card-tagihan .card-value {
    color: #e74c3c;
}

.card-lunas {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.card-lunas .card-value {
    color: #27ae60;
}

.card-profit {
    background: linear-gradient(135deg, #d299c2 0%, #fef9d7 100%);
}

.card-profit .card-value {
    color: #9b59b6;
}

.card-sisa {
    background: linear-gradient(135deg, #89f7fe 0%, #66a6ff 100%);
}

.card-sisa .card-value {
    color: #2980b9;
}

/* Bill Groups */
.bill-group {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.bill-group:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.aktif-group {
    border-left: 5px solid #e74c3c;
}

.lunas-group {
    border-left: 5px solid #27ae60;
}

.bill-header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.3s ease;
}

.bill-header:hover {
    background: #f8f9fa;
}

.bill-header h5 {
    margin: 0;
    color: #333;
}

.toggle-icon {
    transition: transform 0.3s ease;
}

.bill-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.bill-details.show {
    max-height: 1000px;
}

.bill-item {
    padding: 10px 15px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease;
    gap: 10px;
}

.bill-date {
    flex: 0 0 80px;
    font-size: 0.85rem;
    color: #666;
}

.bill-amount {
    flex: 1;
    font-weight: 600;
    font-size: 0.95rem;
}

.bill-actions {
    flex: 0 0 auto;
    display: flex;
    gap: 5px;
}

.bill-actions button {
    padding: 4px 8px;
    font-size: 0.9rem;
    min-width: 35px;
}

.bill-item:hover {
    background: #f8f9fa;
}

.bill-item.aktif {
    background: linear-gradient(to right, rgba(231, 76, 60, 0.05), transparent);
}

.bill-item.lunas {
    background: linear-gradient(to right, rgba(39, 174, 96, 0.05), transparent);
}

.action-buttons {
    display: flex;
    gap: 5px;
}

.action-buttons button {
    font-size: 0.75rem;
    padding: 4px 10px;
}

/* Form Styling */
.form-card {
    border: none;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.form-input-lg {
    padding: 8px 12px;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.form-input-lg:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.btn-add {
    padding: 8px 16px;
    font-weight: 600;
    border-radius: 10px;
    font-size: 0.9rem;
}

/* Profit Input */
.profit-input {
    width: 120px;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 4px 8px;
    padding-right: 25px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 20px;
    -moz-appearance: textfield;
    appearance: none;
}

.profit-input::-webkit-outer-spin-button,
.profit-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.profit-input::-webkit-outer-spin-button,
.profit-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.profit-input[type=number] {
    -moz-appearance: textfield;
}

.profit-input-wrapper {
    position: relative;
    display: inline-block;
}

.profit-arrows {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.profit-arrow {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: white;
    font-size: 0.7rem;
    padding: 2px 4px;
    cursor: pointer;
    border-radius: 2px;
    line-height: 1;
    transition: background 0.3s ease;
}

.profit-arrow:hover {
    background: rgba(255, 255, 255, 0.5);
}

.profit-input:focus {
    background: white;
    border-color: #667eea;
    color: #333;
    outline: none;
}

.profit-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Toast Notifications */
.toast-container {
    z-index: 9999;
}

.toast {
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease;
}

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

.toast-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.toast-error {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    color: white;
}

.toast-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

/* User Settings Modal */
#userSettingsModal {
    z-index: 1060 !important;
}

#userSettingsModal .modal-body input {
    pointer-events: auto !important;
}

#userSettingsModal .modal-body button {
    pointer-events: auto !important;
}

/* Custom Confirmation Modal */
.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    animation: fadeIn 0.3s ease;
}

#modalBackdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    animation: fadeIn 0.3s ease;
}

.custom-modal-content {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

.custom-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px;
    text-align: center;
    color: white;
}

.card-header h5 {
    font-weight: 600;
    margin: 0;
    opacity: 1;
    visibility: visible;
    display: block !important;
    color: #dc3545 !important;
}

.custom-modal-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    animation: pulse 2s infinite;
}

.custom-modal-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.custom-modal-body {
    padding: 30px 25px;
    text-align: center;
}

.confirm-message {
    font-size: 1rem;
    color: #333;
    margin: 0;
    line-height: 1.6;
}

.custom-modal-footer {
    padding: 20px 25px;
    display: flex;
    gap: 15px;
    justify-content: center;
    background: #f8f9fa;
}

.btn-cancel {
    padding: 10px 25px;
    border: 2px solid #ddd;
    background: white;
    color: #666;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background: #f0f0f0;
    border-color: #ccc;
}

.btn-confirm {
    padding: 10px 25px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

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

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .login-card,
    .public-card {
        padding: 30px 20px;
    }
    
    .card-icon {
        font-size: 1.5rem;
    }
    
    .card-value {
        font-size: 1rem;
    }
    
    .bill-item {
        padding: 8px 10px;
        gap: 5px;
    }
    
    .bill-date {
        flex: 0 0 60px;
        font-size: 0.75rem;
    }
    
    .bill-amount {
        font-size: 0.85rem;
    }
    
    .bill-actions button {
        padding: 3px 6px;
        font-size: 0.8rem;
        min-width: 30px;
    }
    
    .logo-icon {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .welcome-text {
        font-size: 0.75rem;
    }
    
    .navbar-brand {
        font-size: 0.95rem;
    }
}

@media (max-width: 576px) {
    .login-container,
    .public-container {
        padding: 10px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .bill-item {
        padding: 6px 8px;
        gap: 3px;
    }
    
    .bill-date {
        flex: 0 0 50px;
        font-size: 0.7rem;
    }
    
    .bill-amount {
        font-size: 0.8rem;
    }
    
    .bill-actions button {
        padding: 2px 5px;
        font-size: 0.75rem;
        min-width: 25px;
    }
    
    .bill-actions {
        gap: 3px;
    }
}
