/**
 * Frontend Styles for Elderink WooCommerce Integration
 * Styling for membership products, account pages, and checkout
 */

/* ==========================================================================
   Base Membership Styles
   ========================================================================== */

.ewc-membership-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 25px;
    margin: 25px 0;
    border-left: 5px solid #0073aa;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.ewc-membership-info::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%230073aa" opacity="0.1"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>') no-repeat center;
    background-size: 60px 60px;
}

.ewc-membership-info h3 {
    color: #0073aa;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.ewc-membership-info h3::before {
    content: '🎫';
    margin-right: 10px;
    font-size: 28px;
}

.ewc-membership-details ul {
    list-style: none;
    padding-left: 0;
    margin: 15px 0;
}

.ewc-membership-details li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
    border-bottom: 1px solid rgba(0, 115, 170, 0.1);
    font-size: 16px;
    line-height: 1.5;
}

.ewc-membership-details li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
    font-size: 14px;
}

.ewc-membership-details li:last-child {
    border-bottom: none;
}

/* ==========================================================================
   Family Member Form
   ========================================================================== */

.ewc-family-member-form {
    background: #ffffff;
    border-radius: 12px;
    padding: 25px;
    margin: 25px 0;
    border: 2px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ewc-family-member-form h3 {
    color: #495057;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 20px;
    display: flex;
    align-items: center;
}

.ewc-family-member-form h3::before {
    content: '👨‍👩‍👧‍👦';
    margin-right: 10px;
    font-size: 24px;
}

.ewc-family-member {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    border-left: 4px solid #17a2b8;
    position: relative;
    transition: all 0.3s ease;
}

.ewc-family-member:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.ewc-family-member h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #17a2b8;
    font-size: 18px;
}

.ewc-family-member p {
    margin: 10px 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.ewc-family-member label {
    display: inline-block;
    width: 120px;
    font-weight: 600;
    color: #495057;
    margin-right: 10px;
    flex-shrink: 0;
}

.ewc-family-member input,
.ewc-family-member select {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.ewc-family-member input:focus,
.ewc-family-member select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.25);
}

.ewc-remove-family-member {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

.ewc-remove-family-member:hover {
    background: #c82333;
}

#ewc-add-family-member {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 15px;
}

#ewc-add-family-member:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

/* ==========================================================================
   Product Page Enhancements
   ========================================================================== */

.single-product .ewc-membership-info {
    margin-bottom: 30px;
}

.woocommerce .button.ewc-membership-purchase,
.woocommerce-page .button.ewc-membership-purchase {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
    font-weight: 600;
    font-size: 18px;
    padding: 15px 30px;
    border-radius: 8px;
    border: none;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.woocommerce .button.ewc-membership-purchase:hover,
.woocommerce-page .button.ewc-membership-purchase:hover {
    background: linear-gradient(135deg, #005a87 0%, #004465 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 115, 170, 0.3);
}

.ewc-access-areas,
.ewc-member-benefits {
    margin: 20px 0;
}

.ewc-access-areas ul,
.ewc-member-benefits ul {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin: 10px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   Cart & Checkout Styles
   ========================================================================== */

.woocommerce-cart .ewc-family-members,
.woocommerce-checkout .ewc-family-members {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    border-left: 4px solid #17a2b8;
}

.woocommerce-cart .ewc-family-members strong,
.woocommerce-checkout .ewc-family-members strong {
    color: #17a2b8;
    display: block;
    margin-bottom: 8px;
}

/* ==========================================================================
   Thank You Page
   ========================================================================== */

.ewc-membership-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 15px;
    padding: 30px;
    margin: 25px 0;
    border: 2px solid #e9ecef;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.ewc-membership-card::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(0, 115, 170, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.ewc-membership-card h3 {
    color: #0073aa;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    position: relative;
}

.ewc-membership-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.ewc-membership-details p {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin: 0;
    border-left: 4px solid #0073aa;
    font-size: 16px;
}

.ewc-membership-details strong {
    color: #495057;
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ewc-qr-code {
    text-align: center;
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin: 20px 0;
    border: 2px dashed #ced4da;
}

.ewc-qr-code img {
    max-width: 200px;
    height: auto;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.ewc-qr-code p {
    margin: 15px 0 5px;
    font-size: 18px;
    font-weight: 600;
    color: #495057;
}

.ewc-family-members {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    border-left: 4px solid #28a745;
}

.ewc-family-members h4 {
    color: #28a745;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    display: flex;
    align-items: center;
}

.ewc-family-members h4::before {
    content: '👨‍👩‍👧‍👦';
    margin-right: 10px;
    font-size: 20px;
}

.ewc-family-members ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.ewc-family-members li {
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
    font-size: 16px;
}

.ewc-family-members li:last-child {
    border-bottom: none;
}

/* ==========================================================================
   Account Page Styles
   ========================================================================== */

.ewc-membership-account {
    max-width: 900px;
    margin: 0 auto;
}

.ewc-membership-status {
    text-align: right;
    margin-bottom: 20px;
}

.ewc-status-badge {
    padding: 8px 20px;
    border-radius: 25px;
    color: white;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
}

.ewc-status-active .ewc-status-badge {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.ewc-status-expired .ewc-status-badge {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
}

.ewc-status-cancelled .ewc-status-badge {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

.ewc-status-suspended .ewc-status-badge {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: #000;
}

.ewc-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
    font-size: 16px;
}

.ewc-info-row:last-child {
    border-bottom: none;
}

.ewc-info-row strong {
    color: #495057;
    font-weight: 600;
}

.ewc-expiry-info {
    background: #fff3cd;
    padding: 10px 15px;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
    color: #856404;
    font-weight: 600;
    margin: 15px 0;
}

.ewc-expired-info {
    background: #f8d7da;
    padding: 10px 15px;
    border-radius: 8px;
    border-left: 4px solid #dc3545;
    color: #721c24;
    font-weight: 600;
    margin: 15px 0;
}

.ewc-membership-qr {
    text-align: center;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 30px;
    border-radius: 15px;
    margin: 25px 0;
    border: 2px solid #e9ecef;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.ewc-membership-qr h3 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 20px;
}

.ewc-qr-container {
    display: inline-block;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.ewc-qr-image {
    max-width: 200px;
    height: auto;
    display: block;
    margin: 0 auto 15px;
}

.ewc-qr-code-text {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    color: #6c757d;
    margin: 10px 0;
    font-weight: 600;
    letter-spacing: 1px;
}

.ewc-qr-instructions {
    font-style: italic;
    color: #6c757d;
    font-size: 14px;
    margin-top: 15px;
}

.ewc-membership-actions {
    text-align: center;
    padding: 25px 0;
    margin: 25px 0;
    border-top: 2px solid #e9ecef;
}

.ewc-membership-actions .button {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    margin: 0 10px;
    display: inline-block;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.ewc-membership-actions .button:hover {
    background: linear-gradient(135deg, #005a87 0%, #004465 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 115, 170, 0.3);
    color: white;
}

.ewc-download-card {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
}

.ewc-download-card:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%) !important;
}

.ewc-renew-membership {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%) !important;
    color: #000 !important;
}

.ewc-renew-membership:hover {
    background: linear-gradient(135deg, #e0a800 0%, #dc6800 100%) !important;
    color: #000 !important;
}

/* ==========================================================================
   History Table
   ========================================================================== */

.ewc-membership-history {
    margin: 30px 0;
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.ewc-membership-history h3 {
    color: #495057;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.ewc-history-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
}

.ewc-history-table th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #495057;
    font-weight: 600;
    padding: 15px 10px;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
}

.ewc-history-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: top;
}

.ewc-history-table tr:hover {
    background-color: #f8f9fa;
}

.ewc-history-table tr:last-child td {
    border-bottom: none;
}

/* ==========================================================================
   No Membership State
   ========================================================================== */

.ewc-no-membership {
    text-align: center;
    padding: 60px 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 15px;
    margin: 30px 0;
    border: 2px dashed #ced4da;
}

.ewc-no-membership h2 {
    color: #6c757d;
    margin-bottom: 15px;
    font-size: 28px;
}

.ewc-no-membership p {
    color: #6c757d;
    font-size: 18px;
    margin-bottom: 25px;
    line-height: 1.6;
}

.ewc-no-membership .button {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 18px;
    display: inline-block;
    transition: all 0.3s ease;
}

.ewc-no-membership .button:hover {
    background: linear-gradient(135deg, #005a87 0%, #004465 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 115, 170, 0.3);
    color: white;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .ewc-membership-info,
    .ewc-family-member-form,
    .ewc-membership-card {
        padding: 20px 15px;
        margin: 20px 0;
    }
    
    .ewc-family-member p {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ewc-family-member label {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .ewc-family-member input,
    .ewc-family-member select {
        width: 100%;
        min-width: auto;
    }
    
    .ewc-membership-details {
        grid-template-columns: 1fr;
    }
    
    .ewc-info-row {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    .ewc-membership-actions .button {
        display: block;
        width: 100%;
        margin: 10px 0;
        text-align: center;
    }
    
    .ewc-history-table {
        font-size: 12px;
    }
    
    .ewc-history-table th,
    .ewc-history-table td {
        padding: 8px 5px;
    }
    
    .ewc-membership-status {
        text-align: center;
    }
    
    .ewc-qr-container {
        padding: 15px;
    }
    
    .ewc-qr-image {
        max-width: 150px;
    }
    
    .ewc-no-membership {
        padding: 40px 20px;
    }
    
    .ewc-no-membership h2 {
        font-size: 24px;
    }
    
    .ewc-no-membership p {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .ewc-membership-info h3,
    .ewc-membership-card h3 {
        font-size: 20px;
    }
    
    .ewc-family-member-form h3 {
        font-size: 18px;
    }
    
    .ewc-membership-qr h3 {
        font-size: 18px;
    }
    
    .ewc-status-badge {
        font-size: 12px;
        padding: 6px 15px;
    }
    
    .ewc-history-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.ewc-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.ewc-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: ewc-spin 1s linear infinite;
}

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

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .ewc-membership-actions,
    .ewc-membership-history {
        display: none;
    }
    
    .ewc-membership-card,
    .ewc-membership-qr {
        border: 2px solid #000;
        page-break-inside: avoid;
    }
    
    .ewc-qr-image {
        max-width: 150px;
    }
}