/* Donor Dashboard Styles */

.donor-dashboard-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    padding: 20px;
}

/* Header Section */
.dashboard-header {
    background: linear-gradient(135deg, #C445B4 0%, #8B2F7F 100%);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.donor-profile {
    display: flex;
    align-items: center;
    gap: 24px;
}

.donor-avatar {
    flex-shrink: 0;
}

.donor-avatar img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.donor-info {
    flex: 1;
}

.donor-name {
    color: #ffffff;
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 12px 0;
}

.donor-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.4;
}

.meta-item svg {
    opacity: 0.8;
    flex-shrink: 0;
}

/* Navigation Tabs */
.dashboard-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid #e5e7eb;
}

.nav-tab {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: #6b7280;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: -2px;
    height: 50px;
    line-height: 18px;
}

.nav-tab:hover {
    color: #374151;
    background: #f9fafb;
}

.nav-tab.active {
    color: #C445B4;
    border-bottom-color: #C445B4;
}

.nav-tab svg {
    opacity: 0.7;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-bottom: 1px;
}

/* Content Area */
.dashboard-content {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 32px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 20px 0;
    line-height: 1.4;
}

.section-title svg {
    color: #C445B4;
    flex-shrink: 0;
}

/* Stats Grid */
.stats-section {
    margin-bottom: 40px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

/* Currency Breakdown */
.currency-breakdown {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 2px solid #e5e7eb;
}

.breakdown-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 16px 0;
}

.currency-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.currency-stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.currency-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #C445B4;
}

.currency-flag {
    font-size: 48px;
    line-height: 1;
    flex-shrink: 0;
}

.currency-details {
    flex: 1;
}

.currency-amount {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.currency-count {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 2px;
}

.currency-avg {
    font-size: 13px;
    color: #9ca3af;
}

.stat-card {
    background: #f9fafb;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stat-card.highlight {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border-color: #22c55e;
}

.stat-card.highlight .stat-value,
.stat-card.highlight .stat-label {
    color: #ffffff;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: #22c55e;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Donations Table */
.recent-donations-section,
.subscriptions-section {
    margin-bottom: 40px;
}

.donations-table {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.donations-table table {
    width: 100%;
    border-collapse: collapse;
}

.donations-table thead {
    background: #f9fafb;
}

.donations-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e5e7eb;
}

.donations-table td {
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
}

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

.donations-table tr:hover {
    background: #f9fafb;
}

.order-id,
.time {
    font-size: 13px;
    color: #9ca3af;
    margin-top: 4px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-left: 8px;
}

.badge-recurring {
    background: #dcfce7;
    color: #166534;
}

.badge-renewal {
    background: #dbeafe;
    color: #1e40af;
}

.badge-onetime {
    background: #f3f4f6;
    color: #4b5563;
}

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

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.status-completed {
    background: #dcfce7;
    color: #166534;
}

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

.status-badge.status-processing {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge.status-failed,
.status-badge.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.view-receipt {
    display: block;
    margin-top: 6px;
    color: #C445B4;
    font-size: 13px;
    text-decoration: none;
    font-weight: 500;
}

.view-receipt:hover {
    color: #8B2F7F;
}

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

.subscription-card {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.subscription-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    border-color: #C445B4;
}

.subscription-card.status-active {
    border-color: #22c55e;
    background: #f0fdf4;
}

.subscription-card.status-cancelled {
    border-color: #ef4444;
    background: #fef2f2;
    opacity: 0.7;
}

.subscription-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.subscription-amount {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.subscription-amount .currency-symbol {
    font-size: 20px;
    opacity: 0.8;
}

.subscription-amount .currency-code {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
    margin-left: 4px;
}

.subscription-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.subscription-status.status-active {
    background: #dcfce7;
    color: #166534;
}

.subscription-status.status-paused {
    background: #fef3c7;
    color: #92400e;
}

.subscription-status.status-cancelled,
.subscription-status.status-expired {
    background: #fee2e2;
    color: #991b1b;
}

.subscription-details {
    margin-bottom: 16px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.detail-label {
    color: #6b7280;
    font-weight: 500;
}

.detail-value {
    color: #1a1a1a;
    font-weight: 600;
}

.subscription-actions {
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.btn-cancel-subscription {
    width: 100%;
    padding: 10px 16px;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel-subscription:hover {
    background: #fecaca;
}

/* Profile Form */
.profile-form {
    max-width: 600px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #C445B4;
    box-shadow: 0 0 0 3px rgba(196, 69, 180, 0.1);
}

.form-actions {
    margin-top: 24px;
}

.btn-primary {
    padding: 12px 32px;
    background: linear-gradient(135deg, #C445B4 0%, #8B2F7F 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(196, 69, 180, 0.3);
}

.profile-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
}

.profile-message.success {
    background: #dcfce7;
    color: #166534;
}

.profile-message.error {
    background: #fee2e2;
    color: #991b1b;
}

/* Login Message */
.donor-dashboard-login {
    max-width: 600px;
    margin: 40px auto;
    padding: 32px;
    background: #f9fafb;
    border-radius: 12px;
    text-align: center;
}

.donor-dashboard-login p {
    font-size: 16px;
    color: #4b5563;
}

.donor-dashboard-login a {
    color: #C445B4;
    font-weight: 600;
    text-decoration: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .donor-dashboard-wrapper {
        padding: 16px;
    }
    
    .dashboard-header {
        padding: 24px 20px;
    }
    
    .donor-profile {
        flex-direction: column;
        text-align: center;
    }
    
    .donor-name {
        font-size: 24px;
    }
    
    .donor-meta {
        justify-content: center;
    }
    
    .dashboard-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-tab {
        flex-shrink: 0;
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .dashboard-content {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .currency-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .currency-flag {
        font-size: 40px;
    }
    
    .currency-amount {
        font-size: 20px;
    }
    
    .donations-table {
        overflow-x: auto;
    }
    
    .donations-table table {
        min-width: 600px;
    }
    
    .subscriptions-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .donor-avatar img {
        width: 100px;
        height: 100px;
    }
    
    .donor-name {
        font-size: 20px;
    }
    
    .stat-value {
        font-size: 28px;
    }
}