/**
 * Member Dashboard CSS
 * 
 * Styles for the member-facing dashboard in WooCommerce My Account
 * Mobile-first, responsive design
 */

/* ==================== LAYOUT ==================== */

.club-member-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ==================== MEMBERSHIP CARD (HERO) ==================== */

.membership-card {
    background: linear-gradient(135deg, #0f2120 0%, #1a3634 100%);
    border-radius: 12px;
    padding: 30px;
    color: white;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.membership-header {
    margin-bottom: 25px;
}

.membership-header h2 {
    margin: 0 0 15px 0;
    font-size: 28px;
    font-weight: 700;
    color: white;
}

.membership-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.membership-level-badge,
.membership-status-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.membership-level-badge.level-basic {
    background: rgba(248, 218, 171, 0.35);
    color: white;
}

.membership-level-badge.level-premium {
    background: rgba(195, 124, 74, 0.4);
    color: white;
}

.membership-level-badge.level-elite {
    background: rgba(233, 179, 122, 0.5);
    color: white;
}

.membership-status-badge.status-valid {
    background: rgba(76, 175, 80, 0.3);
    color: white;
}

.membership-status-badge.status-invalid {
    background: rgba(244, 67, 54, 0.35);
    color: white;
}

/* Membership Stats */
.membership-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 12px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Membership Alerts */
.membership-alert {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
}

.membership-alert strong {
    display: block;
    margin-bottom: 5px;
}

.membership-alert .button {
    margin-top: 10px;
    background: white;
    color: #c37c4a;
    border: none;
}

.membership-alert .button:hover {
    background: #f8daab;
    color: #0f2120;
}

/* ==================== QR CODE CARD ==================== */

.qr-code-card {
    background: linear-gradient(135deg, #c37c4a 0%, #e9b37a 100%);
    border: 2px solid #0f2120;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(195, 124, 74, 0.3);
}

.qr-code-header h3 {
    margin: 0 0 20px 0;
    color: white;
    font-size: 18px;
    font-weight: 700;
}

.qr-code-header h3 i {
    margin-right: 8px;
}

.qr-code-content {
    background: white;
    border-radius: 8px;
    padding: 20px;
}

.qr-code-image-container {
    display: inline-block;
    background: white;
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
    margin-bottom: 15px;
}

.qr-code-image-container:hover {
    transform: scale(1.05);
}

.qr-code-image {
    display: block;
    width: 250px;
    height: 250px;
    max-width: 100%;
    height: auto;
}

.qr-code-instruction {
    color: #666;
    font-size: 14px;
    margin: 0;
    line-height: 1.6;
}

.qr-code-instruction i {
    color: #c37c4a;
    margin-right: 5px;
}

/* Hide QR code on website, show only in PWA */
.qr-code-card {
    display: none;
}

.club-pwa-mode .qr-code-card {
    display: block;
}

/* ==================== QUICK ACTIONS ==================== */

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.quick-action-btn {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.quick-action-btn:hover {
    border-color: #c37c4a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(195, 124, 74, 0.3);
}

.action-icon {
    font-size: 32px;
    color: #c37c4a;
}

.action-text {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

/* ==================== DASHBOARD SECTIONS ==================== */

.dashboard-section {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f5f5f5;
}

.section-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

.section-subsection {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0 15px 0;
}

.section-subsection h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #666;
}

/* ==================== WALLET SECTION ==================== */

.wallet-balance-card {
    background: linear-gradient(135deg, #c37c4a 0%, #e9b37a 100%);
    border-radius: 12px;
    padding: 25px;
    color: white;
    margin-bottom: 20px;
}

.balance-main {
    margin-bottom: 15px;
}

.balance-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.balance-amount {
    font-size: 42px;
    font-weight: 700;
    line-height: 1;
}

.balance-amount.negative {
    color: #ffeb3b;
}

.balance-breakdown {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.breakdown-label {
    font-size: 13px;
    opacity: 0.9;
}

.breakdown-value {
    font-size: 16px;
    font-weight: 600;
}

/* Transactions List */
.transactions-list {
    max-height: 300px;
    overflow-y: auto;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-info {
    flex: 1;
}

.transaction-description {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.transaction-date {
    font-size: 12px;
    color: #999;
}

.transaction-amount {
    font-weight: 700;
    font-size: 16px;
}

.transaction-amount.positive {
    color: #4caf50;
}

.transaction-amount.negative {
    color: #f44336;
}

.transaction-loading {
    text-align: center;
    padding: 20px;
    color: #999;
}

/* ==================== LOCKER SECTION ==================== */

.locker-details {
    margin-top: 15px;
}

.locker-photo {
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
}

.locker-photo img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.locker-photo img:hover {
    transform: scale(1.02);
}

.locker-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 6px;
}

.info-label {
    font-weight: 600;
    color: #666;
}

.info-value {
    color: #333;
}

.info-value.text-danger {
    color: #f44336;
    font-weight: 700;
}

.info-value.text-success {
    color: #4caf50;
    font-weight: 700;
}

.locker-contents {
    padding: 15px;
    background: #f5f5f5;
    border-radius: 6px;
    margin-bottom: 10px;
}

.locker-contents strong {
    display: block;
    margin-bottom: 5px;
    color: #666;
}

.locker-note {
    margin-top: 15px;
    padding: 10px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
}

.paid-badge {
    background: #4caf50;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* ==================== VISITS SECTION ==================== */

.visits-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.summary-stat {
    text-align: center;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.summary-value {
    display: block;
    font-size: 36px;
    font-weight: 700;
    color: #c37c4a;
    line-height: 1;
    margin-bottom: 8px;
}

.summary-label {
    font-size: 13px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.visit-history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.visit-history-table thead {
    background: #f5f5f5;
}

.visit-history-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.visit-history-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.visit-history-table tbody tr:hover {
    background: #fafafa;
}

.no-data {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-style: italic;
}

/* ==================== MEMBERSHIP DETAILS ==================== */

.current-plan-card {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.current-plan-card h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
}

.plan-benefits {
    display: grid;
    gap: 12px;
}

.benefit-item {
    padding: 10px;
    background: white;
    border-radius: 6px;
}

.benefit-item strong {
    color: #c37c4a;
    margin-right: 5px;
}

.perks-list {
    list-style: none;
    padding: 15px;
    margin: 10px 0 0 0;
    background: white;
    border-radius: 6px;
}

.perks-list li {
    padding: 8px 0;
    color: #666;
    border-bottom: 1px solid #f0f0f0;
}

.perks-list li:last-child {
    border-bottom: none;
}

/* Upgrade Options */
.upgrade-options {
    margin-top: 30px;
}

.upgrade-options h4 {
    margin-bottom: 20px;
    font-size: 18px;
    color: #333;
}

.upgrade-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.upgrade-card:hover {
    border-color: #c37c4a;
    box-shadow: 0 4px 20px rgba(195, 124, 74, 0.2);
}

.upgrade-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f5f5f5;
}

.upgrade-header h5 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.upgrade-price {
    font-size: 20px;
    font-weight: 700;
    color: #c37c4a;
}

.upgrade-benefits {
    margin-bottom: 15px;
}

.upgrade-benefits > div {
    padding: 8px 0;
    color: #666;
}

.upgrade-perks {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
}

.upgrade-perks li {
    padding: 6px 0 6px 20px;
    position: relative;
    color: #666;
    font-size: 14px;
}

.upgrade-perks li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #4caf50;
    font-weight: 700;
}

.upgrade-btn {
    width: 100%;
}

/* ==================== PROFILE SECTION ==================== */

.profile-view {
    display: grid;
    gap: 12px;
}

.profile-field {
    display: flex;
    justify-content: space-between;
    padding: 12px 15px;
    background: #f9f9f9;
    border-radius: 6px;
}

.field-label {
    font-weight: 600;
    color: #666;
}

.field-value {
    color: #333;
}

/* Profile Edit Form */
.profile-edit {
    margin-top: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group.half {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #666;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #c37c4a;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #999;
    font-size: 12px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* ==================== BUTTONS ==================== */

.button-link {
    background: none;
    border: none;
    color: #c37c4a;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.3s ease;
}

.button-link:hover {
    color: #a85f34;
    text-decoration: underline;
}

.button-text {
    background: none;
    border: none;
    color: #c37c4a;
    cursor: pointer;
    font-size: 13px;
    padding: 0;
}

.button-text:hover {
    text-decoration: underline;
}

.button,
.button-primary,
.button-secondary {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.button {
    background: #f5f5f5;
    color: #333;
}

.button:hover {
    background: #e0e0e0;
}

.button-primary {
    background: linear-gradient(135deg, #c37c4a 0%, #e9b37a 100%);
    color: white;
    border: none;
}

.button-primary:hover {
    background: linear-gradient(135deg, #a85f34 0%, #c37c4a 100%);
}

.button-secondary {
    background: white;
    color: #c37c4a;
    border: 2px solid #c37c4a;
}

.button-secondary:hover {
    background: #c37c4a;
    color: white;
}

/* ==================== PHOTO LIGHTBOX ==================== */

.photo-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 10000;
}

#lightbox-image {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 8px;
}

/* ==================== LOADING STATES ==================== */

.dashboard-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #c37c4a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==================== ALERTS ==================== */

.alert-info {
    background: rgba(33, 150, 243, 0.1);
    border-left: 4px solid #2196f3;
}

.alert-danger {
    background: rgba(244, 67, 54, 0.1);
    border-left: 4px solid #f44336;
}

/* ==================== RESPONSIVE DESIGN ==================== */

/* Tablets */
@media (max-width: 768px) {
    .membership-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .balance-amount {
        font-size: 32px;
    }
    
    .locker-info-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .club-member-dashboard {
        padding: 0 10px;
    }
    
    .membership-card {
        padding: 20px 15px;
    }
    
    .membership-header h2 {
        font-size: 22px;
    }
    
    .membership-stats {
        gap: 10px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    .quick-actions-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .dashboard-section {
        padding: 15px;
    }
    
    .section-header h3 {
        font-size: 18px;
    }
    
    .balance-amount {
        font-size: 28px;
    }
    
    .balance-breakdown {
        grid-template-columns: 1fr;
    }
    
    .visits-summary {
        grid-template-columns: 1fr;
    }
    
    .visit-history-table {
        font-size: 13px;
    }
    
    .visit-history-table th,
    .visit-history-table td {
        padding: 8px 6px;
    }
}

/* ==================== UTILITY CLASSES ==================== */

.text-center {
    text-align: center;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}

/* ==================== FONTAWESOME ICON STYLING ==================== */

/* Section header icons */
.section-header h3 i {
    margin-right: 8px;
    color: #c37c4a;
}

/* Quick action icons */
.action-icon i {
    font-size: 32px;
    color: #c37c4a;
}

/* Alert icons */
.membership-alert i {
    margin-right: 6px;
}

/* Badge icons */
.membership-level-badge i,
.membership-status-badge i {
    margin-right: 4px;
}

/* Perks list icons */
.perks-list li i {
    margin-right: 8px;
    color: #4caf50;
}

/* Locker note icon */
.locker-note i {
    margin-right: 5px;
    color: #ff9800;
}

/* Paid badge icon */
.paid-badge i {
    margin-right: 4px;
}

/* Toast icons - already styled inline */
.toast-icon i {
    font-size: inherit;
}

/* ==================== TAB NAVIGATION ==================== */

/* DEFAULT (Website): Show all sections stacked, no tabs */
.club-dashboard-tabs {
    position: relative;
    padding-bottom: 30px; /* Normal padding on website */
}

.tab-content {
    display: block; /* All sections visible on website */
    animation: none; /* No animation on website */
}

.tab-content.active {
    display: block;
}

/* PWA MODE: Enable tabbed navigation */
.club-pwa-mode .club-dashboard-tabs {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
}

.club-pwa-mode .tab-content {
    display: none; /* Hide all tabs by default in PWA */
    animation: fadeIn 0.3s ease;
}

.club-pwa-mode .tab-content.active {
    display: block; /* Show only active tab in PWA */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Bottom Navigation Bar - HIDDEN on website, SHOWN in PWA */
.tab-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: white;
    border-top: 2px solid #f0f0f0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: none; /* Hidden on website by default */
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Show bottom nav ONLY in PWA mode */
.club-pwa-mode .tab-bottom-nav {
    display: flex; /* Visible in PWA */
}

/* Tab Navigation Buttons */
.tab-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 0;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #999;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tab-nav-btn i {
    font-size: 24px;
    transition: all 0.3s ease;
}

.tab-nav-btn span {
    font-size: 11px;
}

/* Active Tab Button */
.tab-nav-btn.active {
    color: #c37c4a;
    background: rgba(195, 124, 74, 0.1);
}

.tab-nav-btn.active i {
    transform: scale(1.1);
}

/* Tab Button Hover (Desktop) */
@media (hover: hover) {
    .tab-nav-btn:hover {
        color: #c37c4a;
        background: rgba(195, 124, 74, 0.05);
    }
}

/* Tab Button Press Effect (Mobile) */
.tab-nav-btn:active {
    transform: scale(0.95);
}

/* Adjust content padding for bottom nav */
.club-dashboard-tabs .tab-content {
    min-height: calc(100vh - 200px);
}

/* ==================== MOBILE OPTIMIZATIONS ==================== */

/* Landscape Mode */
@media (orientation: landscape) and (max-width: 900px) {
    .tab-bottom-nav {
        height: 55px;
    }
    
    .tab-nav-btn i {
        font-size: 20px;
    }
    
    .tab-nav-btn span {
        font-size: 10px;
    }
}

/* Small Mobile Devices */
@media (max-width: 360px) {
    .tab-bottom-nav {
        height: 60px;
    }
    
    .tab-nav-btn i {
        font-size: 20px;
    }
    
    .tab-nav-btn span {
        font-size: 10px;
    }
}

/* ==================== PWA STANDALONE MODE ==================== */

.club-pwa-standalone .tab-bottom-nav {
    padding-bottom: max(env(safe-area-inset-bottom, 0px), 8px);
}

.club-pwa-standalone .club-dashboard-tabs {
    padding-bottom: calc(80px + max(env(safe-area-inset-bottom, 0px), 8px));
}

/* ==================== WOOCOMMERCE COMPATIBILITY ==================== */

.woocommerce-MyAccount-content .club-member-dashboard {
    margin-top: 0;
}

.woocommerce-MyAccount-navigation-link--my-club-membership a:before {
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    content: '\f007'; /* fa-user */
    margin-right: 8px;
}
