/* Order Summary Modal Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #241F26;
}

/* Modal Overlay */
.order-summary-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
}

/* Modal Container */
.modal-container {
    position: relative;
    background-color: #ffffff;
    border-radius: 16px;
    max-width: 1000px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1;
    display: flex;
    flex-direction: column;
}

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid #E9EAF0;
}

.modal-title {
    font-size: 28px;
    font-weight: 700;
    color: #241F26;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    color: #737784;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #241F26;
}

/* Modal Content Wrapper */
.modal-content-wrapper {
    display: flex;
    min-height: 500px;
    max-height: calc(90vh - 100px);
    overflow: hidden;
}

/* Left Panel - Course Details */
.course-details-panel {
    flex: 0 0 50%;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
    border-right: 1px solid #E9EAF0;
}

.course-image-wrapper {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
}

.course-image-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #f7f7f9 0%, #e5e7eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.course-image-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
}

.course-image-text {
    font-size: 72px;
    font-weight: 400;
    color: #241F26;
    text-decoration: underline;
    text-decoration-color: #ef4444;
    text-underline-offset: 8px;
    font-style: italic;
    position: relative;
}

/* Course Info */
.course-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.course-title {
    font-size: 20px;
    font-weight: 600;
    color: #241F26;
    line-height: 1.4;
    margin: 0;
}

.course-description {
    font-size: 14px;
    line-height: 1.6;
    color: #737784;
    margin: 0;
}

/* Right Panel - Order Summary */
.order-summary-panel {
    flex: 1;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    background-color: #ffffff;
}

.order-summary-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #241F26;
    margin: 0;
}

.order-summary-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.summary-label {
    font-size: 14px;
    color: #737784;
    font-weight: 400;
}

.summary-value {
    font-size: 14px;
    color: #241F26;
    font-weight: 500;
}

.summary-total {
    border-top: 1px solid #E9EAF0;
    border-bottom: 1px solid #E9EAF0;
    padding: 16px 0;
    margin: 8px 0;
}

.summary-total .summary-label {
    font-weight: 600;
    color: #241F26;
}

.summary-total .summary-value {
    font-weight: 700;
    font-size: 16px;
}

.product-type-badge {
    display: inline-block;
    padding: 6px 12px;
    background-color: #2563eb;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 4px;
}

.coupon-row {
    margin-top: 8px;
}

.apply-coupon-link {
    color: #2563eb;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.apply-coupon-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Coupon List/Carousel Section */
.coupon-list-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #E9EAF0;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.coupon-carousel-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.coupon-nav-button {
    background: none;
    border: 1px solid #E9EAF0;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #737784;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}

.coupon-nav-button:hover:not(:disabled) {
    border-color: #2563eb;
    color: #2563eb;
    background-color: #f0f9ff;
}

.coupon-nav-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.coupon-carousel-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    min-height: 100px;
}

.coupon-card {
    display: none;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background-color: #f9fafb;
    border-radius: 8px;
    animation: fadeIn 0.3s ease;
}

.coupon-card.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.coupon-code-box {
    padding: 10px 14px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background-color: #eff6ff;
    color: #1e40af;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.05em;
}

.coupon-discount-text {
    font-size: 13px;
    color: #737784;
    text-align: center;
    line-height: 1.4;
}

.coupon-apply-btn {
    padding: 10px 20px;
    background-color: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    width: 100%;
}

.coupon-apply-btn:hover {
    background-color: #1d4ed8;
    transform: translateY(-1px);
}

.coupon-apply-btn:active {
    transform: translateY(0);
}

.no-coupons {
    text-align: center;
    padding: 20px;
    color: #737784;
    font-size: 14px;
}

/* Coupon Applied State */
.coupon-discount-value {
    font-size: 14px;
    color: #ef4444;
    font-weight: 500;
}

.coupon-applied-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #E9EAF0;
    gap: 12px;
    animation: slideDown 0.3s ease;
    flex-wrap: wrap;
}

.coupon-success-message {
    font-size: 14px;
    color: #10b981;
    font-weight: 500;
    flex: 1;
}

.remove-coupon-button {
    padding: 8px 16px;
    background-color: #fff7ed;
    color: #ea580c;
    border: 1px solid #ea580c;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
}

.remove-coupon-button:hover {
    background-color: #ffedd5;
    transform: translateY(-1px);
}

.remove-coupon-button:active {
    transform: translateY(0);
}

/* Proceed Button */
.proceed-button {
    width: 100%;
    padding: 14px 24px;
    background-color: #10b981;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    margin-top: auto;
}

.proceed-button:hover {
    background-color: #059669;
    transform: translateY(-1px);
}

.proceed-button:active {
    transform: translateY(0);
}

/* Checkout Form Panel */
.checkout-form-panel {
    flex: 1;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    background-color: #ffffff;
    overflow-y: auto;
}

.checkout-form-title {
    font-size: 20px;
    font-weight: 600;
    color: #241F26;
    margin: 0;
}

.checkout-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-field label {
    font-size: 14px;
    font-weight: 500;
    color: #241F26;
}

.form-field .required {
    color: #ef4444;
}

.form-field input,
.form-field select,
.form-field textarea {
    padding: 10px 14px;
    border: 1px solid #E9EAF0;
    border-radius: 8px;
    font-size: 14px;
    color: #241F26;
    background-color: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    font-family: inherit;
}

.form-field input:disabled,
.form-field select:disabled,
.form-field textarea:disabled {
    background-color: #f7f7f9;
    color: #737784;
    cursor: not-allowed;
}

.form-field input:focus:not(:disabled),
.form-field select:focus:not(:disabled),
.form-field textarea:focus:not(:disabled) {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-field input::placeholder,
.form-field textarea::placeholder {
    color: #9ca3af;
}

.form-field textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-field select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%2373784' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Fix country select width to prevent UI disturbance */
#order-country {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

#order-country option {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Payment Section */
.payment-section {
    margin-top: 8px;
    padding-top: 24px;
    border-top: 1px solid #E9EAF0;
}

.payment-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #737784;
    margin-bottom: 12px;
}

.payment-methods-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.payment-loading {
    padding: 16px 20px;
    text-align: center;
    color: #737784;
    font-size: 14px;
}

.payment-button {
    width: 100%;
    padding: 16px 20px;
    background-color: #f7f7f9;
    border: 1px solid #E9EAF0;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.payment-button:not(:disabled):hover {
    background-color: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.payment-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f7f7f9;
}

.payment-button.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.payment-provider {
    font-size: 16px;
    font-weight: 600;
    color: #241F26;
}

.payment-button svg {
    color: #737784;
    flex-shrink: 0;
}

.payment-button:not(:disabled):hover svg {
    color: #2563eb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-content-wrapper {
        flex-direction: column;
        max-height: calc(90vh - 80px);
    }
    
    .course-details-panel {
        flex: none;
        border-right: none;
        border-bottom: 1px solid #E9EAF0;
        max-height: 40vh;
    }
    
    .order-summary-panel {
        flex: none;
    }
    
    .modal-header {
        padding: 20px 24px;
    }
    
    .modal-title {
        font-size: 24px;
    }
    
    .course-details-panel,
    .order-summary-panel,
    .checkout-form-panel {
        padding: 24px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .order-summary-modal {
        padding: 10px;
    }
    
    .modal-container {
        border-radius: 12px;
    }
    
    .modal-header {
        padding: 16px 20px;
    }
    
    .modal-title {
        font-size: 20px;
    }
    
    .course-details-panel,
    .order-summary-panel,
    .checkout-form-panel {
        padding: 20px;
    }
    
    .course-image-text {
        font-size: 48px;
    }
    
    .coupon-applied-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .remove-coupon-button {
        width: 100%;
    }
    
    .coupon-carousel-wrapper {
        flex-direction: column;
        gap: 12px;
    }
    
    .coupon-nav-button {
        align-self: center;
    }
    
    .coupon-card {
        padding: 12px;
    }
    
    .checkout-form-title {
        font-size: 18px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Batch Selection Modal Styles */
.batch-selection-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.batch-selection-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
}

.batch-selection-modal .modal-container {
    position: relative;
    background-color: #ffffff;
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1;
    display: flex;
    flex-direction: column;
}

.batch-selection-content {
    padding: 32px;
    max-height: calc(90vh - 100px);
    overflow-y: auto;
}

.batch-selection-title {
    font-size: 18px;
    font-weight: 600;
    color: #241F26;
    margin-bottom: 24px;
}

.batch-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.batch-card {
    background-color: #ffffff;
    border: 1px solid #E9EAF0;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: all 0.2s ease;
}

.batch-card:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}

.batch-card.batch-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.batch-card.batch-disabled:hover {
    transform: none;
    border-color: #E9EAF0;
}

.batch-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.batch-name {
    font-size: 18px;
    font-weight: 600;
    color: #241F26;
    margin: 0;
    flex: 1;
    line-height: 1.3;
}

.batch-vacant-seats {
    text-align: right;
}

.batch-vacant-seats-label {
    font-size: 12px;
    font-weight: 500;
    color: #737784;
    display: block;
    margin-bottom: 4px;
}

.batch-vacant-seats-value {
    font-size: 20px;
    font-weight: 700;
    color: #2563eb;
}

.batch-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.batch-detail-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.batch-detail-label {
    font-weight: 500;
    color: #241F26;
    min-width: 140px;
    flex-shrink: 0;
}

.batch-date-range,
.batch-material-access {
    color: #737784;
    flex: 1;
}

.batch-get-started-btn {
    width: 100%;
    padding: 12px 24px;
    background-color: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    margin-top: auto;
}

.batch-get-started-btn:hover:not(:disabled) {
    background-color: #1d4ed8;
    transform: translateY(-1px);
}

.batch-get-started-btn:active:not(:disabled) {
    transform: translateY(0);
}

.batch-get-started-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Responsive for batch selection */
@media (max-width: 768px) {
    .batch-cards-container {
        grid-template-columns: 1fr;
    }
    
    .batch-selection-content {
        padding: 24px;
    }
    
    .batch-card-header {
        flex-direction: column;
    }
    
    .batch-vacant-seats {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .batch-selection-modal {
        padding: 10px;
    }
    
    .batch-selection-content {
        padding: 20px;
    }
    
    .batch-detail-row {
        flex-direction: column;
        gap: 4px;
    }
    
    .batch-detail-label {
        min-width: auto;
    }
}
