/* =====================================================
   VEHIQMAS MEMBERSHIP - FRONTEND STYLES
   ===================================================== */

/* Variables */
:root {
    --vm-primary: #0073aa;
    --vm-primary-hover: #005a87;
    --vm-secondary: #23282d;
    --vm-success: #28a745;
    --vm-warning: #ffc107;
    --vm-danger: #dc3545;
    --vm-light: #f8f9fa;
    --vm-dark: #343a40;
    --vm-gray: #6c757d;
    --vm-border: #dee2e6;
    --vm-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --vm-radius: 8px;
}

/* =====================================================
   MEMBERSHIP PANEL
   ===================================================== */

.vm-membership-panel {
    background: #fff;
    border-radius: var(--vm-radius);
    box-shadow: var(--vm-shadow);
    padding: 25px;
    margin-bottom: 30px;
}

.vm-current-plan {
    border: 2px solid var(--vm-primary);
    border-radius: var(--vm-radius);
    padding: 20px;
    position: relative;
}

.vm-current-plan h4 {
    margin: 0 0 15px;
    font-size: 1.5em;
    color: var(--vm-primary);
}

.vm-plan-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: var(--vm-primary);
    color: #fff;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
}

.vm-plan-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.vm-stat {
    background: var(--vm-light);
    padding: 15px;
    border-radius: 6px;
    text-align: center;
}

.vm-stat .vm-label {
    display: block;
    font-size: 0.85em;
    color: var(--vm-gray);
    margin-bottom: 5px;
}

.vm-stat .vm-value {
    display: block;
    font-size: 1.2em;
    font-weight: 600;
    color: var(--vm-secondary);
}

.vm-stat .vm-value.vm-unlimited {
    color: var(--vm-success);
}

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

.vm-progress-bar .vm-progress {
    background: var(--vm-primary);
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.vm-progress-bar .vm-progress.warning {
    background: var(--vm-warning);
}

.vm-progress-bar .vm-progress.danger {
    background: var(--vm-danger);
}

.vm-upgrade-btn {
    display: inline-block;
    background: var(--vm-primary);
    color: #fff !important;
    padding: 12px 25px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.vm-upgrade-btn:hover {
    background: var(--vm-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 115, 170, 0.3);
}

.vm-membership-features {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--vm-border);
}

.vm-membership-features h5 {
    margin: 0 0 10px;
    font-size: 1em;
    color: var(--vm-gray);
}

.vm-membership-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.vm-membership-features li {
    background: var(--vm-light);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9em;
}

.vm-membership-features li::before {
    content: "✓";
    color: var(--vm-success);
    margin-right: 5px;
}

/* No membership state */
.vm-no-membership {
    text-align: center;
    padding: 40px 20px;
}

.vm-no-membership .vm-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.vm-no-membership p {
    margin: 0 0 20px;
    color: var(--vm-gray);
}

/* Login required */
.vm-login-required {
    background: var(--vm-light);
    padding: 30px;
    border-radius: var(--vm-radius);
    text-align: center;
}

.vm-login-required a {
    color: var(--vm-primary);
    font-weight: 600;
}

/* =====================================================
   PLANS GRID
   ===================================================== */

.vm-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.vm-plan-card {
    background: #fff;
    border-radius: var(--vm-radius);
    box-shadow: var(--vm-shadow);
    padding: 30px;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.vm-plan-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.vm-plan-card.vm-featured {
    border-color: var(--vm-primary);
    transform: scale(1.02);
}

.vm-plan-card.vm-featured:hover {
    transform: scale(1.02) translateY(-5px);
}

.vm-plan-card.vm-current {
    border-color: var(--vm-success);
}

.vm-featured-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--vm-primary);
    color: #fff;
    padding: 5px 20px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
}

.vm-current-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--vm-success);
    color: #fff;
    padding: 5px 20px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
}

.vm-plan-card h3 {
    margin: 0 0 10px;
    font-size: 1.5em;
    color: var(--vm-secondary);
}

.vm-plan-description {
    color: var(--vm-gray);
    margin-bottom: 20px;
    font-size: 0.95em;
}

.vm-plan-price {
    margin: 20px 0;
}

.vm-plan-price .vm-currency {
    font-size: 1.2em;
    vertical-align: top;
}

.vm-plan-price .vm-amount {
    font-size: 3em;
    font-weight: 700;
    color: var(--vm-primary);
    line-height: 1;
}

.vm-plan-price .vm-period {
    color: var(--vm-gray);
    font-size: 0.9em;
}

.vm-plan-price.vm-free .vm-amount {
    color: var(--vm-success);
}

.vm-plan-features {
    list-style: none;
    padding: 0;
    margin: 25px 0;
    text-align: left;
}

.vm-plan-features li {
    padding: 10px 0;
    border-bottom: 1px solid var(--vm-border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.vm-plan-features li:last-child {
    border-bottom: none;
}

.vm-plan-features li::before {
    content: "✓";
    color: var(--vm-success);
    font-weight: bold;
    font-size: 1.1em;
}

.vm-plan-features li.vm-unlimited::before {
    content: "∞";
    color: var(--vm-primary);
}

.vm-select-plan {
    display: block;
    width: 100%;
    padding: 15px 25px;
    background: var(--vm-primary);
    color: #fff !important;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.vm-select-plan:hover {
    background: var(--vm-primary-hover);
}

.vm-select-plan:disabled {
    background: var(--vm-gray);
    cursor: not-allowed;
}

.vm-select-plan.vm-current-plan-btn {
    background: var(--vm-success);
}

.vm-select-plan.vm-current-plan-btn:hover {
    background: #218838;
}

/* Recurring badge */
.vm-recurring-badge {
    display: inline-block;
    background: #e5f3ff;
    color: var(--vm-primary);
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.75em;
    margin-top: 5px;
}

/* =====================================================
   CHECKOUT
   ===================================================== */

.vm-checkout-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    border-radius: var(--vm-radius);
    box-shadow: var(--vm-shadow);
}

.vm-checkout-plan {
    border-bottom: 1px solid var(--vm-border);
    padding-bottom: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.vm-checkout-plan h3 {
    margin: 0 0 10px;
}

.vm-checkout-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2em;
    font-weight: 600;
    padding: 15px 0;
    border-top: 2px solid var(--vm-secondary);
}

/* =====================================================
   ALERTS & MESSAGES
   ===================================================== */

.vm-alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.vm-alert-info {
    background: #e5f3ff;
    color: #004085;
    border: 1px solid #b8daff;
}

.vm-alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.vm-alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.vm-alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* =====================================================
   LOADING & ANIMATIONS
   ===================================================== */

.vm-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.vm-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--vm-light);
    border-top-color: var(--vm-primary);
    border-radius: 50%;
    animation: vmSpin 1s linear infinite;
}

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

.vm-btn-loading {
    position: relative;
    pointer-events: none;
}

.vm-btn-loading::after {
    content: "";
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: vmSpin 0.8s linear infinite;
}

/* =====================================================
   EXPIRY WARNING
   ===================================================== */

.vm-expiry-warning {
    background: linear-gradient(135deg, #fff3cd, #ffeeba);
    border: 1px solid #ffc107;
    border-radius: var(--vm-radius);
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.vm-expiry-warning .vm-icon {
    font-size: 24px;
}

.vm-expiry-warning .vm-message {
    flex: 1;
}

.vm-expiry-warning .vm-message strong {
    display: block;
    margin-bottom: 3px;
}

.vm-expiry-warning .vm-renew-btn {
    background: #856404;
    color: #fff;
    padding: 8px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9em;
}

.vm-expiry-warning .vm-renew-btn:hover {
    background: #6d5204;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 768px) {
    .vm-plans-grid {
        grid-template-columns: 1fr;
    }
    
    .vm-plan-card.vm-featured {
        transform: none;
    }
    
    .vm-plan-card.vm-featured:hover {
        transform: translateY(-5px);
    }
    
    .vm-plan-stats {
        grid-template-columns: 1fr;
    }
    
    .vm-membership-panel {
        padding: 15px;
    }
    
    .vm-plan-card {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .vm-plan-price .vm-amount {
        font-size: 2.5em;
    }
    
    .vm-membership-features ul {
        flex-direction: column;
    }
}

/* =====================================================
   DARK MODE SUPPORT
   ===================================================== */

@media (prefers-color-scheme: dark) {
    .vm-membership-panel,
    .vm-plan-card,
    .vm-checkout-container {
        background: #1e1e1e;
        color: #e0e0e0;
    }
    
    .vm-plan-card h3,
    .vm-current-plan h4 {
        color: #fff;
    }
    
    .vm-stat {
        background: #2d2d2d;
    }
    
    .vm-stat .vm-value {
        color: #fff;
    }
    
    .vm-plan-features li {
        border-color: #444;
    }
    
    .vm-border,
    .vm-plan-card {
        border-color: #444;
    }
}

/* =====================================================
   LIMIT REACHED MESSAGE
   ===================================================== */

.vehiqmas-limit-reached {
    background: linear-gradient(135deg, #fff3cd, #ffeeba) !important;
    border: 2px solid #ffc107 !important;
    border-radius: 12px !important;
    padding: 30px !important;
    margin: 30px auto !important;
    max-width: 600px !important;
    text-align: center !important;
    box-shadow: 0 4px 20px rgba(255, 193, 7, 0.2) !important;
}

.vehiqmas-limit-reached h3 {
    color: #856404 !important;
    margin: 0 0 15px 0 !important;
    font-size: 1.6em !important;
    font-weight: 600 !important;
}

.vehiqmas-limit-reached p {
    color: #856404 !important;
    font-size: 1.1em !important;
    line-height: 1.6 !important;
    margin: 0 0 20px 0 !important;
}

.vehiqmas-limit-reached a {
    color: #533f03 !important;
    text-decoration: underline !important;
    font-weight: 600 !important;
}

.vehiqmas-limit-reached a.button,
.vehiqmas-limit-reached a[style*="background"] {
    background: #856404 !important;
    color: #fff !important;
    padding: 12px 30px !important;
    text-decoration: none !important;
    border-radius: 6px !important;
    display: inline-block !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.vehiqmas-limit-reached a.button:hover,
.vehiqmas-limit-reached a[style*="background"]:hover {
    background: #6d5204 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 15px rgba(133, 100, 4, 0.3) !important;
}

/* Ensure the message doesn't break layout */
.vehiqmas-limit-reached * {
    box-sizing: border-box !important;
}

/* =====================================================
   PRINT STYLES
   ===================================================== */

@media print {
    .vm-select-plan,
    .vm-upgrade-btn {
        display: none;
    }
    
    .vm-plan-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* =====================================================
   PLAN GRATUITO - LIMITE ALCANZADO
   ===================================================== */

.vm-plan-card.vm-disabled {
    opacity: 0.7;
    position: relative;
}

.vm-plan-card.vm-disabled::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.3);
    pointer-events: none;
    border-radius: inherit;
}

.vm-limit-reached-btn {
    background: #6c757d !important;
    color: #fff !important;
    cursor: not-allowed !important;
}

.vm-free-limit-notice {
    font-size: 12px;
    color: #856404;
    background: #fff3cd;
    padding: 8px 12px;
    border-radius: 4px;
    margin-top: 10px;
    text-align: center;
}
