.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);
    transition: opacity 0.5s ease;
}

.modal.show {
    display: block;
    opacity: 1;
}

.modal-content {
    background-color: #ffffff;
    margin: 5% auto;
    padding: 2rem;
    border: 1px solid #888;
    width: 90%;
    max-width: 600px;
    box-sizing: border-box;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.modal-content h2 {
    color: #2c3e50;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 600;
    margin-top: 0;
}

.modal-form-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    color: #34495e;
    font-size: 0.9rem;
    font-weight: 500;
}

.input-wrapper {
    position: relative;
    width: 100%;
}

.input-wrapper input,
.input-wrapper select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    height: 2.5em;
    line-height: 1.5em;
    box-sizing: border-box;
    background-color: #f8f9fa;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.input-wrapper input:focus,
.input-wrapper select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.input-wrapper input[readonly] {
    background-color: #e9ecef;
    cursor: not-allowed;
}

.form-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    height: 2.5em;
    line-height: 1.5em;
    box-sizing: border-box;
    background-color: #f8f9fa;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-input[readonly] {
    background-color: #e9ecef;
    cursor: not-allowed;
}

.input-currency-suffix {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0;
    padding: 0;
    pointer-events: none;
    line-height: 1;
    display: flex;
    align-items: center;
}

.currency-type-input {
    padding-right: 3.5rem !important;
}

select option {
    font-size: 1rem;
    padding: 0.5rem;
    font-family: inherit;
}

.form-row-buttons {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
}

.form-row.checksum {
    grid-column: 1 / -1;
    align-items: flex-end;
    margin-left: auto;
    max-width: 300px;
}

.form-row.booking-table-container {
    grid-column: 1 / -1;
    width: 100%;
    display: block;
}

.booking-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.booking-table thead th {
    text-align: left;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.booking-table tbody td {
    padding: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

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

.booking-table input {
    width: 100%;
    margin: 0;
}

.select-account-table-cell {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    height: 2.5em;
    line-height: 1.5em;
    box-sizing: border-box;
    background-color: #f8f9fa;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0;
}

.select-account-table-cell:hover {
    background-color: #e9ecef;
    border-color: #3498db;
}

.select-account-table-cell:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.select-account-table-cell.selected {
    background-color: #d4edda;
    border-color: #28a745;
    color: #155724;
    font-weight: 600;
}

.table-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.btn-add-row {
    background-color: #2980b9;
    color: white;
    border: none;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.btn-add-row:hover {
    background-color: #21618c;
    transform: scale(1.05);
}

.btn-add-row:active {
    transform: scale(0.95);
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    height: 3em;
}

.btn i {
    font-size: 1rem;
}

.modal-button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 3em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.confirm-modal {
    background-color: #3498db;
    color: white;
}

.confirm-modal:hover {
    background-color: #2980b9;
}

.close-modal {
    background-color: #e9ecef;
    color: #495057;
    border: 1px solid #dee2e6;
}

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

/* Account Selection Table Styles */
.accounts-table-container {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.accounts-table {
    font-size: 0.9rem;
}

.accounts-table thead th {
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.accounts-table .account-row {
    transition: all 0.2s ease;
}

.accounts-table .account-row:hover {
    background-color: #f8f9fa !important;
}

.accounts-table .account-row.selected {
    background-color: #e7f3ff !important;
    font-weight: 500;
}

#select-account-modal .modal-content {
    max-width: 800px;
}

#select-account-modal .modal-form-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (max-width: 768px) {
    .modal-form-container {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        padding: 1.5rem;
        margin: 10% auto;
    }
    
    .form-row-buttons {
        flex-direction: column;
    }
    
    .accounts-table {
        font-size: 0.8rem;
    }
    
    .accounts-table thead th,
    .accounts-table td {
        padding: 0.5em !important;
    }
}
