/* Dashboard Styles */

.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 180px 20px 20px 20px; /* Top padding to account for fixed header */
    min-height: calc(100vh - 160px); /* Adjusted for fixed header height */
}

/* User Menu Styles */
.user-menu {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.3s;
    color: white;
}

.user-menu-trigger:hover {
    color: #dc2626;
}

.user-menu-trigger .person-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.user-menu-trigger .dropdown-arrow {
    width: 16px;
    height: 16px;
    fill: currentColor;
    transition: transform 0.3s;
}

.user-menu-trigger.open .dropdown-arrow {
    transform: rotate(180deg);
}

.user-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.user-menu-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: 6px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    min-width: 180px;
    z-index: 1002;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    padding: 8px 0;
    backdrop-filter: blur(10px);
    margin-top: 4px;
}

/* Remove hover-based dropdown opening - will be handled by JavaScript click */
.user-menu-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px 12px 38px;
    color: white;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border-radius: 4px;
    margin: 0 4px;
}

.user-menu-item:hover {
    background: rgba(220, 38, 38, 0.2);
}

.user-menu-item:active {
    background: rgba(220, 38, 38, 0.3);
}

.user-menu-item .menu-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Active navigation link styling */
.nav-links .active {
    /* Remove background and border-radius to match homepage nav style */
}

/* Loading and error states */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #dc2626;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.loading-message {
    margin-top: 20px;
    color: #666;
    font-style: italic;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    min-height: 24px;
}

.error-state {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.error-message {
    text-align: center;
    padding: 40px;
    border: 1px solid #dc2626;
    border-radius: 8px;
    background-color: #fef2f2;
    max-width: 500px;
}

.error-message h2 {
    color: #dc2626;
    margin-bottom: 10px;
}

.retry-btn {
    background: #dc2626;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 20px;
    transition: background-color 0.3s;
}

.retry-btn:hover {
    background: #b91c1c;
}

/* Dashboard content */
.dashboard-header {
    text-align: center;
    margin-bottom: 40px;
}

.dashboard-header h1 {
    color: #dc2626;
    margin-bottom: 10px;
}

.member-name {
    font-size: 1.2rem;
    color: #666;
}

/* Dashboard sections */
.dashboard-section {
    background: white;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.dashboard-section h2 {
    color: #dc2626;
    margin-bottom: 20px;
    border-bottom: 2px solid #dc2626;
    padding-bottom: 10px;
}

/* Membership card */
.membership-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    background: #f9fafb;
}

.membership-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-weight: bold;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
}

.status-badge.active {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.inactive {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.pending {
    background: #fef3c7;
    color: #92400e;
}

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

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.detail-item label {
    font-weight: bold;
    color: #374151;
}

.detail-item span {
    color: #6b7280;
}

/* Subscriptions */
.subscriptions-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.cancel-subscription-option {
    margin-top: 30px;
}

.subscription-cancel-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.subscription-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    background: #f9fafb;
}

.subscription-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.subscription-title {
    font-weight: bold;
    color: #374151;
}

.subscription-price {
    color: #dc2626;
    font-weight: bold;
}

.subscription-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.subscription-detail {
    display: flex;
    justify-content: space-between;
    color: #6b7280;
    font-size: 0.9rem;
}

/* Payment history */
.payment-history-controls {
    display: flex;
    justify-content: between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.history-filter {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: white;
}

.download-btn {
    background: #dc2626;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-left: auto;
}

.download-btn:hover {
    background: #b91c1c;
}

.payment-history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.payment-history-table th,
.payment-history-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.payment-history-table th {
    background: #f9fafb;
    font-weight: bold;
    color: #374151;
}

.payment-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.payment-status.completed {
    background: #d1fae5;
    color: #065f46;
}

.payment-status.pending {
    background: #fef3c7;
    color: #92400e;
}

.payment-status.failed {
    background: #fee2e2;
    color: #991b1b;
}

.download-receipt-btn {
    background: #dc2626;
    color: white;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.download-receipt-btn:hover {
    background: #b91c1c;
    color: white;
    text-decoration: none;
}

/* No data states */
.no-data {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

.subscribe-btn {
    display: inline-block;
    background: #dc2626;
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 4px;
    margin-top: 15px;
    transition: background-color 0.3s;
}

.subscribe-btn:hover {
    background: #b91c1c;
}

/* No subscriptions card */
.no-subscriptions-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 30px;
    background: #f9fafb;
}

.subscription-info {
    text-align: center;
    margin-bottom: 30px;
}

.subscription-info h3 {
    color: #dc2626;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.subscription-info p {
    color: #6b7280;
    font-size: 0.95rem;
}

.subscription-card {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 25px;
    background: white;
}

.subscription-header {
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
}

.subscription-header h4 {
    color: #dc2626;
    margin-bottom: 10px;
    margin-top: 0;
    font-size: 1.1rem;
    display: block;
    width: 100%;
    order: 1;
}

.subscription-header p {
    color: #6b7280;
    margin-bottom: 0;
    margin-top: 0;
    font-size: 0.9rem;
    display: block;
    width: 100%;
    order: 2;
}

.subscription-agreements {
    margin-bottom: 25px;
}

.agreement-links {
    margin-bottom: 15px;
}

.agreement-links a {
    color: #dc2626;
    text-decoration: none;
}

.agreement-links a:hover {
    text-decoration: underline;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #374151;
}

.agreement-checkbox {
    width: 16px;
    height: 16px;
}

.subscription-submit {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
}

.subscribe-button {
    background: #dc2626;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.subscribe-button:enabled:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

.subscribe-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* Responsive design */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 100px 10px 10px 10px;
    }

    .header .container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .header .nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .dashboard-section {
        padding: 20px;
    }

    .membership-details {
        grid-template-columns: 1fr;
    }

    .subscriptions-container {
        grid-template-columns: 1fr;
    }

    .payment-history-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .download-btn {
        margin-left: 0;
    }

    .payment-history-table {
        font-size: 0.85rem;
        display: block;
        overflow-x: auto;
    }

    .payment-history-table thead,
    .payment-history-table tbody,
    .payment-history-table tr {
        display: table;
        width: 100%;
        table-layout: fixed;
    }

    .payment-history-table th,
    .payment-history-table td {
        padding: 8px 4px;
    }

    /* Hide status column on mobile */
    .payment-history-table th:nth-child(3),
    .payment-history-table td:nth-child(3) {
        display: none;
    }

    /* Adjust column widths for mobile */
    .payment-history-table th:nth-child(1),
    .payment-history-table td:nth-child(1) {
        width: 25%;
    }

    .payment-history-table th:nth-child(2),
    .payment-history-table td:nth-child(2) {
        width: 20%;
    }

    .payment-history-table th:nth-child(4),
    .payment-history-table td:nth-child(4) {
        width: 35%;
    }

    .payment-history-table th:nth-child(5),
    .payment-history-table td:nth-child(5) {
        width: 20%;
        text-align: center;
    }

    /* Remove button styling and show only icon */
    .download-receipt-btn {
        background: transparent;
        border: none;
        padding: 4px;
        font-size: 0;
        min-width: auto;
        border-radius: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .download-receipt-btn:hover {
        background: transparent;
        opacity: 0.7;
    }

    .download-receipt-btn::before {
        content: '';
        display: block;
        width: 20px;
        height: 20px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23dc2626'%3E%3Cpath d='M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z'/%3E%3C/svg%3E");
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
    }
}
/* Manage My Data Section */
.manage-data-section {
    /* Additional spacing, styling inherited from .dashboard-section */
}

.data-option {
    margin-bottom: 30px;
    padding: 25px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #fafafa;
}

.data-option h3 {
    color: #374151;
    margin: 0 0 10px 0;
    font-size: 1.3rem;
}

.data-option p {
    color: #6b7280;
    margin-bottom: 15px;
    line-height: 1.6;
}

.data-option.danger-option {
    border-color: #dc2626;
    background: #fef2f2;
}

.data-option.danger-option h3 {
    color: #dc2626;
}

.confirmation-area {
    margin: 15px 0;
    padding: 15px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-label span {
    color: #856404;
    font-weight: 500;
    line-height: 1.5;
}

.btn-action {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #ff9800;
    color: white;
}

.btn-action:hover:not(:disabled) {
    background: #f57c00;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 152, 0, 0.3);
}

.btn-action.btn-disabled {
    background: #9ca3af;
    color: #d1d5db;
    cursor: not-allowed;
}

.btn-action.btn-danger {
    background: #dc2626;
    color: white;
}

.btn-action.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.3);
}

.btn-warning,
.btn-danger {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-warning {
    background: #ff9800;
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background: #f57c00;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 152, 0, 0.3);
}

.btn-danger {
    background: #dc2626;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.3);
}

.btn-warning:disabled,
.btn-danger:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Responsive */
@media (max-width: 768px) {
    .manage-data-section {
        padding: 20px;
    }

    .data-option {
        padding: 20px;
    }

    .data-option h3 {
        font-size: 1.1rem;
    }
}
