/* Estilos para el frontend del plugin Membership Manager */

/* Contenedor principal de membresía */
.membership-container {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.membership-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e1e1e1;
}

.membership-title {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.membership-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Estados de membresía */
.membership-status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.membership-status-badge.active {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.membership-status-badge.expired {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.membership-status-badge.expiring-soon {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.membership-status-badge.no-membership {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

/* Información de membresía */
.membership-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .membership-info {
        grid-template-columns: 1fr;
    }
}

.membership-detail {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #007cba;
}

.membership-detail-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    display: block;
}

.membership-detail-value {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

/* Contador regresivo */
.membership-countdown {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    color: white;
}

.countdown-item {
    text-align: center;
    min-width: 60px;
}

.countdown-item .number {
    display: block;
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
}

.countdown-item .label {
    display: block;
    font-size: 12px;
    opacity: 0.8;
    text-transform: uppercase;
}

.countdown-item.expired {
    color: #ff6b6b;
    font-weight: bold;
}

/* Advertencias y recordatorios */
.membership-warning {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.membership-warning.expired {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.membership-warning.expiring {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.membership-warning strong {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
}

.membership-warning p {
    margin: 0 0 10px 0;
}

/* Controles de membresía */
.membership-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .membership-controls {
        grid-template-columns: 1fr;
    }
}

.membership-control-group {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e1e1e1;
}

.membership-control-group h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
}

/* Selector de ciclo */
.cycle-selector {
    margin-bottom: 15px;
}

.cycle-selector label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.cycle-selector select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Información de precio */
.price-info {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e1e1e1;
    margin-bottom: 15px;
}

.price-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.price-amount {
    font-size: 20px;
    font-weight: bold;
    color: #007cba;
}

.price-cycle {
    font-size: 14px;
    color: #666;
}

.price-savings {
    font-size: 12px;
    color: #28a745;
    font-weight: 500;
}

/* Botones */
.membership-button {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    box-sizing: border-box;
}

.membership-button.primary {
    background: #007cba;
    color: white;
}

.membership-button.primary:hover {
    background: #005a87;
    color: white;
}

.membership-button.secondary {
    background: #6c757d;
    color: white;
}

.membership-button.secondary:hover {
    background: #545b62;
    color: white;
}

.membership-button.success {
    background: #28a745;
    color: white;
}

.membership-button.success:hover {
    background: #1e7e34;
    color: white;
}

.membership-button.warning {
    background: #ffc107;
    color: #212529;
}

.membership-button.warning:hover {
    background: #e0a800;
    color: #212529;
}

.membership-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

.mm-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.mm-modal-content {
    position: relative;
    background: white;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.mm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e1e1e1;
}

.mm-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.mm-modal-body {
    padding: 20px;
}

.mm-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #e1e1e1;
}

/* Resumen de renovación */
.renewal-summary {
    margin-bottom: 20px;
}

.renewal-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.renewal-item:last-child {
    border-bottom: none;
}

.renewal-item .label {
    font-weight: 500;
    color: #555;
}

.renewal-item .value {
    font-weight: bold;
    color: #333;
}

.renewal-item .value.price {
    color: #007cba;
    font-size: 18px;
}

.renewal-notice {
    background: #e7f3ff;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #007cba;
}

.renewal-notice p {
    margin: 0;
    font-size: 14px;
    color: #555;
}

/* Grid de tipos de membresía */
.membership-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.membership-type-card {
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.membership-type-card:hover {
    border-color: #007cba;
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.1);
}

.membership-type-card h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
}

.membership-prices {
    margin-bottom: 20px;
}

.price-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.price-option:last-child {
    border-bottom: none;
}

.price-option .cycle {
    font-size: 14px;
    color: #666;
}

.price-option .price {
    font-weight: bold;
    color: #007cba;
}

/* Mensajes */
.mm-message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 15px;
    border-left: 4px solid;
}

.mm-message-success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.mm-message-error {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.mm-message-warning {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.mm-message-info {
    background: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

/* Tooltips */
.mm-tooltip {
    position: absolute;
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 10000;
    max-width: 200px;
    text-align: center;
}

.mm-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

/* Estados de carga */
.loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Toggle de información */
.membership-info-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #333;
}

.membership-info-toggle:hover {
    background: #e9ecef;
    color: #333;
}

.toggle-icon {
    transition: transform 0.3s ease;
}

.toggle-icon.rotated {
    transform: rotate(180deg);
}

.membership-details {
    display: none;
    padding: 20px;
    background: white;
    border: 1px solid #e1e1e1;
    border-top: none;
    border-radius: 0 0 6px 6px;
}

/* Responsive */
@media (max-width: 768px) {
    .membership-container {
        padding: 15px;
    }
    
    .membership-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .membership-title {
        font-size: 20px;
    }
    
    .membership-countdown {
        gap: 10px;
        padding: 15px;
    }
    
    .countdown-item .number {
        font-size: 20px;
    }
    
    .mm-modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .mm-modal-footer {
        flex-direction: column;
    }
    
    .membership-types-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .membership-countdown {
        flex-direction: column;
        text-align: center;
    }
    
    .countdown-item {
        min-width: auto;
    }
    
    .price-display {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.membership-container {
    animation: fadeIn 0.5s ease;
}

.mm-message {
    animation: slideIn 0.3s ease;
}

/* Utilidades */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }

.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }

.hidden { display: none !important; }
.visible { display: block !important; }

.flex { display: flex; }
.flex-center { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}

.gap-10 { gap: 10px; }
.gap-15 { gap: 15px; }
.gap-20 { gap: 20px; }