/* Frontend Styles */
.cmm-membership-plans {
    display: grid;
    gap: 30px;
    margin: 40px 0;
}

.cmm-columns-2 { grid-template-columns: repeat(2, 1fr); }
.cmm-columns-3 { grid-template-columns: repeat(3, 1fr); }
.cmm-columns-4 { grid-template-columns: repeat(4, 1fr); }

.cmm-plan-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.cmm-plan-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.cmm-plan-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 20px;
    text-align: center;
}

.cmm-plan-header h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 600;
}

.cmm-plan-price {
    font-size: 32px;
    font-weight: bold;
}

.cmm-plan-features {
    padding: 30px 20px;
}

.cmm-plan-features ul {
    list-style: none;
    padding: 0;
    margin: 20px 0 0 0;
}

.cmm-plan-features li {
    padding: 8px 0;
    display: flex;
    align-items: center;
}

.cmm-plan-features .dashicons {
    color: #667eea;
    margin-right: 10px;
}

.cmm-plan-footer {
    padding: 20px;
    background: #f8f9fa;
    text-align: center;
}

.cmm-membership-status {
    max-width: 800px;
    margin: 0 auto;
}

.cmm-status-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 30px;
}

.cmm-status-active {
    border-left: 4px solid #28a745;
}

.cmm-status-expired {
    border-left: 4px solid #dc3545;
}

.cmm-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.cmm-status-header h3 {
    margin: 0;
    color: #333;
}

.cmm-status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

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

.cmm-status-badge.cmm-expired {
    background: #f8d7da;
    color: #721c24;
}

.cmm-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.cmm-status-item {
    display: flex;
    flex-direction: column;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.cmm-status-item label {
    font-weight: 600;
    color: #666;
    margin-bottom: 5px;
    font-size: 14px;
}

.cmm-status-item span {
    font-size: 16px;
    color: #333;
}

.cmm-plan-name {
    font-weight: bold;
    color: #667eea;
}

.cmm-downloads-remaining {
    font-weight: bold;
    color: #28a745;
}

.cmm-unlimited {
    color: #17a2b8;
    font-weight: bold;
}

.cmm-progress-section {
    margin: 25px 0;
}

.cmm-progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 600;
}

.cmm-progress-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

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

.cmm-benefits {
    background: #e7f3ff;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.cmm-benefits h4 {
    margin: 0 0 10px 0;
    color: #004085;
}

.cmm-benefits ul {
    margin: 0;
    padding-left: 20px;
}

.cmm-benefits li {
    margin-bottom: 5px;
}

.cmm-status-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.cmm-no-membership {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.cmm-benefits-list {
    text-align: left;
    max-width: 400px;
    margin: 0 auto 20px;
}

.cmm-download-history {
    margin: 40px 0;
}

.cmm-downloads-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.cmm-downloads-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.cmm-access-denied,
.cmm-login-required {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

.cmm-access-denied h3,
.cmm-login-required h3 {
    color: #dc3545;
    margin-bottom: 15px;
}

/* NEW: Enhanced price override styles */
body.cmm-member-active .cmm-free-price {
    color: #28a745 !important;
    font-weight: bold !important;
    background: #d4edda !important;
    padding: 5px 10px !important;
    border-radius: 4px !important;
    border: 1px solid #c3e6cb !important;
    display: inline-block !important;
}

/* Force FREE display for common price patterns */
body.cmm-member-active [class*="price"] .cmm-free-price,
body.cmm-member-active .amount .cmm-free-price {
    background: #28a745 !important;
    color: white !important;
    font-size: 1.1em !important;
    padding: 8px 15px !important;
}

/* Multi-layer price override for active members */
body.cmm-member-active .price,
body.cmm-member-active .woocommerce-Price-amount,
body.cmm-member-active .product-price,
body.cmm-member-active [class*="price"],
body.cmm-member-active .amount,
body.cmm-member-active .original-price,
body.cmm-member-active .sale-price,
body.cmm-member-active .current-price,
body.cmm-member-active .regular-price,
body.cmm-member-active ins .amount,
body.cmm-member-active del .amount {
    visibility: hidden !important;
    position: relative !important;
}

body.cmm-member-active .price:after,
body.cmm-member-active .woocommerce-Price-amount:after,
body.cmm-member-active .product-price:after,
body.cmm-member-active [class*="price"]:after,
body.cmm-member-active .amount:after,
body.cmm-member-active .original-price:after,
body.cmm-member-active .sale-price:after,
body.cmm-member-active .current-price:after,
body.cmm-member-active .regular-price:after {
    content: "FREE" !important;
    visibility: visible !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    color: #28a745 !important;
    font-weight: bold !important;
    background: white !important;
    padding: 2px 8px !important;
    border-radius: 3px !important;
    border: 1px solid #28a745 !important;
}

/* Loading States */
.cmm-loading {
    opacity: 0.6;
    pointer-events: none;
}

.cmm-spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .cmm-membership-plans {
        grid-template-columns: 1fr;
    }
    
    .cmm-status-grid {
        grid-template-columns: 1fr;
    }
    
    .cmm-status-actions {
        flex-direction: column;
    }
    
    .cmm-status-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .cmm-downloads-table {
        font-size: 14px;
    }
    
    .cmm-downloads-table th,
    .cmm-downloads-table td {
        padding: 8px 10px;
    }
}

/* Button Styles */
.cmm-primary-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: all 0.3s ease;
    cursor: pointer;
}

.cmm-primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    color: white;
}

.cmm-secondary-button {
    background: #6c757d;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: all 0.3s ease;
}

.cmm-secondary-button:hover {
    background: #5a6268;
    color: white;
    transform: translateY(-2px);
}

/* Animation for status updates */
@keyframes cmm-fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cmm-animate-in {
    animation: cmm-fade-in-up 0.5s ease-out;
}

/* Progress bar animations */
.cmm-progress-fill {
    transition: width 1s ease-in-out;
}

/* Membership card hover effects */
.cmm-plan-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cmm-plan-card:hover .cmm-plan-header {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Download button styles */
.cmm-download-btn {
    background: #28a745;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.cmm-download-btn:hover {
    background: #218838;
    color: white;
    transform: translateY(-1px);
}

.cmm-download-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}