/**
 * HiveSubscriptions - Frontend CSS
 * Adapté au thème Nectar + WooCommerce
 *
 * @package HiveSubscriptions
 */

/* ==========================================================================
   Plan Selector - Page Produit
   ========================================================================== */

.hivesubscriptions-plan-selector {
    max-width: 1000px;
    margin: 30px auto;
}

.hive-plans-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.hive-plan-card {
    position: relative;
    background: var(--hp-white, #fff);
    border: 2px solid var(--hp-light-grey, #e5e5e5);
    border-radius: var(--radius-lg, 12px);
    padding: 30px;
    transition: all var(--transition-normal, 250ms ease);
    cursor: pointer;
}

.hive-plan-card:hover {
    border-color: var(--hp-blue, #4A90E2);
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.12));
    transform: translateY(-4px);
}

.hive-plan-card.selected {
    border-color: var(--hp-blue, #4A90E2);
    box-shadow: var(--shadow-lg, 0 8px 24px rgba(0, 0, 0, 0.16));
}

.hive-plan-card.hive-plan-popular {
    border-color: var(--hp-blue, #4A90E2);
}

.hive-plan-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--hp-blue, #4A90E2);
    color: var(--hp-white, #fff);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hive-plan-badge.hive-badge-lifetime {
    background: var(--hp-orange, #FFAD33);
    color: var(--hp-dark-grey, #333);
}

.hive-plan-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--hp-light-grey, #e5e5e5);
}

.hive-plan-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--hp-dark-grey, #333);
    margin: 0 0 15px 0;
    font-family: var(--font-heading, 'Montserrat', sans-serif);
}

.hive-plan-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 5px;
}

.hive-price-amount {
    font-size: 36px;
    font-weight: 700;
    color: var(--hp-blue, #4A90E2);
    font-family: var(--font-heading, 'Montserrat', sans-serif);
}

.hive-price-amount .woocommerce-Price-currencySymbol {
    font-size: 24px;
}

.hive-price-period {
    font-size: 14px;
    color: var(--hp-medium-grey, #666);
}

.hive-plan-savings {
    margin-top: 10px;
    padding: 6px 12px;
    background: rgba(74, 144, 226, 0.1);
    color: var(--hp-blue, #4A90E2);
    border-radius: var(--radius-sm, 4px);
    font-size: 13px;
    font-weight: 600;
    display: inline-block;
}

.hive-plan-features {
    margin-bottom: 25px;
}

.hive-plan-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hive-plan-features li {
    padding: 10px 0;
    padding-left: 28px;
    position: relative;
    border-bottom: 1px solid var(--hp-light-grey, #f3f4f6);
    font-size: 14px;
    color: var(--hp-dark-grey, #333);
}

.hive-plan-features li:last-child {
    border-bottom: none;
}

.hive-plan-features li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: var(--hp-blue, #4A90E2);
    font-weight: bold;
}

.hive-plan-footer {
    text-align: center;
}

.hive-plan-select {
    display: block;
    cursor: pointer;
}

.hive-plan-select input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.hive-select-button {
    display: block;
    padding: 14px 28px;
    background: var(--hp-light-grey, #f5f5f5);
    color: var(--hp-dark-grey, #333);
    border-radius: var(--radius-md, 8px);
    font-weight: 600;
    font-size: 15px;
    transition: all var(--transition-normal, 250ms ease);
    font-family: var(--font-heading, 'Montserrat', sans-serif);
}

.hive-plan-card:hover .hive-select-button {
    background: var(--hp-blue, #4A90E2);
    color: var(--hp-white, #fff);
}

.hive-plan-card.selected .hive-select-button {
    background: var(--hp-blue, #4A90E2);
    color: var(--hp-white, #fff);
}

.hive-plan-lifetime .hive-select-button {
    background: var(--hp-orange, #FFAD33);
    color: var(--hp-dark-grey, #333);
}

.hive-plan-lifetime:hover .hive-select-button,
.hive-plan-lifetime.selected .hive-select-button {
    background: var(--hp-orange-dark, #E69A2E);
    color: var(--hp-white, #fff);
}

/* Guarantees */
.hive-guarantees {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 20px;
    background: var(--hp-light-grey, #f5f5f5);
    border-radius: var(--radius-lg, 12px);
    flex-wrap: wrap;
}

.hive-guarantee {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--hp-dark-grey, #333);
}

.hive-guarantee-icon {
    font-size: 20px;
    color: var(--hp-blue, #4A90E2);
}

/* ==========================================================================
   My Account - Subscriptions (Style WooCommerce/Nectar)
   ========================================================================== */

.hivesubscriptions-myaccount {
    margin-top: 30px;
}

.hivesubscriptions-myaccount h2 {
    color: var(--hp-blue, #4A90E2);
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-size: 1.625rem;
    margin-bottom: var(--space-md, 24px);
}

/* Utilise les styles WooCommerce natifs */
.hive-subscriptions-table {
    width: 100%;
    border-collapse: collapse;
}

.hive-subscriptions-table th {
    background: var(--hp-light-grey, #f5f5f5);
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--hp-dark-grey, #333);
    border-bottom: 2px solid #e5e5e5;
    font-family: var(--font-heading, 'Montserrat', sans-serif);
}

.hive-subscriptions-table td {
    padding: 20px 15px;
    border-bottom: 1px solid #e5e5e5;
    vertical-align: middle;
    color: var(--hp-dark-grey, #333);
}

.hive-subscriptions-table tr:hover {
    background: var(--hp-light-grey, #f5f5f5);
}

.hive-subscriptions-table a {
    color: var(--hp-blue, #4A90E2);
    font-weight: 600;
}

.hive-subscriptions-table a:hover {
    color: var(--hp-orange, #FFAD33);
}

/* Plan badges - Style Nectar */
.hive-plan-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-sm, 4px);
    font-size: 12px;
    font-weight: 600;
}

.hive-plan-monthly {
    background: rgba(74, 144, 226, 0.15);
    color: var(--hp-blue, #4A90E2);
}

.hive-plan-yearly {
    background: rgba(74, 144, 226, 0.25);
    color: var(--hp-blue-dark, #3A7BC8);
}

.hive-plan-lifetime {
    background: rgba(255, 173, 51, 0.2);
    color: var(--hp-orange-dark, #E69A2E);
}

/* Status badges - Style Nectar */
.hive-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-sm, 4px);
    font-size: 12px;
    font-weight: 600;
}

.hive-status-pending {
    background: rgba(255, 173, 51, 0.2);
    color: var(--hp-orange-dark, #E69A2E);
}

.hive-status-active {
    background: rgba(40, 167, 69, 0.15);
    color: var(--hp-success, #28a745);
}

.hive-status-on-hold {
    background: rgba(74, 144, 226, 0.15);
    color: var(--hp-blue, #4A90E2);
}

.hive-status-cancelled {
    background: rgba(220, 53, 69, 0.15);
    color: var(--hp-error, #dc3545);
}

.hive-status-expired {
    background: var(--hp-light-grey, #f5f5f5);
    color: var(--hp-medium-grey, #666);
}

.hive-status-lifetime {
    background: rgba(40, 167, 69, 0.15);
    color: var(--hp-success, #28a745);
}

.hive-no-renewal {
    color: var(--hp-medium-grey, #666);
    font-style: italic;
}

/* Empty State - Style Nectar (sans bande verte WooCommerce) */
.hive-empty-state {
    padding: var(--space-xl, 48px) var(--space-lg, 32px);
    background: var(--hp-white, #fff);
    border: 1px solid #e5e5e5;
    border-radius: var(--radius-lg, 12px);
    text-align: center;
    box-shadow: var(--shadow-sm, 0 2px 4px rgba(0, 0, 0, 0.08));
}

.hive-empty-icon {
    font-size: 48px;
    margin-bottom: var(--space-md, 24px);
    opacity: 0.8;
}

.hive-empty-state p {
    margin-bottom: var(--space-md, 24px);
    color: var(--hp-dark-grey, #333);
    font-size: 16px;
}

/* Boutons HiveSubscriptions - Style Nectar */
.hive-btn {
    display: inline-block;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 15px;
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    border-radius: var(--radius-md, 8px);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-normal, 250ms ease);
    border: 2px solid transparent;
}

.hive-btn-primary {
    background: var(--hp-blue, #4A90E2);
    color: var(--hp-white, #fff) !important;
    border-color: var(--hp-blue, #4A90E2);
}

.hive-btn-primary:hover {
    background: var(--hp-blue-dark, #3A7BC8);
    border-color: var(--hp-blue-dark, #3A7BC8);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.12));
    color: var(--hp-white, #fff) !important;
}

.hive-btn-secondary {
    background: transparent;
    color: var(--hp-blue, #4A90E2) !important;
    border-color: var(--hp-blue, #4A90E2);
}

.hive-btn-secondary:hover {
    background: var(--hp-blue, #4A90E2);
    color: var(--hp-white, #fff) !important;
}

/* Actions - Boutons style WooCommerce/Nectar */
.hive-col-actions .button {
    display: inline-block;
    margin-right: 5px;
    margin-bottom: 5px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    border-radius: var(--radius-sm, 4px);
    border: 2px solid var(--hp-blue, #4A90E2);
    background: transparent;
    color: var(--hp-blue, #4A90E2);
    cursor: pointer;
    transition: all var(--transition-fast, 150ms ease);
    text-decoration: none;
}

.hive-col-actions .button:hover {
    background: var(--hp-blue, #4A90E2);
    color: var(--hp-white, #fff);
}

.hive-cancel-subscription {
    border-color: var(--hp-error, #dc3545) !important;
    color: var(--hp-error, #dc3545) !important;
}

.hive-cancel-subscription:hover {
    background: var(--hp-error, #dc3545) !important;
    color: var(--hp-white, #fff) !important;
}

/* Message vide - Style WooCommerce */
.woocommerce-message--info {
    padding: var(--space-lg, 32px);
    background: var(--hp-light-grey, #f5f5f5);
    border-radius: var(--radius-md, 8px);
    text-align: center;
}

.woocommerce-message--info p {
    margin-bottom: var(--space-md, 24px);
    color: var(--hp-dark-grey, #333);
}

.woocommerce-message--info .button {
    display: inline-block;
    padding: 12px 24px;
    background: var(--hp-blue, #4A90E2);
    color: var(--hp-white, #fff);
    border-radius: var(--radius-md, 8px);
    font-weight: 600;
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    text-decoration: none;
    transition: all var(--transition-normal, 250ms ease);
}

.woocommerce-message--info .button:hover {
    background: var(--hp-blue-dark, #3A7BC8);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.12));
}

/* ==========================================================================
   Modal - Style Nectar
   ========================================================================== */

.hive-modal {
    position: fixed;
    z-index: var(--z-modal, 1200);
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hive-modal-content {
    background: var(--hp-white, #fff);
    border-radius: var(--radius-lg, 12px);
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-xl, 0 16px 48px rgba(0, 0, 0, 0.2));
}

.hive-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: var(--hp-medium-grey, #666);
    transition: color var(--transition-fast, 150ms ease);
}

.hive-modal-close:hover {
    color: var(--hp-dark-grey, #333);
}

.hive-modal h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: var(--hp-blue, #4A90E2);
    font-family: var(--font-heading, 'Montserrat', sans-serif);
}

.hive-invoices-list {
    margin-top: 15px;
}

.hive-invoice-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid #e5e5e5;
    border-radius: var(--radius-md, 8px);
    margin-bottom: 10px;
    transition: all var(--transition-fast, 150ms ease);
}

.hive-invoice-item:hover {
    border-color: var(--hp-blue, #4A90E2);
    box-shadow: var(--shadow-sm, 0 2px 4px rgba(0, 0, 0, 0.08));
}

.hive-invoice-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.hive-invoice-number {
    font-weight: 600;
    color: var(--hp-dark-grey, #333);
}

.hive-invoice-date {
    font-size: 13px;
    color: var(--hp-medium-grey, #666);
}

.hive-invoice-amount {
    font-weight: 600;
    color: var(--hp-blue, #4A90E2);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .hive-plans-container {
        grid-template-columns: 1fr;
    }

    .hive-guarantees {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .hive-subscriptions-table thead {
        display: none;
    }

    .hive-subscriptions-table tr {
        display: block;
        margin-bottom: 20px;
        border: 1px solid #e5e5e5;
        border-radius: var(--radius-md, 8px);
        overflow: hidden;
    }

    .hive-subscriptions-table td {
        display: flex;
        justify-content: space-between;
        padding: 12px 15px;
        border-bottom: 1px solid #e5e5e5;
    }

    .hive-subscriptions-table td:last-child {
        border-bottom: none;
    }

    .hive-subscriptions-table td::before {
        content: attr(data-title);
        font-weight: 600;
        color: var(--hp-dark-grey, #333);
    }

    .hive-col-actions {
        flex-wrap: wrap;
        justify-content: flex-end !important;
    }
}

/* ==========================================================================
   Loading States - Style Nectar
   ========================================================================== */

.hive-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e5e5e5;
    border-radius: 50%;
    border-top-color: var(--hp-blue, #4A90E2);
    animation: hive-spin 0.8s linear infinite;
}

@keyframes hive-spin {
    to {
        transform: rotate(360deg);
    }
}

.hive-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
