/* Can Premium Membership - Frontend Styles */

/* My Account Premium Membership Section */
.can-pm-my-account-wrapper {
    margin: 0 0 2em 0;
}

.can-pm-my-account-wrapper h2 {
    font-size: 1.5em;
    margin-bottom: 1em;
    color: #333;
}

/* Premium Memberships Table */
.can-pm-memberships-table-wrapper {
    margin: 1.5em 0;
    overflow-x: auto;
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.can-pm-memberships-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: 14px;
    padding: 8px;
}

.can-pm-memberships-table th,
.can-pm-memberships-table td {
    text-align: left;
    padding: 12px 8px;
    vertical-align: top;
    border-bottom: 1px solid #e1e1e1;
}

.can-pm-memberships-table th {
    font-weight: bold;
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    color: #495057;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.can-pm-memberships-table tbody tr {
    transition: background-color 0.2s ease;
}

.can-pm-memberships-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Status Badges */
.membership-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 0.85em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

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

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

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

/* Download Stats */
.remaining-days-value {
    font-size: 1.1em;
    color: #007cba;
    font-weight: bold;
}

.days-text {
    font-size: 0.9em;
    color: #666;
    margin-left: 2px;
}

.download-stats {
    font-weight: bold;
    color: #333;
}

.daily-limit-info {
    color: #666;
    font-size: 0.9em;
    margin-top: 3px;
}

/* Information Box */
.can-pm-membership-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 5px;
    margin-top: 2em;
    border-left: 4px solid #007cba;
}

.can-pm-membership-info h3 {
    margin-top: 0;
    color: #333;
    font-size: 1.2em;
}

.can-pm-membership-info ul {
    margin: 0;
    padding-left: 20px;
}

.can-pm-membership-info li {
    margin-bottom: 8px;
    color: #666;
    line-height: 1.5;
}

/* Product Premium Membership Info */
.can-pm-product-membership-info {
    background: #e8f4fd;
    border: 1px solid #bee5eb;
    border-radius: 5px;
    padding: 15px;
    margin: 15px 0;
}

.can-pm-product-membership-info h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #0c5460;
    font-size: 1.1em;
}

.premium-membership-item {
    margin-bottom: 15px;
}

.premium-membership-item:last-child {
    margin-bottom: 0;
}

.premium-membership-item h5 {
    margin: 0 0 8px 0;
    color: #0c5460;
    font-size: 1em;
}

.premium-membership-item ul {
    margin: 0;
    padding-left: 20px;
    list-style-type: disc;
}

.premium-membership-item li {
    margin-bottom: 5px;
    color: #495057;
    font-size: 0.95em;
}

/* Product Tab Content */
.can-pm-membership-tab-content {
    padding: 20px 0;
}

.can-pm-membership-tab-content h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

.membership-type-details {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
}

.membership-type-details h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #007cba;
    font-size: 1.1em;
}

.membership-benefits ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.membership-benefits li {
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
}

.membership-benefits li:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.membership-benefits li .dashicons {
    margin-right: 10px;
    color: #007cba;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.membership-additional-info {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 20px;
}

.membership-additional-info h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.membership-additional-info ul {
    margin: 0;
    padding-left: 20px;
}

.membership-additional-info li {
    margin-bottom: 8px;
    color: #666;
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .can-pm-memberships-table,
    .can-pm-memberships-table thead,
    .can-pm-memberships-table tbody,
    .can-pm-memberships-table th,
    .can-pm-memberships-table td,
    .can-pm-memberships-table tr {
        display: block;
    }

    .can-pm-memberships-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .can-pm-memberships-table tr {
        border: 1px solid #ccc;
        margin-bottom: 10px;
        padding: 10px;
        border-radius: 5px;
        background: #fff;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }

    .can-pm-memberships-table td {
        border: none;
        position: relative;
        padding-left: 50% !important;
        padding-top: 10px;
        padding-bottom: 10px;
        min-height: 30px;
    }

    .can-pm-memberships-table td:before {
        content: attr(data-title) ": ";
        position: absolute;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
        color: #333;
        top: 10px;
    }

    .can-pm-product-membership-info {
        padding: 12px;
    }

    .membership-benefits li {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .membership-benefits li .dashicons {
        margin-bottom: 5px;
        margin-right: 0;
    }
}

@media (max-width: 480px) {
    .can-pm-membership-info,
    .membership-type-details,
    .membership-additional-info {
        padding: 15px;
    }

    .can-pm-memberships-table td {
        padding-left: 40% !important;
    }

    .can-pm-memberships-table td:before {
        width: 35%;
    }
}

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

/* Empty State */
.woocommerce-message--info {
    background: #e7f3ff;
    border: 1px solid #b8daff;
    border-radius: 5px;
    padding: 15px;
    color: #004085;
}

/* Accessibility Improvements */
.can-pm-my-account-wrapper a:focus,
.can-pm-product-membership-info a:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Download Button Section */
.can-pm-download-section {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
}

.can-pm-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px !important;
    background: #dc3545 !important;
    color: white !important;
    border: none !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    transition: background-color 0.2s ease !important;
    cursor: pointer !important;
    line-height: 1.4 !important;
}

.can-pm-download-btn:hover {
    background: #c82333 !important;
    color: white !important;
    text-decoration: none !important;
}

.can-pm-download-btn:disabled {
    background: #6c757d !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.can-pm-download-btn .dashicons {
    font-size: 18px !important;
    width: 18px !important;
    height: 18px !important;
    line-height: 18px !important;
}

/* Download button states */
.can-pm-download-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.can-pm-download-btn.success {
    background: #46b450 !important;
}

.can-pm-download-btn.error {
    background: #dc3232 !important;
}

/* Responsive download button */
@media (max-width: 768px) {
    .can-pm-download-section {
        text-align: center;
    }

    .can-pm-download-btn {
        width: 100%;
        justify-content: center;
        padding: 15px 20px !important;
        font-size: 18px !important;
    }
}

/* Download button for Elementor compatibility */
.elementor-widget-woocommerce-product-add-to-cart .can-pm-download-section {
    margin-top: 15px;
}

/* Integration with WooCommerce buttons */
.single-product .summary .can-pm-download-section {
    margin: 15px 0;
}

/* Download button animation */
@keyframes downloadPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.can-pm-download-btn.pulse {
    animation: downloadPulse 0.6s ease-in-out;
}

/* Print Styles */
@media print {
    .can-pm-memberships-table {
        border-collapse: collapse;
    }

    .can-pm-memberships-table th,
    .can-pm-memberships-table td {
        border: 1px solid #333;
        padding: 8px;
    }

    .membership-status {
        border: 1px solid #333;
        background: transparent !important;
        color: #333 !important;
    }

    .can-pm-download-section {
        display: none;
    }
}