/* ============================================
   Member Dashboard - CSS Styling
   ============================================ */

/* Dashboard Container */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    padding-top: 60px;
}

/* Sidebar */
.dashboard-sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 60px;
    left: 0;
    height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.sidebar-user-info h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.sidebar-status {
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    display: inline-block;
}

.sidebar-status.active {
    background: rgba(0, 204, 102, 0.15);
    color: var(--accent-green);
}

.sidebar-status.inactive {
    background: rgba(255, 68, 68, 0.15);
    color: var(--accent-red);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 2rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: rgba(0, 170, 255, 0.1);
    color: var(--accent-blue);
    border-left-color: var(--accent-blue);
}

.sidebar-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
}

.sidebar-support {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-green);
    font-size: 0.9rem;
    font-weight: 500;
}

.sidebar-support:hover {
    color: var(--accent-green);
    text-decoration: underline;
}

/* Main Content */
.dashboard-main {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
    min-height: calc(100vh - 60px);
}

/* Dashboard Sections */
.dashboard-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.dashboard-section.active {
    display: block;
}

/* Section Header */
.section-header {
    margin-bottom: 2rem;
}

.section-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.subscription-icon {
    background: rgba(138, 43, 226, 0.15);
}

.referral-icon {
    background: rgba(0, 170, 255, 0.15);
}

.earnings-icon {
    background: rgba(0, 204, 102, 0.15);
}

.pending-icon {
    background: rgba(255, 204, 0, 0.15);
}

.stat-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.stat-content p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Quick Actions */
.quick-actions {
    margin-bottom: 2rem;
}

.quick-actions h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.action-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.action-card:hover {
    border-color: var(--accent-blue);
    background: rgba(0, 170, 255, 0.05);
    transform: translateY(-2px);
}

.action-icon {
    font-size: 1.5rem;
}

.action-text {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Subscription Card */
.subscription-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.subscription-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    margin-bottom: 1.5rem;
    background: rgba(255, 68, 68, 0.15);
    color: var(--accent-red);
}

.subscription-status-badge.active {
    background: rgba(0, 204, 102, 0.15);
    color: var(--accent-green);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.subscription-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.subscription-detail-item {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
}

.detail-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.detail-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.subscription-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Perks Card */
.perks-card {
    background: linear-gradient(135deg, rgba(0, 170, 255, 0.1), rgba(138, 43, 226, 0.1));
    border: 1px solid rgba(0, 170, 255, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
}

.perks-card h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.perks-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.75rem;
}

.perks-list li {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Affiliate Section */
.affiliate-status-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.affiliate-status-card.active {
    border-color: var(--accent-green);
    background: linear-gradient(135deg, rgba(0, 204, 102, 0.05), rgba(0, 170, 255, 0.05));
}

.affiliate-status-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.affiliate-icon {
    font-size: 2.5rem;
}

.affiliate-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.affiliate-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Referral Section */
.referral-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.referral-section h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.referral-link-box {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.referral-link-input {
    flex: 1;
    padding: 0.9rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.copy-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 1.25rem;
    background: var(--gradient-blue);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 170, 255, 0.3);
}

.referral-hint {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

/* Share Buttons */
.share-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.share-btn:hover {
    transform: translateY(-1px);
}

.share-btn.whatsapp:hover {
    border-color: #25D366;
    background: rgba(37, 211, 102, 0.1);
}

.share-btn.telegram:hover {
    border-color: #0088cc;
    background: rgba(0, 136, 204, 0.1);
}

.share-btn.twitter:hover {
    border-color: #1DA1F2;
    background: rgba(29, 161, 242, 0.1);
}

/* Affiliate Stats Grid */
.affiliate-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.affiliate-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
}

.affiliate-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: 0.25rem;
}

.affiliate-stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Commission Structure */
.commission-structure {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
}

.commission-structure h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.commission-table {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.commission-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

.commission-row.header {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-weight: 600;
}

.commission-row:not(.header) {
    color: var(--text-primary);
}

.commission-value {
    color: var(--accent-green);
    font-weight: 600;
}

/* Marketing Materials */
.marketing-materials {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.marketing-materials h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.materials-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.materials-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(0, 136, 204, 0.15), rgba(0, 136, 204, 0.05));
    border: 1px solid rgba(0, 136, 204, 0.3);
    border-radius: 12px;
    margin-bottom: 1rem;
}

.materials-icon {
    font-size: 2.5rem;
}

.materials-info {
    flex: 1;
}

.materials-info h4 {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.materials-info p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.btn-telegram {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #0088cc, #0066aa);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-telegram:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 136, 204, 0.4);
}

.materials-tips {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(255, 204, 0, 0.1);
    border: 1px solid rgba(255, 204, 0, 0.2);
    border-radius: 10px;
}

.tips-icon {
    font-size: 1.25rem;
}

.materials-tips p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
}

.materials-tips strong {
    color: var(--accent-yellow);
}

@media (max-width: 768px) {
    .materials-card {
        flex-direction: column;
        text-align: center;
    }

    .materials-info {
        text-align: center;
    }

    .btn-telegram {
        width: 100%;
        justify-content: center;
    }
}

/* Earnings Section */
.earnings-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.earnings-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
}

.earnings-card.total {
    border-color: var(--accent-blue);
    background: linear-gradient(135deg, rgba(0, 170, 255, 0.1), rgba(0, 170, 255, 0.05));
}

.earnings-card.pending {
    border-color: var(--accent-yellow);
    background: linear-gradient(135deg, rgba(255, 204, 0, 0.1), rgba(255, 204, 0, 0.05));
}

.earnings-card.paid {
    border-color: var(--accent-green);
    background: linear-gradient(135deg, rgba(0, 204, 102, 0.1), rgba(0, 204, 102, 0.05));
}

.earnings-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.earnings-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Payout Section */
.payout-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.payout-section h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.payout-info {
    margin-bottom: 1rem;
}

.payout-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.payout-hint {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.75rem;
    transition: color 0.3s ease;
}

/* WhatsApp Confirmation Button for Payout */
.btn-whatsapp-confirm {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.9rem 1.5rem;
    background: linear-gradient(135deg, #25D366, #128C7E);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 2rem;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.5);
    background: linear-gradient(135deg, #2EE372, #25D366);
}

.btn-whatsapp-confirm .wa-icon {
    font-size: 1.2rem;
}

/* Payout Section Button Container */
.payout-section .btn {
    margin-right: 0.5rem;
}

@media (max-width: 768px) {
    .payout-section {
        text-align: center;
    }

    .payout-section .btn-primary {
        width: 100%;
    }

    .payout-section .payout-hint {
        margin-top: 1rem;
        margin-bottom: 0;
    }

    .btn-whatsapp-confirm {
        width: 100%;
        margin-left: 0;
        margin-top: 1.5rem;
    }
}

/* Earnings History */
.earnings-history {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
}

.earnings-history h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.history-table {
    min-height: 100px;
}

.history-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.history-empty span {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* Settings Cards */
.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.settings-card h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
}

.settings-card.danger-zone {
    border-color: rgba(255, 68, 68, 0.3);
}

.settings-card.danger-zone p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.9rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(0, 170, 255, 0.15);
}

.form-group small {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* Danger Button */
.btn-danger {
    background: rgba(255, 68, 68, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(255, 68, 68, 0.3);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: var(--accent-red);
    color: white;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 10, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.loading-overlay p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Mobile Logout Button */
.mobile-logout {
    width: calc(100% - 4rem);
    margin: 1rem 2rem;
    padding: 0.75rem;
    background: rgba(255, 68, 68, 0.15);
    border: 1px solid rgba(255, 68, 68, 0.3);
    border-radius: 8px;
    color: var(--accent-red);
    font-weight: 600;
    cursor: pointer;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .dashboard-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .dashboard-sidebar.active {
        transform: translateX(0);
    }

    .dashboard-main {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }

    .dashboard-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
        transform: none;
        display: none;
    }

    .dashboard-main {
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .actions-grid {
        grid-template-columns: 1fr;
    }

    .subscription-details {
        grid-template-columns: 1fr;
    }

    .subscription-actions {
        flex-direction: column;
    }

    .subscription-actions .btn {
        width: 100%;
        text-align: center;
    }

    .referral-link-box {
        flex-direction: column;
    }

    .share-buttons {
        justify-content: center;
    }

    .earnings-summary {
        grid-template-columns: 1fr;
    }

    .commission-row {
        font-size: 0.8rem;
        padding: 0.6rem 0.75rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .affiliate-stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .section-header h1 {
        font-size: 1.4rem;
    }
}