/**
 * Kitboxclub Points Manager - Frontend Styles
 */

/* Points Summary Widget */
.kpm-points-summary-widget {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.kpm-points-summary-widget h3 {
    margin: 0 0 20px;
    color: #fff;
    font-size: 18px;
}

.kpm-points-grid {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.kpm-point-box {
    background: rgba(255,255,255,0.2);
    padding: 15px 20px;
    border-radius: 8px;
    text-align: center;
    min-width: 120px;
}

.kpm-point-value {
    display: block;
    font-size: 28px;
    font-weight: bold;
    line-height: 1.2;
}

.kpm-point-label {
    display: block;
    font-size: 12px;
    opacity: 0.9;
    margin-top: 5px;
}

.kpm-next-release {
    background: rgba(255,255,255,0.15);
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}

.kpm-next-release .dashicons {
    margin-right: 8px;
}

.kpm-view-details {
    background: #fff !important;
    color: #667eea !important;
    border: none !important;
    padding: 10px 20px !important;
}

/* My Points Page */
.kpm-my-points-page {
    max-width: 900px;
}

.kpm-my-points-page h2 {
    margin-bottom: 25px;
}

/* Summary Cards */
.kpm-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.kpm-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: box-shadow 0.2s;
}

.kpm-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.kpm-card-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
}

.kpm-card-icon {
    font-size: 32px;
}

.kpm-card-value {
    display: block;
    font-size: 24px;
    font-weight: bold;
}

.kpm-card-label {
    display: block;
    font-size: 13px;
    opacity: 0.8;
}

/* Next Release Box */
.kpm-next-release-box {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
}

.kpm-next-release-box h3 {
    margin: 0 0 15px;
    color: #856404;
}

.kpm-release-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.kpm-release-date {
    background: #ffc107;
    color: #856404;
    padding: 10px 15px;
    border-radius: 8px;
    text-align: center;
    min-width: 60px;
}

.kpm-release-day {
    display: block;
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
}

.kpm-release-month {
    display: block;
    font-size: 14px;
    text-transform: uppercase;
}

.kpm-release-details strong {
    display: block;
    font-size: 16px;
    color: #333;
}

.kpm-release-details span {
    display: block;
    color: #666;
}

.kpm-release-details small {
    display: block;
    color: #999;
    margin-top: 5px;
}

/* Sections */
.kpm-section {
    margin-bottom: 30px;
}

.kpm-section h3 {
    margin-bottom: 15px;
    font-size: 18px;
}

.kpm-section-desc {
    color: #666;
    margin-bottom: 15px;
    font-style: italic;
}

/* Subscription Card */
.kpm-subscription-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
}

.kpm-sub-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.kpm-sub-header h4 {
    margin: 0;
    font-size: 16px;
}

.kpm-sub-status {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.kpm-status-active {
    background: #d4edda;
    color: #155724;
}

.kpm-status-paused {
    background: #fff3cd;
    color: #856404;
}

.kpm-status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

/* Progress Bar */
.kpm-sub-progress {
    margin-bottom: 20px;
}

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

.kpm-progress-fill {
    background: linear-gradient(90deg, #667eea, #764ba2);
    height: 100%;
    transition: width 0.3s ease;
}

.kpm-progress-text {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: #666;
}

/* Subscription Details */
.kpm-sub-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.kpm-detail-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 3px;
}

.kpm-detail-value {
    display: block;
    font-weight: bold;
    font-size: 14px;
}

.kpm-highlight {
    color: #28a745;
}

/* Tables */
.kpm-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.kpm-table th,
.kpm-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.kpm-table th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 13px;
}

.kpm-table tr:last-child td {
    border-bottom: none;
}

.kpm-table tr:hover {
    background: #f8f9fa;
}

/* Badges */
.kpm-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.kpm-badge-earned,
.kpm-badge-released,
.kpm-badge-manual_release,
.kpm-badge-extra {
    background: #d4edda;
    color: #155724;
}

.kpm-badge-used {
    background: #cce5ff;
    color: #004085;
}

.kpm-badge-expired,
.kpm-badge-reverted {
    background: #f8d7da;
    color: #721c24;
}

/* Credit/Debit */
.kpm-credit {
    color: #28a745;
    font-weight: bold;
}

.kpm-debit {
    color: #dc3545;
    font-weight: bold;
}

/* Info Box */
.kpm-info-box {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    border-left: 4px solid #667eea;
    border-radius: 0 8px 8px 0;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.kpm-info-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.kpm-info-icon {
    font-size: 24px;
}

.kpm-info-title {
    font-weight: bold;
    font-size: 16px;
    color: #333;
}

.kpm-info-content p {
    margin: 0 0 10px;
}

.kpm-info-details {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.kpm-info-detail {
    background: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
}

.kpm-next-release-msg {
    background: #fff3cd;
    padding: 8px 12px;
    border-radius: 5px;
    margin: 10px 0 0 !important;
    font-size: 13px;
}

/* Redeem Info */
.kpm-redeem-info {
    background: #e8f4fd;
    border-left: 4px solid #0073aa;
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 0 4px 4px 0;
}

.kpm-redeem-info p {
    margin: 0;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .kpm-summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .kpm-release-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .kpm-sub-details {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .kpm-info-details {
        flex-direction: column;
        gap: 8px;
    }
}

@media screen and (max-width: 480px) {
    .kpm-summary-cards {
        grid-template-columns: 1fr;
    }
    
    .kpm-points-grid {
        flex-direction: column;
    }
    
    .kpm-point-box {
        min-width: 100%;
    }
    
    .kpm-table {
        font-size: 13px;
    }
    
    .kpm-table th,
    .kpm-table td {
        padding: 8px 10px;
    }
}


/* ========================================
   SUMO Message Override Styles
   ======================================== */

/* When user has KPM subscription, adjust SUMO messages */
.kpm-has-subscription .sumo_available_points {
    position: relative;
}

/* Warning state when cycle limit is near/exhausted */
.kpm-cycle-warning .sumo_available_points.rs_checkout_messages {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%) !important;
    border-left: 4px solid #ffc107 !important;
}

/* Blocked state when no points available this cycle */
.kpm-cycle-blocked .sumo_available_points.rs_checkout_messages {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%) !important;
    border-left: 4px solid #dc3545 !important;
    color: #721c24 !important;
}

/* Hide SUMO default message when KPM provides better info */
.kpm-override-sumo .sumo_available_points.rs_checkout_messages {
    display: none !important;
}
