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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 0;
    direction: rtl;
    overflow-x: hidden;
    color: #333;
}

body[dir="ltr"] {
    direction: ltr;
}

.container {
    width: 100%;
    max-width: 100%;
    background: #ffffff;
    min-height: 100vh;
    padding: 15px 12px 20px;
}

/* Language Toggle */
.language-toggle {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 15px;
}

body[dir="ltr"] .language-toggle {
    justify-content: flex-start;
}

.lang-btn {
    padding: 5px 10px;
    border: none;
    background: transparent;
    color: #d32f2f;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.lang-btn:hover {
    background: #f5f5f5;
}

.lang-btn.active {
    font-weight: 600;
}

/* Header Section */
.header-section {
    text-align: center;
    margin-bottom: 15px;
}

.main-title {
    font-size: 16px;
    color: #d32f2f;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

.date-time {
    font-size: 13px;
    color: #d32f2f;
    margin-bottom: 10px;
}

/* Logo */
.logo-container {
    text-align: center;
    margin-bottom: 20px;
}

.logo {
    max-width: 120px;
    height: auto;
    margin-bottom: 8px;
}

.logo-text {
    margin-bottom: 8px;
}

.benefit-text {
    font-size: 16px;
    color: #333;
    font-weight: 500;
    margin-bottom: 2px;
}

.benefit-text-en {
    font-size: 14px;
    color: #333;
    margin-bottom: 5px;
}

.url-text {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.url-text div {
    margin-bottom: 2px;
}

/* Form Container */
.form-container {
    width: 100%;
    margin-bottom: 25px;
}

/* Input Group */
.input-group {
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

body[dir="rtl"] .input-group {
    flex-direction: row-reverse;
}

.input-label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
    flex: 0 0 40%;
    text-align: right;
}

body[dir="ltr"] .input-label {
    text-align: left;
}

.value-display {
    flex: 1;
    font-size: 14px;
    color: #333;
    font-weight: bold;
    text-align: left;
    padding: 8px 0;
}

body[dir="ltr"] .value-display {
    text-align: right;
}

.card-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    text-align: left;
    transition: all 0.2s ease;
    background: #ffffff;
    color: #333;
    letter-spacing: 1px;
}

body[dir="rtl"] .card-input {
    text-align: right;
}

.card-input:focus {
    outline: none;
    border-color: #d32f2f;
    box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.1);
}

.card-input::placeholder {
    color: #999;
    letter-spacing: normal;
}

.pin-input {
    font-size: 18px;
    letter-spacing: 4px;
    font-weight: bold;
}

/* Expiry Date Inputs */
.expiry-inputs {
    flex: 1;
    display: flex;
    gap: 8px;
    justify-content: flex-start;
}

body[dir="rtl"] .expiry-inputs {
    justify-content: flex-end;
}

.expiry-select {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    background: #ffffff;
    color: #333;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

body[dir="rtl"] .expiry-select {
    background-position: left 10px center;
    padding-right: 12px;
    padding-left: 30px;
}

.expiry-select:focus {
    outline: none;
    border-color: #d32f2f;
    box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.1);
}

/* Number Pad */
.number-pad {
    margin-top: 20px;
    padding: 15px 10px;
    background: transparent;
}

.pad-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

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

.pad-btn {
    flex: 1;
    padding: 15px 8px;
    border: none;
    background: #d32f2f;
    color: #ffffff;
    font-size: 18px;
    font-weight: 500;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.1s ease;
    min-height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pad-btn:active {
    background: #b71c1c;
    transform: scale(0.98);
}

.clear-btn,
.delete-btn,
.enter-btn {
    background: #d32f2f;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
}

.enter-btn {
    flex: 2;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-btn {
    background: #d32f2f;
    color: #ffffff;
}

.cancel-btn:active {
    background: #b71c1c;
    transform: scale(0.98);
}

.pay-btn {
    background: #d32f2f;
    color: #ffffff;
}

.pay-btn:active {
    background: #b71c1c;
    transform: scale(0.98);
}

.pay-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Footer Section */
.footer-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
}

.accepted-cards-link {
    display: block;
    color: #d32f2f;
    text-decoration: underline;
    font-size: 13px;
    margin-bottom: 15px;
}

.note-section {
    text-align: right;
    font-size: 12px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

body[dir="ltr"] .note-section {
    text-align: left;
}

.note-section strong {
    color: #333;
    font-weight: 600;
}

.note-text {
    display: block;
    margin-top: 5px;
}

.link-text {
    color: #d32f2f;
    text-decoration: underline;
}

.footer-logo {
    margin: 20px 0;
}

.footer-logo-img {
    max-width: 80px;
    height: auto;
    margin-bottom: 5px;
}

.footer-logo-text {
    font-size: 12px;
    color: #333;
}

.footer-logo-text div {
    margin-bottom: 2px;
}

.copyright-section {
    font-size: 11px;
    color: #666;
    line-height: 1.6;
    text-align: center;
}

.copyright-text {
    margin-bottom: 5px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pin-group,
.number-pad,
.action-buttons {
    animation: fadeIn 0.3s ease;
}

/* Mobile Optimizations */
@media (max-width: 480px) {
    .container {
        padding: 12px 10px 18px;
    }

    .main-title {
        font-size: 14px;
    }

    .date-time {
        font-size: 12px;
    }

    .input-group {
        margin-bottom: 12px;
    }

    .input-label {
        font-size: 12px;
    }

    .card-input,
    .expiry-select {
        padding: 9px 10px;
        font-size: 13px;
    }

    .pad-btn {
        padding: 12px 6px;
        font-size: 16px;
        min-height: 40px;
    }

    .number-pad {
        padding: 12px 8px;
    }

    .pad-row {
        gap: 6px;
        margin-bottom: 6px;
    }

    .btn {
        padding: 11px;
        font-size: 14px;
    }

    .note-section,
    .copyright-section {
        font-size: 11px;
    }
}

/* Prevent zoom on input focus (iOS) */
@media screen and (max-width: 768px) {
    input,
    select,
    textarea {
        font-size: 16px !important;
    }
}
