/* CALAIMH Memberships — Frontend Styles */

/* Pricing Table */
.calaimh-pricing-table {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    margin: 24px 0;
}
.calaimh-pricing-card {
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.calaimh-pricing-card:hover {
    border-color: #2c5282;
    box-shadow: 0 4px 12px rgba(44, 82, 130, 0.15);
}
.calaimh-pricing-card--active {
    border-color: #38a169;
    background: #f0fff4;
}
.calaimh-pricing-card h3 {
    margin: 0 0 12px;
    font-size: 1.25em;
}
.calaimh-pricing-price {
    margin: 16px 0;
}
.calaimh-pricing-price .amount {
    font-size: 2em;
    font-weight: 700;
    color: #2c5282;
}
.calaimh-pricing-price .period {
    font-size: 0.9em;
    color: #718096;
}
.calaimh-pricing-description {
    color: #4a5568;
    font-size: 0.95em;
    margin: 12px 0;
    line-height: 1.5;
}
.calaimh-pricing-duration {
    color: #718096;
    font-size: 0.875em;
    margin: 12px 0 20px;
}
.calaimh-pricing-button {
    display: inline-block;
    padding: 12px 32px;
    background: #2c5282;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 4px;
    font-weight: 600;
    transition: background 0.2s;
}
.calaimh-pricing-button:hover {
    background: #2a4365;
}
.calaimh-pricing-active {
    display: inline-block;
    padding: 12px 32px;
    color: #38a169;
    font-weight: 600;
    font-size: 1em;
}

/* ═══ Account Dashboard ═══ */
.calaimh-account {
    max-width: 960px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Login state */
.calaimh-account-login {
    text-align: center;
    padding: 48px 24px;
    background: #f7fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}
.calaimh-account-login-icon {
    font-size: 2.5em;
    color: #2c5282;
    margin-bottom: 8px;
}
.calaimh-account-login h2 {
    margin: 0 0 8px;
    color: #1a202c;
}
.calaimh-account-login p {
    color: #718096;
    margin: 0 0 20px;
}

/* Profile Header */
.calaimh-account__header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.calaimh-account__avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.calaimh-account__info {
    flex: 1;
    min-width: 200px;
}
.calaimh-account__name {
    margin: 0 0 4px;
    font-size: 1.4em;
    color: #1a202c;
}
.calaimh-account__email {
    margin: 0;
    color: #718096;
    font-size: 0.95em;
}
.calaimh-account__since {
    margin: 4px 0 0;
    color: #a0aec0;
    font-size: 0.85em;
}
.calaimh-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    white-space: nowrap;
}
.calaimh-badge--active {
    background: #c6f6d5;
    color: #22543d;
}
.calaimh-badge--inactive {
    background: #fed7d7;
    color: #9b2c2c;
}

/* Status Cards */
.calaimh-account__cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.calaimh-account__card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: box-shadow 0.2s;
}
.calaimh-account__card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
}
.calaimh-account__card-icon {
    font-size: 1.6em;
    margin-bottom: 8px;
}
.calaimh-account__card-icon.blue   { color: #2c5282; }
.calaimh-account__card-icon.green  { color: #38a169; }
.calaimh-account__card-icon.teal   { color: #319795; }
.calaimh-account__card-icon.orange { color: #dd6b20; }
.calaimh-account__card-icon.purple { color: #805ad5; }
.calaimh-account__card-icon.gray   { color: #718096; }
.calaimh-account__card-label {
    font-size: 0.8em;
    color: #a0aec0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}
.calaimh-account__card-value {
    font-size: 1.05em;
    font-weight: 600;
    color: #2d3748;
}

/* Section titles */
.calaimh-account__section-title {
    font-size: 1.15em;
    color: #2d3748;
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}
.calaimh-account__section {
    margin-bottom: 32px;
}

/* Quick Actions */
.calaimh-account__actions {
    margin-bottom: 32px;
}
.calaimh-account__actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}
.calaimh-account__action-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    text-decoration: none !important;
    color: #2d3748 !important;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.calaimh-account__action-card:hover {
    border-color: #2c5282;
    box-shadow: 0 2px 8px rgba(44,82,130,.12);
}
.calaimh-account__action-icon {
    font-size: 1.3em;
    flex-shrink: 0;
}
.calaimh-account__action-icon.green  { color: #38a169; }
.calaimh-account__action-icon.blue   { color: #2c5282; }
.calaimh-account__action-icon.teal   { color: #319795; }
.calaimh-account__action-icon.gray   { color: #a0aec0; }
.calaimh-account__action-label {
    font-weight: 600;
    font-size: 0.95em;
}

/* Tables */
.calaimh-account__table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.calaimh-memberships-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}
.calaimh-memberships-table th,
.calaimh-memberships-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    font-size: 0.95em;
}
.calaimh-memberships-table th {
    background: #f7fafc;
    font-weight: 600;
    color: #4a5568;
    white-space: nowrap;
}
.calaimh-memberships-table tr:hover td {
    background: #f7fafc;
}
.calaimh-account__actions-cell {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* Empty state */
.calaimh-account__empty {
    text-align: center;
    padding: 32px;
    background: #f7fafc;
    border-radius: 10px;
    border: 1px dashed #cbd5e0;
}
.calaimh-account__empty--small {
    padding: 20px;
}
.calaimh-account__empty p {
    color: #718096;
    margin: 0 0 16px;
}

/* Status badges */
.calaimh-status {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 0.82em;
    font-weight: 600;
    white-space: nowrap;
}
.calaimh-status--active,
.calaimh-status--completed {
    background: #c6f6d5;
    color: #22543d;
}
.calaimh-status--expired,
.calaimh-status--failed {
    background: #fed7d7;
    color: #9b2c2c;
}
.calaimh-status--pending,
.calaimh-status--on-hold {
    background: #fefcbf;
    color: #744210;
}
.calaimh-status--cancelled,
.calaimh-status--refunded {
    background: #e2e8f0;
    color: #4a5568;
}
.calaimh-status--processing {
    background: #bee3f8;
    color: #2a4365;
}

/* Buttons */
.calaimh-btn {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
    border: none;
    transition: background 0.2s, box-shadow 0.2s;
    line-height: 1.4;
}
.calaimh-btn--sm {
    padding: 5px 14px;
    font-size: 0.82em;
}
.calaimh-btn--primary {
    background: #2c5282;
    color: #fff !important;
}
.calaimh-btn--primary:hover {
    background: #2a4365;
}
.calaimh-btn--renew {
    background: #c05621;
    color: #fff !important;
}
.calaimh-btn--renew:hover {
    background: #9c4221;
}
.calaimh-btn--outline {
    background: transparent;
    color: #2c5282 !important;
    border: 1px solid #2c5282;
}
.calaimh-btn--outline:hover {
    background: #ebf4ff;
}
.calaimh-btn--danger {
    background: transparent;
    color: #e53e3e !important;
    border: 1px solid #e53e3e;
}
.calaimh-btn--danger:hover {
    background: #e53e3e;
    color: #fff !important;
}
.calaimh-text-muted {
    color: #a0aec0;
}
.calaimh-link {
    color: #2c5282;
    font-weight: 600;
    text-decoration: none;
    margin-left: 12px;
}
.calaimh-link:hover {
    text-decoration: underline;
}

/* Account Settings */
.calaimh-account__settings {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}
.calaimh-account__setting-row {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #edf2f7;
}
.calaimh-account__setting-row:last-child {
    border-bottom: none;
}
.calaimh-account__setting-label {
    width: 140px;
    flex-shrink: 0;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9em;
}
.calaimh-account__setting-value {
    flex: 1;
    color: #2d3748;
    font-size: 0.95em;
}

/* Responsive */
@media (max-width: 768px) {
    .calaimh-account__header {
        flex-direction: column;
        text-align: center;
    }
    .calaimh-account__cards {
        grid-template-columns: repeat(2, 1fr);
    }
    .calaimh-account__actions-grid {
        grid-template-columns: 1fr;
    }
    .calaimh-memberships-table thead {
        display: none;
    }
    .calaimh-memberships-table tbody tr {
        display: block;
        margin-bottom: 16px;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        overflow: hidden;
    }
    .calaimh-memberships-table tbody td {
        display: flex;
        justify-content: space-between;
        padding: 10px 16px;
        border-bottom: 1px solid #edf2f7;
    }
    .calaimh-memberships-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #4a5568;
        margin-right: 12px;
    }
    .calaimh-account__actions-cell {
        justify-content: flex-end;
    }
    .calaimh-account__setting-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .calaimh-account__setting-label {
        width: auto;
    }
}
@media (max-width: 480px) {
    .calaimh-account__cards {
        grid-template-columns: 1fr;
    }
}

/* Restriction notice */
.calaimh-restricted-notice {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    margin: 24px 0;
}
.calaimh-restricted-notice p {
    margin: 8px 0;
}
.calaimh-restricted-notice .button {
    display: inline-block;
    padding: 10px 24px;
    background: #2c5282;
    color: #fff !important;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
}

/* Cancel button — handled by .calaimh-btn--danger */

/* Paywall */
.calaimh-paywall-preview {
    position: relative;
}
.calaimh-paywall-cta {
    position: relative;
    margin-top: -60px;
}
.calaimh-paywall-fade {
    height: 80px;
    background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
    pointer-events: none;
}
.calaimh-paywall-box {
    background: #f7fafc;
    border: 2px solid #2c5282;
    border-radius: 8px;
    padding: 32px;
    text-align: center;
    margin: 0 0 24px;
}
.calaimh-paywall-box h3 {
    margin: 0 0 12px;
    font-size: 1.3em;
    color: #2c5282;
}
.calaimh-paywall-box p {
    margin: 8px 0;
    color: #4a5568;
}
.calaimh-paywall-plans {
    font-size: 0.9em;
    color: #718096 !important;
}
.calaimh-paywall-button {
    display: inline-block;
    margin-top: 16px;
    padding: 14px 36px;
    background: #2c5282;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 4px;
    font-weight: 600;
    font-size: 1.05em;
    transition: background 0.2s;
}
.calaimh-paywall-button:hover {
    background: #2a4365;
}
.calaimh-paywall-login {
    margin-top: 12px;
    font-size: 0.9em;
}
.calaimh-paywall-login a {
    color: #2c5282;
    font-weight: 600;
}

/* Protected Downloads */
.calaimh-downloads-list {
    margin: 16px 0;
}
.calaimh-download-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    margin-bottom: 8px;
}
.calaimh-download-item:hover {
    border-color: #2c5282;
}
.calaimh-download-link {
    display: inline-block;
    padding: 6px 18px;
    background: #2c5282;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: 600;
}
.calaimh-download-link:hover {
    background: #2a4365;
}
