/* CDD Gift Course Styles v2.0 */

:root {
    --cdd-brand: #D8714E;
    --cdd-brand-dark: #c5613f;
    --cdd-success: #4CAF50;
    --cdd-error: #f44336;
    --cdd-gray: #666;
    --cdd-light: #f5f5f5;
}

/* Gift Form Wrapper */
.cdd-gift-wrapper,
.cdd-redeem-wrapper {
    max-width: 600px;
    margin: 0 auto;
    padding: 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* Header */
.cdd-gift-header,
.cdd-redeem-header {
    text-align: center;
    margin-bottom: 30px;
}

.cdd-gift-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
}

.cdd-gift-header h2,
.cdd-redeem-header h2 {
    color: #333;
    margin: 0 0 10px;
    font-size: 28px;
}

.cdd-gift-subtitle,
.cdd-redeem-header p {
    color: var(--cdd-gray);
    margin: 0;
}

/* Product Info */
.cdd-gift-product-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--cdd-light);
    border-radius: 8px;
    margin-bottom: 25px;
}

.cdd-gift-course-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.cdd-gift-price {
    font-size: 24px;
    font-weight: bold;
    color: var(--cdd-brand);
}

/* Sections */
.cdd-gift-section {
    margin-bottom: 25px;
}

.cdd-gift-section h3 {
    font-size: 16px;
    color: var(--cdd-brand);
    margin: 0 0 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--cdd-light);
}

/* Form Fields */
.cdd-gift-field {
    margin-bottom: 20px;
}

.cdd-gift-field label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
}

.cdd-gift-field input,
.cdd-gift-field textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.cdd-gift-field input:focus,
.cdd-gift-field textarea:focus {
    outline: none;
    border-color: var(--cdd-brand);
    box-shadow: 0 0 0 3px rgba(216, 113, 78, 0.1);
}

.cdd-gift-field.is-focused label {
    color: var(--cdd-brand);
}

.cdd-gift-field textarea {
    resize: vertical;
    min-height: 80px;
}

/* Preview Card */
.cdd-gift-preview {
    margin: 25px 0;
}

.cdd-gift-preview h4 {
    font-size: 14px;
    color: var(--cdd-gray);
    margin: 0 0 15px;
    text-align: center;
}

.cdd-preview-card {
    border: 2px dashed #ddd;
    border-radius: 12px;
    overflow: hidden;
    background: white;
}

.cdd-preview-header {
    background: var(--cdd-brand);
    color: white;
    padding: 15px;
    text-align: center;
    font-size: 12px;
    letter-spacing: 2px;
}

.cdd-preview-logo {
    height: 30px;
    margin-bottom: 5px;
    filter: brightness(0) invert(1);
}

.cdd-preview-body {
    padding: 20px;
    text-align: center;
}

.cdd-preview-course {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
}

.cdd-preview-recipient,
.cdd-preview-sender {
    font-size: 14px;
    color: var(--cdd-gray);
    margin: 5px 0;
}

.cdd-preview-recipient span,
.cdd-preview-sender span {
    color: var(--cdd-brand);
    font-weight: 500;
}

.cdd-preview-message {
    font-size: 13px;
    color: #888;
    margin-top: 15px;
    padding: 10px;
    background: var(--cdd-light);
    border-radius: 6px;
    min-height: 20px;
}

/* Submit Button */
.cdd-gift-submit {
    width: 100%;
    padding: 16px 30px;
    background: var(--cdd-brand);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.cdd-gift-submit:hover {
    background: var(--cdd-brand-dark);
    transform: translateY(-2px);
}

.cdd-gift-submit:active {
    transform: translateY(0);
}

.cdd-gift-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Loading State */
.cdd-gift-loading,
.cdd-redeem-loading {
    text-align: center;
    padding: 40px;
}

.cdd-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--cdd-light);
    border-top-color: var(--cdd-brand);
    border-radius: 50%;
    animation: cdd-spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes cdd-spin {
    to { transform: rotate(360deg); }
}

/* Redeem Form Specific */
.cdd-redeem-wrapper {
    max-width: 500px;
}

#redeem_code {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 2px;
}

/* Success & Error States */
.cdd-redeem-success,
.cdd-redeem-error {
    text-align: center;
    padding: 30px;
}

.cdd-success-icon {
    width: 60px;
    height: 60px;
    background: var(--cdd-success);
    color: white;
    font-size: 32px;
    line-height: 60px;
    border-radius: 50%;
    margin: 0 auto 20px;
}

.cdd-error-icon {
    width: 60px;
    height: 60px;
    background: var(--cdd-error);
    color: white;
    font-size: 32px;
    line-height: 60px;
    border-radius: 50%;
    margin: 0 auto 20px;
}

.cdd-redeem-success h3 {
    color: var(--cdd-success);
    margin: 0 0 10px;
}

.cdd-redeem-error h3 {
    color: var(--cdd-error);
    margin: 0 0 10px;
}

.cdd-btn-retry {
    padding: 12px 30px;
    background: var(--cdd-gray);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 15px;
}

.cdd-btn-retry:hover {
    background: #555;
}

/* Error message */
.cdd-error {
    background: #ffebee;
    color: var(--cdd-error);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

/* Responsive */
@media (max-width: 600px) {
    .cdd-gift-wrapper,
    .cdd-redeem-wrapper {
        padding: 20px;
        margin: 10px;
        border-radius: 8px;
    }
    
    .cdd-gift-header h2,
    .cdd-redeem-header h2 {
        font-size: 22px;
    }
    
    .cdd-gift-product-info {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .cdd-gift-submit {
        padding: 14px 20px;
        font-size: 15px;
    }
}
