/* Project: Offline Credit Card Form based in part on https://github.com/jessepollak/card
 * Description: Form to validate and store credit card payment details using CardJs to visually display the card.
 * Author: Leamsi Fontánez - R1 Software - lfontanez@r1software.com
 * Version: 1.0
 * Build: 04062024.1645
 *
 * This is always needed for PHP and HTML versions 
 */
 
 /* CUSTOM CSS */
.navbar { 
    background-color: #3A2E25 !important;
}
.nav-link { 
    color: #F2A102 !important;
}
body > footer {
    background-color: #211b18;
}
.copyright, .powered-by {
    color: #8e847f;
}
.age-restriction {
    color: #fff;
}
a.footer-link{
    font: normal 18px/24px Roboto Slab;
    color: #645850;
}
a.nav-link:hover, a.footer-link:hover {
    color: #fff !important;
}
.error {
  color: red;
}
.appears-valid {
  color: green;
}

/* Expiry Datepicker Styles */
.expiry-datepicker-container {
    position: relative;
    margin-top: 0;
}

.expiry-datepicker-wrapper {
    position: relative;
}

.expiry-datepicker-popup {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    width: 400px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.expiry-datepicker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
}

.expiry-datepicker-header h5 {
    margin: 0;
    font-size: 16px;
}

.expiry-datepicker-body {
    padding: 15px;
}

.expiry-datepicker-footer {
    padding: 10px 15px;
    border-top: 1px solid #eee;
    text-align: right;
}

.expiry-datepicker-footer button {
    margin-left: 10px;
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin-bottom: 15px;
}

.year-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-height: 200px;
    overflow-y: auto;
}

.month-btn, .year-btn {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.month-btn:hover, .year-btn:hover {
    background-color: #e9ecef;
}

.month-btn.selected, .year-btn.selected {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.month-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f8f9fa;
    color: #6c757d;
}

#expiryDatepickerBtn {
    width: 100%;
    margin-top: 0;
}

/* Dark Mode Styles */
.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

.dark-mode .navbar {
    background-color: #1e1e1e !important;
}

.dark-mode .card-wrapper {
    filter: brightness(0.85);
}

.dark-mode .form-control {
    background-color: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

.dark-mode .input-group-text {
    background-color: #333;
    border-color: #444;
    color: #e0e0e0;
}

.dark-mode .modal-content {
    background-color: #1e1e1e;
    color: #e0e0e0;
}

.dark-mode .close {
    color: #e0e0e0;
}

.dark-mode .btn-outline-secondary {
    color: #e0e0e0;
    border-color: #444;
}

.dark-mode .btn-outline-secondary:hover {
    background-color: #444;
    color: #fff;
}

.dark-mode .expiry-datepicker-popup {
    background-color: #1e1e1e;
    border-color: #444;
}

.dark-mode .expiry-datepicker-header,
.dark-mode .expiry-datepicker-footer {
    border-color: #444;
}

.dark-mode .month-btn,
.dark-mode .year-btn {
    background-color: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

.dark-mode .month-btn:hover,
.dark-mode .year-btn:hover {
    background-color: #444;
}

.dark-mode .month-btn.selected,
.dark-mode .year-btn.selected {
    background-color: #0056b3;
}

.dark-mode .month-btn.disabled {
    color: #777;
}

.dark-mode footer {
    background-color: #1e1e1e !important;
}

.dark-mode .appears-valid {
    color: #4caf50;
}

.dark-mode .error {
    color: #f44336;
}

/* Card type info styles */
#card_type_info {
    margin-top: 5px;
    font-weight: 500;
}

.dark-mode #card_type_info {
    color: #adb5bd;
}

/* Dark mode toggle button */
.dark-mode-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #333;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.dark-mode-toggle:hover {
    background-color: #444;
    transform: scale(1.05);
}

.dark-mode-toggle:focus {
    outline: none;
}

.dark-mode .dark-mode-toggle {
    background-color: #f0f0f0;
    color: #333;
}

.dark-mode .dark-mode-toggle:hover {
    background-color: #e0e0e0;
}

/* ACH Payment Styles */
.payment-method-toggle {
    margin-bottom: 20px;
    text-align: center;
}

.payment-method-toggle .btn-group {
    width: 100%;
    max-width: 400px;
}

.payment-method-toggle .btn {
    width: 50%;
}

.payment-method-toggle .btn.active {
    background-color: #007bff;
    color: white;
}

.account-type-toggle {
    margin-bottom: 15px;
}

.account-type-toggle .form-check {
    display: inline-block;
    margin-right: 15px;
}

#ach-form {
    display: none;
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.dark-mode #ach-form {
    background-color: #2d2d2d;
}

.bank-icon {
    font-size: 24px;
    margin-right: 10px;
    color: #007bff;
}

.dark-mode .bank-icon {
    color: #0d6efd;
}

.ach-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.ach-header h4 {
    margin: 0;
}

.ach-info {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 15px;
}

.dark-mode .ach-info {
    color: #adb5bd;
}

/* Transaction Status Styles */
.transaction-status-container {
    margin: 20px 0;
}

.transaction-status {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    animation: fadeIn 0.3s ease-in-out;
}

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

.transaction-status i {
    font-size: 24px;
    margin-right: 10px;
}

.transaction-status.processing {
    background-color: #e9f5ff;
    color: #0066cc;
    border-left: 4px solid #0066cc;
}

.transaction-status.success {
    background-color: #e6f7e6;
    color: #28a745;
    border-left: 4px solid #28a745;
}

.transaction-status.error {
    background-color: #fff2f2;
    color: #dc3545;
    border-left: 4px solid #dc3545;
}

.error-list {
    margin-top: 10px;
    padding-left: 20px;
    color: #dc3545;
}

/* Dark mode styles for transaction status */
.dark-mode .transaction-status.processing {
    background-color: #0a2e4a;
    color: #5abaff;
    border-left: 4px solid #0066cc;
}

.dark-mode .transaction-status.success {
    background-color: #0a2e1a;
    color: #5cd675;
    border-left: 4px solid #28a745;
}

.dark-mode .transaction-status.error {
    background-color: #3a0a0a;
    color: #ff6b6b;
    border-left: 4px solid #dc3545;
}

.navbar-light .navbar-toggler-icon {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255, 255, 255, 0.8)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}
.card-wrapper {
    width: 100%;
}
form {
    margin-top: 20px;
}
.navbar-brand {
    font-family: 'Roboto Slab', serif;
    color: #ffffff !important;
    font-size: 1.2em;
}
.currency-field {
    width: 100%; 
    max-width: 200px;
    margin: 15px auto;
}

/* For Chrome, Safari, Edge, Opera */
input[name=phone]::-webkit-outer-spin-button,
input[name=phone]::-webkit-inner-spin-button,
input[name=cvc]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* For Firefox */
input[name=phone] {
  -moz-appearance: textfield;
}
