/* ==========================================================================
   GiftCard By Webify - Frontend Styles (CSS Variables driven)
   ========================================================================== */

/* Product Page - Gift Card Form */
.wgc-product-form {
    margin: 20px 0;
    padding: 20px;
    background: var(--wgc-bg, #f9fafb);
    border-radius: var(--wgc-border-radius, 12px);
    border: 1px solid var(--wgc-border, #e5e7eb);
}

.wgc-field-group {
    margin-bottom: 20px;
}

.wgc-label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 16px;
    color: var(--wgc-text, #333);
}

/* Recipient Type Radio Buttons */
.wgc-recipient-type-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.wgc-radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 12px 20px;
    border: 2px solid var(--wgc-border, #e5e7eb);
    border-radius: var(--wgc-button-radius, 8px);
    transition: all 0.2s ease;
    flex: 1;
    min-width: 150px;
}

.wgc-radio-label:hover {
    border-color: var(--wgc-primary, #6366f1);
    background: color-mix(in srgb, var(--wgc-primary, #6366f1) 8%, white);
}

.wgc-radio-label input[type="radio"] {
    margin-left: 8px;
}

.wgc-radio-label input[type="radio"]:checked + .wgc-radio-text {
    color: var(--wgc-primary, #6366f1);
    font-weight: 600;
}

.wgc-radio-label:has(input:checked) {
    border-color: var(--wgc-primary, #6366f1);
    background: color-mix(in srgb, var(--wgc-primary, #6366f1) 12%, white);
}

.wgc-radio-text {
    font-size: 15px;
}

/* Amount Selection - Flexible */
.wgc-amount-flexible {
    position: relative;
}

.wgc-amount-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--wgc-border, #e5e7eb);
    border-radius: var(--wgc-button-radius, 8px);
    font-size: 18px;
    text-align: center;
    direction: ltr;
    transition: border-color 0.2s;
}

.wgc-amount-input:focus {
    border-color: var(--wgc-primary, #6366f1);
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--wgc-primary, #6366f1) 15%, transparent);
}

.wgc-amount-range {
    display: block;
    text-align: center;
    font-size: 13px;
    color: var(--wgc-text-secondary, #888);
    margin-top: 6px;
}

/* Amount Selection - Steps */
.wgc-amount-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.wgc-step-label {
    cursor: pointer;
}

.wgc-step-label input[type="radio"] {
    display: none;
}

.wgc-step-button {
    display: inline-block;
    padding: 12px 24px;
    border: 2px solid var(--wgc-border, #e5e7eb);
    border-radius: var(--wgc-button-radius, 8px);
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s ease;
    text-align: center;
    min-width: 80px;
}

.wgc-step-button:hover {
    border-color: var(--wgc-primary, #6366f1);
    background: color-mix(in srgb, var(--wgc-primary, #6366f1) 8%, white);
}

.wgc-step-label input[type="radio"]:checked + .wgc-step-button {
    background: var(--wgc-primary, #6366f1);
    color: #fff;
    border-color: var(--wgc-primary, #6366f1);
}

/* Recipient Details */
.wgc-recipient-details {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--wgc-border, #e5e7eb);
}

.wgc-section-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 16px;
    color: var(--wgc-text, #333);
}

.wgc-fields-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.wgc-field {
    flex: 1;
}

.wgc-field-full {
    width: 100%;
    margin-bottom: 16px;
}

.wgc-field label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--wgc-text-secondary, #555);
}

.wgc-field label .required {
    color: #ef4444;
}

.wgc-field input,
.wgc-field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--wgc-border, #d1d5db);
    border-radius: calc(var(--wgc-button-radius, 8px) - 2px);
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.wgc-field input:focus,
.wgc-field textarea:focus {
    border-color: var(--wgc-primary, #6366f1);
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--wgc-primary, #6366f1) 15%, transparent);
}

.wgc-field textarea {
    resize: vertical;
}

.wgc-field input.wgc-error {
    border-color: #ef4444;
}

/* Checkout - Gift Card Section */
.wgc-checkout-section {
    margin: 20px 0;
    padding: 20px;
    background: var(--wgc-bg, #f9fafb);
    border-radius: var(--wgc-border-radius, 10px);
    border: 1px solid var(--wgc-border, #e5e7eb);
}

.wgc-checkout-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 15px;
    color: var(--wgc-text, #333);
}

.wgc-apply-description {
    font-size: 14px;
    color: var(--wgc-text-secondary, #666);
    margin: 0 0 12px;
}

.wgc-apply-row {
    display: flex;
    gap: 10px;
}

.wgc-code-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--wgc-border, #d1d5db);
    border-radius: calc(var(--wgc-button-radius, 8px) - 2px);
    font-size: 16px;
    font-family: monospace;
    letter-spacing: 1px;
    text-align: center;
}

.wgc-code-input:focus {
    border-color: var(--wgc-primary, #6366f1);
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--wgc-primary, #6366f1) 15%, transparent);
}

.wgc-apply-btn,
.wgc-check-btn {
    padding: 10px 24px;
    background: var(--wgc-primary, #6366f1) !important;
    color: #fff !important;
    border: none !important;
    border-radius: var(--wgc-button-radius, 6px);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.wgc-apply-btn:hover,
.wgc-check-btn:hover {
    background: var(--wgc-primary-hover, #4f46e5) !important;
}

.wgc-apply-message {
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: calc(var(--wgc-button-radius, 8px) - 2px);
    font-size: 14px;
}

.wgc-apply-message.success {
    background: color-mix(in srgb, var(--wgc-success, #22c55e) 10%, white);
    color: #166534;
    border: 1px solid color-mix(in srgb, var(--wgc-success, #22c55e) 30%, white);
}

.wgc-apply-message.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Applied Card */
.wgc-applied-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: color-mix(in srgb, var(--wgc-success, #22c55e) 10%, white);
    border: 1px solid color-mix(in srgb, var(--wgc-success, #22c55e) 30%, white);
    border-radius: var(--wgc-button-radius, 8px);
    flex-wrap: wrap;
    gap: 10px;
}

.wgc-applied-card p {
    margin: 0;
    font-size: 14px;
    color: #166534;
}

.wgc-remove-card {
    color: #ef4444 !important;
    border-color: #ef4444 !important;
    font-size: 13px !important;
}

/* Balance Page */
.wgc-balance-page {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px 0;
}

.wgc-balance-check-form {
    text-align: center;
    margin-bottom: 30px;
}

.wgc-balance-check-form h2 {
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--wgc-text, #333);
}

.wgc-balance-desc {
    color: var(--wgc-text-secondary, #666);
    margin-bottom: 20px;
}

.wgc-balance-input-row {
    display: flex;
    gap: 10px;
    max-width: 450px;
    margin: 0 auto;
}

.wgc-balance-error {
    margin-top: 12px;
    padding: 10px 14px;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: calc(var(--wgc-button-radius, 8px) - 2px);
    font-size: 14px;
}

/* Balance Result */
.wgc-balance-card {
    background: linear-gradient(135deg, var(--wgc-primary, #6366f1), var(--wgc-secondary, #8b5cf6));
    border-radius: var(--wgc-border-radius, 16px);
    padding: 30px;
    color: #fff;
    margin-bottom: 24px;
}

.wgc-balance-header {
    text-align: center;
    margin-bottom: 20px;
}

.wgc-balance-label {
    display: block;
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 8px;
}

.wgc-balance-amount {
    font-size: 42px;
    font-weight: 700;
    letter-spacing: 1px;
}

.wgc-balance-details {
    background: rgba(255, 255, 255, 0.15);
    border-radius: calc(var(--wgc-border-radius, 12px) - 2px);
    padding: 16px;
}

.wgc-balance-detail {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.wgc-balance-detail:last-child {
    border-bottom: none;
}

.wgc-detail-label {
    opacity: 0.8;
}

.wgc-detail-value {
    font-weight: 600;
}

/* Transactions Table */
.wgc-transactions-section {
    margin-top: 24px;
}

.wgc-transactions-section h3 {
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--wgc-text, #333);
}

.wgc-transactions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.wgc-transactions-table th {
    background: var(--wgc-bg, #f3f4f6);
    padding: 10px 14px;
    text-align: right;
    font-weight: 600;
    color: var(--wgc-text-secondary, #555);
    border-bottom: 2px solid var(--wgc-border, #e5e7eb);
}

.wgc-transactions-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--wgc-bg, #f3f4f6);
}

.wgc-transactions-table tr:hover td {
    background: var(--wgc-bg, #f9fafb);
}

.wgc-tx-credit {
    color: var(--wgc-success, #16a34a);
    font-weight: 600;
}

.wgc-tx-debit {
    color: #dc2626;
    font-weight: 600;
}

/* Thank You Page */
.wgc-thankyou-section {
    margin: 20px 0 30px;
    padding: 24px;
    background: color-mix(in srgb, var(--wgc-success, #22c55e) 10%, white);
    border: 2px solid color-mix(in srgb, var(--wgc-success, #22c55e) 30%, white);
    border-radius: var(--wgc-border-radius, 12px);
    text-align: center;
}

.wgc-thankyou-section h2 {
    margin: 0 0 16px;
    font-size: 22px;
    color: var(--wgc-text, #333);
}

.wgc-thankyou-card {
    max-width: 400px;
    margin: 0 auto;
}

.wgc-thankyou-code {
    font-size: 16px;
    margin-bottom: 8px;
}

.wgc-thankyou-code strong {
    font-size: 22px;
    font-family: monospace;
    letter-spacing: 2px;
    color: var(--wgc-text, #333);
}

.wgc-email-notice {
    font-size: 13px;
    color: var(--wgc-text-secondary, #666);
    margin-top: 12px;
}

.wgc-share-buttons {
    margin-top: 16px;
}

.wgc-whatsapp-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #25D366;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: var(--wgc-button-radius, 8px);
    font-size: 16px;
    font-weight: 600;
    transition: background 0.2s;
}

.wgc-whatsapp-btn:hover {
    background: #1ea952;
    color: #fff !important;
}

.wgc-whatsapp-btn svg {
    flex-shrink: 0;
}

/* Disabled Notice */
.wgc-disabled-notice {
    padding: 14px;
    background: #fef3cd;
    border: 1px solid #ffc107;
    border-radius: calc(var(--wgc-button-radius, 8px) - 2px);
    color: #856404;
}

/* Responsive */
@media (max-width: 600px) {
    .wgc-fields-row {
        flex-direction: column;
        gap: 12px;
    }

    .wgc-recipient-type-options {
        flex-direction: column;
    }

    .wgc-apply-row,
    .wgc-balance-input-row {
        flex-direction: column;
    }

    .wgc-balance-amount {
        font-size: 32px;
    }

    .wgc-applied-card {
        flex-direction: column;
        text-align: center;
    }

    .wgc-transactions-table {
        font-size: 12px;
    }

    .wgc-transactions-table th,
    .wgc-transactions-table td {
        padding: 8px 6px;
    }
}
