/**
 * WIK Coupon - Public Styles
 */

/* Card */
.wik-coupon-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    overflow: hidden;
    max-width: 400px;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.wik-coupon-header {
    background: linear-gradient(135deg, #2196F3 0%, #1565C0 100%);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wik-type {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Limit Reached State */
.wik-coupon-limited {
    opacity: 0.85;
}

.wik-header-limited {
    background: linear-gradient(135deg, #9e9e9e 0%, #757575 100%) !important;
}

.wik-limit-message {
    text-align: center;
    padding: 15px 10px;
}

.wik-limit-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 10px;
}

.wik-limit-message p {
    color: #666;
    font-size: 15px;
    margin: 0;
    font-weight: 500;
}

.wik-coupon-body {
    padding: 20px;
}

/* Body with preview image */
.wik-body-with-preview {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.wik-preview-container {
    flex-shrink: 0;
    width: 100px;
}

.wik-preview-img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.wik-body-with-preview .wik-content {
    flex: 1;
    min-width: 0;
}

.wik-title {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.wik-desc {
    margin: 0 0 12px;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.wik-expiry {
    margin: 0;
    color: #999;
    font-size: 13px;
}

.wik-coupon-footer {
    padding: 0 20px 20px;
}

.wik-download-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.wik-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76,175,80,0.4);
}

.wik-btn-sm {
    width: auto;
    padding: 8px 16px;
    font-size: 13px;
}

.wik-btn-link {
    background: none;
    color: #2196F3;
    padding: 0;
    text-decoration: underline;
    width: auto;
    font-size: inherit;
}

/* Badge */
.wik-coupon-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.wik-coupon-badge .wik-title {
    font-size: 14px;
    margin: 0;
}

/* Inline */
.wik-coupon-inline {
    display: inline;
}

/* List */
.wik-coupon-list {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

/* Modal */
.wik-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wik-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
}

.wik-modal-box {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: 420px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease;
}

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

.wik-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 1;
}

.wik-modal-header {
    background: linear-gradient(135deg, #2196F3 0%, #1565C0 100%);
    padding: 30px 25px;
    text-align: center;
    color: #fff;
}

.wik-modal-header h3 {
    margin: 0;
    font-size: 22px;
}

.wik-modal-business {
    margin: 8px 0 0;
    opacity: 0.9;
    font-size: 14px;
}

.wik-modal-body {
    padding: 25px;
}

.wik-download-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

.wik-field .req {
    color: #e53935;
}

.wik-field input,
.wik-field select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
}

.wik-field input:focus,
.wik-field select:focus {
    outline: none;
    border-color: #2196F3;
}

.wik-field input.error {
    border-color: #e53935;
}

.wik-submit-btn {
    padding: 14px;
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 5px;
}

.wik-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.wik-form-error {
    background: #ffebee;
    color: #c62828;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
}

/* Success */
.wik-modal-success {
    padding: 40px 25px;
    text-align: center;
}

.wik-success-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 20px;
}

.wik-modal-success h3 {
    margin: 0 0 10px;
    color: #333;
}

.wik-modal-success p {
    color: #666;
    margin: 0 0 15px;
}

.wik-download-link {
    color: #2196F3;
}

/* Loading */
.wik-loading {
    position: relative;
    color: transparent !important;
}

.wik-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 480px) {
    .wik-coupon-card {
        margin: 15px 0;
    }
    .wik-modal-box {
        width: 95%;
    }
}
