/* TS Loyalty Frontend Styles */

.ts-loyalty-account {
    max-width: 700px;
}

.ts-loyalty-account h2 {
    margin-bottom: 30px;
    color: #1e3a5f;
}

.ts-loyalty-account h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #1e3a5f;
    font-size: 18px;
}

/* Points Box */
.ts-loyalty-points-box {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    margin-bottom: 25px;
    color: #fff;
}

.points-circle {
    display: inline-block;
    margin-bottom: 15px;
}

.points-number {
    display: block;
    font-size: 56px;
    font-weight: bold;
    line-height: 1;
}

.points-label {
    display: block;
    font-size: 16px;
    opacity: 0.8;
    margin-top: 5px;
}

.earning-info {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

.earning-info strong {
    color: #fff;
}

/* Available Discount */
.ts-loyalty-available {
    background: #fff;
    border: 2px solid #28a745;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.available-badge {
    display: flex;
    align-items: center;
    gap: 15px;
}

.badge-icon {
    font-size: 40px;
}

.badge-title {
    display: block;
    font-weight: 600;
    color: #28a745;
    font-size: 16px;
}

.badge-value {
    display: block;
    color: #333;
    font-size: 14px;
}

.ts-loyalty-generate-btn {
    background: #28a745;
    color: #fff;
    border: none;
    padding: 14px 28px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.ts-loyalty-generate-btn:hover {
    background: #218838;
}

/* Next Level */
.ts-loyalty-next-level {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
}

.next-level-info p {
    margin: 0 0 15px 0;
    color: #555;
}

.progress-bar {
    background: #e0e0e0;
    border-radius: 10px;
    height: 12px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, #2563eb, #1e3a5f);
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    margin-top: 10px !important;
    font-size: 13px;
    color: #888;
}

/* Levels Grid */
.ts-loyalty-levels {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
}

.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
}

.level-card {
    background: #f8f9fa;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.2s ease;
}

.level-card.reached {
    background: #e8f5e9;
    border-color: #81c784;
}

.level-card.available {
    background: #fff8e1;
    border-color: #f59e0b;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.level-discount {
    font-size: 28px;
    font-weight: bold;
    color: #1e3a5f;
}

.level-points {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
}

.level-status {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 10px;
    padding: 3px 8px;
    border-radius: 3px;
    display: inline-block;
}

.level-status.reached {
    background: #c8e6c9;
    color: #2e7d32;
}

.level-status.available {
    background: #fff3cd;
    color: #856404;
}

/* Modal */
.ts-loyalty-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ts-loyalty-modal-content {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    position: relative;
}

.ts-loyalty-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.ts-loyalty-modal-close:hover {
    color: #333;
}

.modal-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.ts-loyalty-modal-content h3 {
    margin-bottom: 25px;
}

.coupon-code {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    color: #fff;
    padding: 20px;
    border-radius: 8px;
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 3px;
    margin-bottom: 20px;
}

.coupon-info {
    color: #555;
    font-size: 14px;
}

.copy-coupon-btn {
    background: #f8f9fa;
    border: 1px solid #ddd;
    padding: 10px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 15px;
    transition: background 0.2s ease;
}

.copy-coupon-btn:hover {
    background: #e9ecef;
}

.coupon-note {
    color: #999;
    font-size: 12px;
    margin-top: 20px;
    margin-bottom: 0;
}

/* History */
.ts-loyalty-history {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
}

.ts-loyalty-history-table {
    width: 100%;
    border-collapse: collapse;
}

.ts-loyalty-history-table th,
.ts-loyalty-history-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.ts-loyalty-history-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    font-size: 13px;
}

.ts-loyalty-history-table td {
    font-size: 14px;
}

.ts-loyalty-history-table .positive {
    color: #28a745;
    font-weight: 600;
}

.ts-loyalty-history-table .negative {
    color: #dc3545;
    font-weight: 600;
}

/* Message */
.ts-loyalty-message {
    padding: 15px;
    border-radius: 6px;
    margin-top: 20px;
}

.ts-loyalty-message.success {
    background: #d4edda;
    color: #155724;
}

.ts-loyalty-message.error {
    background: #f8d7da;
    color: #721c24;
}

/* Responsive */
@media (max-width: 600px) {
    .ts-loyalty-available {
        flex-direction: column;
        text-align: center;
    }
    
    .available-badge {
        flex-direction: column;
    }
    
    .levels-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .points-number {
        font-size: 42px;
    }
}
