/* assets/css/style.css */
/* Custom CSS untuk aplikasi Fun Run */

:root {
    --primary-color: #007bff;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --secondary-color: #6c757d;
    --dark-color: #343a40;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* Header Styles - UPDATED */
.header-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem 0;
    position: relative;
    overflow: hidden;
}

.header-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.1" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,112C672,96,768,96,864,112C960,128,1056,160,1152,160C1248,160,1344,128,1392,112L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
}

.header-logo {
    max-height: 60px; /* REDUCED from 80px */
    width: auto;
    border-radius: 8px;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.header-content {
    flex: 1;
    min-width: 0; /* Allow text to wrap properly */
}

.header-title {
    font-size: 2.2rem; /* REDUCED from 2.5rem */
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 0;
    line-height: 1.1; /* TIGHTENED line height */
}

.header-subtitle {
    font-size: 1rem; /* REDUCED from 1.1rem */
    opacity: 0.9;
    font-weight: 500;
    margin-top: 0.25rem;
}

/* Header Menu Styles - NEW */
.header-menu {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.header-menu .btn {
    white-space: nowrap;
    font-size: 0.875rem;
}

/* Floating Menu Styles - UPDATED with Permanent Label */
.floating-menu {
    position: fixed;
    bottom: 80px; /* INCREASED from 20px to avoid footer overlap */
    right: 20px;
    z-index: 1000;
}

.btn-floating-with-label {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.floating-label {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    animation: slideInFromRight 0.3s ease-out;
    transition: all 0.3s ease;
}

@keyframes slideInFromRight {
    from { 
        transform: translateX(20px); 
        opacity: 0; 
    }
    to { 
        transform: translateX(0); 
        opacity: 1; 
    }
}

.btn-floating {
    width: 60px;
    height: 60px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    flex-shrink: 0;
}

.btn-floating:hover {
    transform: scale(1.1);
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.2);
    color: white;
}

.btn-floating:focus,
.btn-floating:active {
    color: white;
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.2);
}

.btn-floating i {
    font-size: 1.25rem;
}

.btn-floating-with-label:hover .floating-label {
    background: rgba(0, 123, 255, 0.9);
    transform: scale(1.05);
}

.btn-floating-with-label:hover .btn-floating {
    transform: scale(1.1);
}

.btn-floating-with-label:focus,
.btn-floating-with-label:active {
    text-decoration: none;
}

/* Footer Styles - NEW */
.footer-section {
    background: linear-gradient(135deg, #343a40 0%, #495057 100%);
    border-top: 3px solid var(--primary-color);
    margin-top: auto; /* Push footer to bottom */
}

.footer-section p {
    font-size: 0.9rem;
    font-weight: 500;
}

.footer-section small {
    font-size: 0.8rem;
}
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.card-header {
    border-bottom: none;
    font-weight: 600;
}

/* Form Styles */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* Size Chart Styles - FIXED for better mobile responsiveness */
.size-chart-container {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 200px;
}

.size-chart-img {
    width: 100%;
    max-width: 100%;
    height: auto;
    cursor: pointer;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: all 0.3s ease;
    object-fit: contain;
    min-width: 120px;
}

.size-chart-img:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.size-chart-text {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
    display: block;
    text-align: center;
}

/* Conditional Fields Animation */
.conditional-field {
    transition: all 0.3s ease;
    overflow: hidden;
}

.conditional-field.hidden {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
    transform: translateY(-10px);
}

.conditional-field.visible {
    max-height: 200px;
    opacity: 1;
    transform: translateY(0);
}

/* Family Member Styles */
.family-member {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    position: relative;
    transition: all 0.3s ease;
}

.family-member:hover {
    border-color: var(--info-color);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.btn-remove-family {
    background-color: var(--danger-color);
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-remove-family:hover {
    background-color: #c82333;
    transform: scale(1.1);
}

/* Total Biaya Styles - Updated for dynamic pricing */
.total-biaya {
    font-size: 1.3em;
    font-weight: bold;
    color: var(--success-color);
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    transition: all 0.3s ease;
}

.total-biaya.updated {
    transform: scale(1.05);
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: var(--warning-color);
}

.biaya-breakdown {
    font-size: 0.9em;
    color: var(--secondary-color);
    margin-top: 0.5rem;
}

/* Button Styles */
.btn {
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    border: none;
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    border: none;
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border: none;
}

.btn-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    border: none;
}

/* Badge Styles */
.badge {
    padding: 0.5em 0.75em;
    font-size: 0.85em;
    border-radius: 6px;
}

/* Table Styles */
.table {
    border-radius: 8px;
    overflow: hidden;
}

.table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: rgba(0, 0, 0, 0.02);
}

.table-hover > tbody > tr:hover > td {
    background-color: rgba(0, 123, 255, 0.1);
}

.sticky-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #f8f9fa !important;
}

/* Facilities Table Styles */
.table-bordered {
    border: 2px solid #dee2e6;
}

.table-bordered th,
.table-bordered td {
    border: 1px solid #dee2e6;
    vertical-align: middle;
}

.table-dark th {
    background-color: #343a40;
    border-color: #454d55;
}

/* Bukti Transfer Styles */
.bukti-transfer {
    max-width: 60px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.bukti-transfer:hover {
    transform: scale(1.1);
    border-color: var(--primary-color);
}

/* Modal Styles */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

.modal-header {
    border-bottom: 1px solid #e0e0e0;
    border-radius: 12px 12px 0 0;
}

.modal-footer {
    border-top: 1px solid #e0e0e0;
    border-radius: 0 0 12px 12px;
}

.modal-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

/* Success Animation */
.success-animation {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Alert Styles */
.alert {
    border-radius: 8px;
    border: none;
    font-weight: 500;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
}

/* Phone Number Input Styles */
input[type="tel"] {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M1.885.511a1.745 1.745 0 0 1 2.61.163L6.29 2.98c.329.423.445.974.315 1.494l-.547 2.19a.678.678 0 0 0 .178.643l2.457 2.457a.678.678 0 0 0 .644.178l2.189-.547a1.745 1.745 0 0 1 1.494.315l2.306 1.794c.829.645.905 1.87.163 2.611l-1.034 1.034c-.74.74-1.846 1.065-2.877.702a18.634 18.634 0 0 1-7.01-4.42 18.634 18.634 0 0 1-4.42-7.009c-.362-1.03-.037-2.137.703-2.877L1.885.511z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 16px;
    padding-right: 2.5rem;
}

/* Validation Styles */
.is-valid {
    border-color: #28a745;
}

.is-invalid {
    border-color: #dc3545;
}

.valid-feedback {
    color: #28a745;
    font-size: 0.875rem;
}

.invalid-feedback {
    color: #dc3545;
    font-size: 0.875rem;
}

/* Status Badge Styles */
.status-badge {
    font-size: 0.8em;
    padding: 0.25em 0.5em;
    border-radius: 4px;
}

.status-dinas {
    background-color: #6c757d;
    color: white;
}

.status-libur {
    background-color: #17a2b8;
    color: white;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .header-section {
        padding: 1rem 0;
    }
    
    .header-title {
        font-size: 1.5rem; /* FURTHER REDUCED for mobile */
        line-height: 1.2;
    }
    
    .header-subtitle {
        font-size: 0.85rem; /* REDUCED for mobile */
    }
    
    .header-logo {
        max-height: 45px; /* FURTHER REDUCED for mobile */
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .family-member {
        padding: 15px;
    }
    
    .floating-menu {
        bottom: 75px; /* ADJUSTED for mobile footer */
        right: 15px;
    }
    
    .floating-label {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
    
    .btn-floating {
        width: 50px;
        height: 50px;
    }
    
    .btn-floating i {
        font-size: 1rem;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
    
    .badge {
        font-size: 0.75em;
    }
    
    /* Size Chart Mobile Optimization - FIXED */
    .size-chart-container {
        max-width: 150px;
    }
    
    .size-chart-img {
        min-width: 100px;
    }
    
    .size-chart-text {
        font-size: 0.75rem;
    }
    
    /* Total Biaya Mobile */
    .total-biaya {
        font-size: 1.1em;
    }
    
    .biaya-breakdown {
        font-size: 0.8em;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-group-sm .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .header-title {
        font-size: 1.25rem; /* EXTRA SMALL for very small screens */
        line-height: 1.1;
    }
    
    .header-subtitle {
        font-size: 0.75rem;
    }
    
    .header-logo {
        max-height: 40px; /* SMALLEST size for tiny screens */
    }
    
    /* Size Chart Extra Small Mobile - FIXED */
    .size-chart-container {
        max-width: 120px;
    }
    
    .size-chart-img {
        min-width: 80px;
    }
    
    .size-chart-text {
        font-size: 0.7rem;
    }
    
    .floating-menu {
        bottom: 70px; /* ADJUSTED for small mobile footer */
        right: 10px;
    }
    
    .floating-label {
        font-size: 0.75rem;
        padding: 5px 8px;
    }
    
    .btn-floating {
        width: 45px;
        height: 45px;
    }
    
    .btn-floating i {
        font-size: 0.9rem;
    }
}

/* ADDED: Extra small devices */
@media (max-width: 360px) {
    .header-title {
        font-size: 1.1rem;
        line-height: 1;
    }
    
    .header-subtitle {
        font-size: 0.7rem;
    }
    
    .header-logo {
        max-height: 35px;
    }
    
    .size-chart-container {
        max-width: 100px;
    }
    
    .size-chart-img {
        min-width: 70px;
    }
    
    .size-chart-text {
        font-size: 0.65rem;
    }
}

/* Loading Styles */
.spinner-border {
    color: var(--primary-color);
}

/* Print Styles */
@media print {
    .btn, .modal, .floating-menu, .footer-section {
        display: none !important;
    }
    
    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }
    
    .header-section {
        background: none !important;
        color: black !important;
    }
    
    .table {
        font-size: 0.8rem;
    }
}

/* Custom Scrollbar */
.table-responsive::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Additional Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--info-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.shadow {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.shadow-lg {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;
}