/**
 * Koinonikos User Dashboard Styles
 * Équivalent CSS du design Tailwind du dashboard React
 */

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

/* Dashboard Header */
.dashboard-header {
    background: linear-gradient(135deg, #447cbf 0%, #336eb6 100%);
    color: white!important;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.dashboard-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #FFF!important;
}

.dashboard-header p {
    opacity: 0.9;
    margin-bottom: 20px;
}

.dashboard-stats {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    display: block;
}

.stat-label {
    font-size: 14px;
    opacity: 0.8;
    margin-top: 4px;
}

/* Tabs Navigation */
.dashboard-tabs {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.tab-nav {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.tab-button {
    flex: 1;
    padding: 16px 20px;
    background: none;
    border: none;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
}

.tab-button i {
    font-size: 16px;
}

.tab-button:hover {
    background: #e2e8f0;
    color: #334155;
}

.tab-button.active {
    background: white;
    color: #447cbf;
    border-bottom: 2px solid #447cbf;
}

.tab-button.logout {
    color: #dc2626;
    border-left: 1px solid #e2e8f0;
}

.tab-button.logout:hover {
    background: #fef2f2;
    color: #b91c1c;
}

/* Tab Content */
.tab-content {
    padding: 30px 30px 50px 30px;
}

.tab-pane {
    display: none;
}

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

/* Donations Summary */
.donations-summary {
    margin-bottom: 30px;
}

.summary-card {
    background: #f8fafc;
    padding: 24px;
    border-radius: 8px;
    border-left: 4px solid #447cbf;
}

.summary-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1e293b;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.summary-item {
    text-align: center;
}

.summary-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
}

.summary-label {
    display: block;
    font-size: 14px;
    color: #64748b;
    margin-top: 4px;
}

/* Donations List */
.donations-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.donation-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    transition: all 0.2s;
}

.donation-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.donation-info h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1e293b;
}

.donation-details {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: #64748b;
}

.donation-amount {
    font-size: 18px;
    font-weight: 700;
    color: #059669;
}

.donation-actions {
    display: flex;
    gap: 8px;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    margin-bottom: 8px;
}

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

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

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

.status-refunded {
    background: #e0e7ff;
    color: #3730a3;
}

/* Forms */
.address-form-container,
.account-settings-container {
    width: 100%;
}

.address-card,
.account-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 24px;
    overflow: hidden;
}

.card-header {
    padding: 24px 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.card-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1e293b;
}

.card-header p {
    color: #64748b;
    margin-bottom: 16px;
}

.address-form,
.account-form {
    padding: 0 24px 24px;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    color: #1e293b;
    font-size: 16px;
}

.form-group input {
    width: 100%;
    padding: 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    background: #efefef;
    transition: all 0.2s;
    min-height: 60px;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input[readonly] {
    background: #f9fafb;
    cursor: not-allowed;
}

.password-input {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    font-size: 14px;
}

.btn-primary {
    background: #447cbf;
    color: white;
    border-color: #336eb6;
}

.btn-primary:hover {
    background: #447cbf;
    border-color: #336eb6;
}

.btn-secondary {
    background: #6b7280;
    color: white;
    border-color: #6b7280;
}

.btn-secondary:hover {
    background: #4b5563;
    border-color: #4b5563;
}

.btn-outline {
    background: white;
    color: #374151;
    border-color: #d1d5db;
    width: 32px;
    height: 32px;
    padding: 0;
}

.btn-outline:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

/* Security Tips */
.security-tips {
    background: #f0f9ff;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #0ea5e9;
    margin-top: 20px;
}

.security-tips h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #0c4a6e;
}

/* Loading States */
.btn.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn.loading:after {
    content: "";
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .koinonikos-dashboard {
        padding: 16px;
    }
    
    .dashboard-stats {
        flex-direction: column;
        gap: 16px;
    }
    
    .tab-nav {
        flex-wrap: wrap;
    }
    
    .donation-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .donation-actions {
        align-self: flex-end;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .summary-stats {
        grid-template-columns: 1fr;
    }
}