/* 
   ==========================================================================
   GLOBAL RESET & BASE STYLES
   ========================================================================== 
*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* 
   ==========================================================================
   FORM STYLE FOR form_individu.php & details_larian.php
   ========================================================================== 
*/

.form-body {
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.7)), url('img/laa.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    padding: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Poppins', sans-serif;
    color: #333; 
}

.form-container {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    max-width: 800px;
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
    padding: 2.5rem;
    overflow: hidden;
    color: #333;
}

.logos-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-logo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 4px solid #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.form-header {
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 1.5rem;
}

.form-header h2 {
    color: #003366;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.form-header p {
    color: #666;
    font-size: 1rem;
}

.form-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border-left: 5px solid #0069d9;
}

.form-section h3 {
    color: #004a99;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input, 
.form-group select {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s;
    background: white;
    color: #333;
}

.form-group input:hover,
.form-group select:hover {
    border-color: #004a99;
}

.form-group input:focus, 
.form-group select:focus {
    border-color: #0069d9;
    box-shadow: 0 0 0 4px rgba(0, 105, 217, 0.1);
    outline: none;
    transform: translateY(-2px);
}

.form-row {
    display: flex;
    gap: 1.5rem;
}

.form-group.half {
    flex: 1;
}

.form-hint {
    display: block;
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    margin-top: -0.3rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.submit-btn {
    flex: 2;
    background: linear-gradient(135deg, #0069d9, #004a99);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 100%;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 105, 217, 0.3);
}

.cancel-btn {
    flex: 1;
    background: white;
    color: #003366;
    border: 2px solid #003366;
    padding: 1rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.cancel-btn:hover {
    background: #003366;
    color: white;
    border-color: #003366;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 51, 102, 0.2);
}

/* Radio Button and Checkbox Styles */
.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 1.1rem;
    color: #333;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s;
    margin-bottom: 0.5rem;
}

.radio-label:hover {
    background: #e9ecef;
}

.radio-label input[type="radio"],
.radio-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 15px;
    accent-color: #0069d9;
    cursor: pointer;
}

/* Card Selection Styles for Distance (New) */
.selection-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
}

.selection-card {
    position: relative;
    cursor: pointer;
}

.selection-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    background: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
}

.card-content:hover {
    border-color: #0056b3;
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 86, 179, 0.15);
}

.selection-card input[type="radio"]:checked + .card-content {
    border-color: #0056b3;
    background: linear-gradient(135deg, #e6f0fa 0%, #cce0f5 100%);
    box-shadow: 0 0 0 4px rgba(0, 86, 179, 0.2);
    transform: translateY(-5px);
}

.distance-icon {
    font-size: 2.5rem;
    margin-bottom: 0.8rem;
    transition: transform 0.3s;
}

.selection-card:hover .distance-icon {
    transform: scale(1.1);
}

.distance-label {
    font-size: 1.8rem;
    font-weight: 800;
    color: #333;
    line-height: 1;
    margin-bottom: 0.2rem;
}

.distance-sub {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Success Page Styles */
.success-container {
    text-align: center;
    padding: 3rem;
}

.success-icon {
    font-size: 5rem;
    color: #28a745;
    margin-bottom: 1.5rem;
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.success-container h2 {
    color: #003366;
    margin-bottom: 1rem;
    font-size: 2.5rem;
}

.success-container p {
    color: #555;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.success-actions {
    margin-top: 2rem;
}

.success-actions .submit-btn {
    display: inline-block;
    width: auto;
    padding: 1rem 3rem;
    text-decoration: none;
}

/* Bank Selection List */
.bank-list-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    background: #fff;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.bank-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s;
}

.bank-option:last-child {
    border-bottom: none;
}

.bank-option:hover {
    background: #f8f9fa;
    padding-left: 2rem; /* Slight slide effect */
}

.bank-name {
    font-size: 1rem;
    font-weight: 500;
    color: #333;
}

/* Custom Radio for Bank List */
.bank-option input[type="radio"] {
    display: none; /* Hide default radio */
}

/* 
   ==========================================================================
   TABLE STYLES (For form_berkumpul.php)
   ========================================================================== 
*/

.table-responsive {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.participant-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 1200px; /* Ensure horizontal scroll on small screens */
}

.participant-table th {
    background: #004a99;
    color: white;
    padding: 12px 10px;
    text-align: left;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
}

.participant-table th:first-child {
    border-top-left-radius: 8px;
}

.participant-table th:last-child {
    border-top-right-radius: 8px;
}

.participant-table td {
    background: white;
    padding: 8px;
    border-bottom: 1px solid #eee;
}

.participant-table tr:last-child td {
    border-bottom: none;
}

.participant-table tr:hover td {
    background: #f1f8ff;
}

.table-input, 
.table-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.table-input:focus, 
.table-select:focus {
    border-color: #0069d9;
    box-shadow: 0 0 0 3px rgba(0, 105, 217, 0.1);
    outline: none;
}

/* 
   ==========================================================================
   MODAL STYLES
   ========================================================================== 
*/

.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.5); 
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 600px;
    border-radius: 15px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    position: relative;
    animation: slideDown 0.3s ease-out;
}

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

.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover,
.close-modal:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

/* 
   ==========================================================================
   PAYMENT SECTION STYLES
   ========================================================================== 
*/
.payment-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    text-align: left;
    transition: transform 0.3s ease;
}

.payment-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px rgba(0,0,0,0.08);
}

.payment-instruction {
    margin-bottom: 20px;
    font-size: 1rem;
    color: #444;
    line-height: 1.6;
}

.bank-details {
    background: #f8fbff;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e1e8ed;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.bank-details::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: #0069d9;
}

.detail-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    font-size: 1.05rem;
    flex-wrap: wrap;
}

.detail-row:last-child {
    margin-bottom: 0;
}

.detail-row .label {
    width: 130px;
    font-weight: 600;
    color: #555;
    flex-shrink: 0;
}

.detail-row .value {
    font-weight: 700;
    color: #222;
    flex-grow: 1;
}

.pay-now-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #0069d9;
    color: white;
    padding: 12px 25px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 105, 217, 0.2);
    border: none;
    margin-top: 10px;
}

.pay-now-btn:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 105, 217, 0.3);
    color: white;
    text-decoration: none;
}

.pay-now-btn i {
    font-size: 1.1rem;
}

/* Custom File Upload Styling */
.upload-section {
    margin-top: 25px;
}

.upload-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.file-upload-wrapper {
    position: relative;
    width: 100%;
    height: 180px;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    background: #fafafa;
    transition: all 0.3s ease;
    overflow: hidden;
}

.file-upload-wrapper:hover {
    border-color: #0069d9;
    background: #f0f7ff;
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
    pointer-events: none; /* Let clicks pass to input */
}

.upload-placeholder i {
    font-size: 2.5rem;
    color: #0069d9;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.file-upload-wrapper:hover .upload-placeholder i {
    transform: translateY(-5px);
}

.upload-placeholder span {
    font-weight: 600;
    font-size: 1rem;
    color: #444;
    margin-bottom: 5px;
}

.upload-placeholder small {
    font-size: 0.85rem;
    color: #888;
}

/* File Preview Styling */
#file-preview-container {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #eee;
    margin-top: 15px;
    text-align: center;
}

#file-preview-text {
    word-break: break-all;
    margin-top: 10px;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .detail-row .label {
        width: 100%;
        color: #666;
        font-size: 0.9rem;
    }
    
    .detail-row .value {
        font-size: 1.1rem;
    }
    
    .pay-now-btn {
        width: 100%;
        justify-content: center;
    }
    
    .file-upload-wrapper {
        height: 150px;
    }
}

.view-chart-btn {
    background: transparent;
    border: 2px solid #0069d9;
    color: #0069d9;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.view-chart-btn:hover {
    background: #0069d9;
    color: white;
}


.radio-checkmark {
    width: 22px;
    height: 22px;
    border: 2px solid #ddd;
    border-radius: 50%;
    position: relative;
    transition: all 0.2s;
}

.bank-option input[type="radio"]:checked + .radio-checkmark {
    border-color: #0056b3; /* Theme blue */
    background: #0056b3;
    box-shadow: 0 0 10px rgba(0, 86, 179, 0.3);
}

.radio-checkmark::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.bank-option input[type="radio"]:checked + .radio-checkmark::after {
    transform: translate(-50%, -50%) scale(1);
}

/* Scrollbar for bank list */
.bank-list-container::-webkit-scrollbar {
    width: 8px;
}

.bank-list-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.bank-list-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.bank-list-container::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* 
   ==========================================================================
   PARTICIPANT CARD STYLES (For form_berkumpul.php)
   ========================================================================== 
*/

#participants-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.participant-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.participant-card:hover {
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    border-color: #0069d9;
}

.card-header {
    background: #004a99;
    color: white;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #003366;
}

.card-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 1.5rem;
}

.card-section {
    margin-bottom: 2rem;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 1.5rem;
}

.card-section:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.card-section h5 {
    color: #004a99;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.card-field {
    display: flex;
    flex-direction: column;
}

.card-field.full-width {
    grid-column: 1 / -1;
}

.card-field label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.3rem;
    font-weight: 600;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #e0e0e0;
    color: #888;
}

/* Reuse existing input styles but ensure they fit the card */
.table-input, 
.table-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s;
}

.table-input:focus, 
.table-select:focus {
    border-color: #0069d9;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 105, 217, 0.1);
}

@media (max-width: 768px) {
    .card-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 576px) {
    .card-grid {
        grid-template-columns: 1fr;
    }
    
    .form-container {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .selection-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}
