/**
 * User Dashboard Styles
 * Complete styling for user contribution management
 */

/* ===== DASHBOARD CONTAINER ===== */
.user-dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* ===== DASHBOARD HEADER ===== */
.dashboard-header {
    margin-bottom: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(45, 55, 72, 0.95), rgba(74, 85, 104, 0.85));
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.dashboard-user-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid rgba(255, 215, 0, 0.5);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.dashboard-user-info h1 {
    margin: 0;
    font-size: 2rem;
    color: #FFD700;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.dashboard-user-name {
    margin: 0.5rem 0 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
}

/* ===== DASHBOARD STATS ===== */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(255, 215, 0, 0.2);
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 215, 0, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(255, 215, 0, 0.2);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #FFD700;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== DASHBOARD CONTROLS ===== */
.dashboard-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.dashboard-filters {
    display: flex;
    gap: 1rem;
    flex: 1;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.filter-select:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 215, 0, 0.5);
}

.filter-select:focus {
    outline: none;
    border-color: #FFD700;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

.filter-select option {
    background: #1a202c;
    color: #fff;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.search-input:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 215, 0, 0.5);
}

.search-input:focus {
    outline: none;
    border-color: #FFD700;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

.btn-primary {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #1a202c;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 215, 0, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.5);
    background: transparent;
    color: #FFD700;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: #FFD700;
}

/* ===== ENTITIES LIST ===== */
.entities-list {
    min-height: 400px;
}

.entity-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
}

/* Tablet: 3 columns */
@media (max-width: 1200px) {
    .entity-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablet portrait: 2 columns */
@media (max-width: 900px) {
    .entity-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== ENTITY PANEL ===== */
.entity-panel {
    background: linear-gradient(135deg, rgba(45, 55, 72, 0.9), rgba(74, 85, 104, 0.8));
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 215, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.entity-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, #FFD700, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.entity-panel:hover {
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    transform: translateY(-4px);
}

.entity-panel:hover::before {
    opacity: 1;
}

.entity-panel.deleted {
    opacity: 0.6;
    background: linear-gradient(135deg, rgba(45, 55, 72, 0.6), rgba(74, 85, 104, 0.5));
}

.deleted-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.entity-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 1rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.entity-name {
    margin: 0 0 1rem;
    font-size: 1.5rem;
    color: #FFD700;
    text-align: center;
}

.entity-meta {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.entity-tag {
    padding: 0.25rem 0.75rem;
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    font-size: 0.8rem;
    color: rgba(255, 215, 0, 0.9);
    text-transform: capitalize;
}

.entity-description {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.entity-dates {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin: 1rem 0;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 215, 0, 0.2);
}

.entity-dates small {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
}

/* ===== PANEL ACTIONS ===== */
.panel-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.panel-action-btn {
    flex: 1;
    min-width: 80px;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    background: rgba(255, 215, 0, 0.1);
    color: #FFD700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.panel-action-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: #FFD700;
    transform: translateY(-1px);
}

.panel-action-btn.danger {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.panel-action-btn.danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

/* ===== EMPTY STATES ===== */
.empty-state,
.empty-container {
    text-align: center;
    padding: 4rem 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 2px dashed rgba(255, 215, 0, 0.3);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.empty-state h2,
.empty-container h2 {
    color: #FFD700;
    margin: 0 0 1rem;
}

.empty-message {
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 2rem;
}

/* ===== LOADING STATE ===== */
.loading {
    text-align: center;
    padding: 4rem 2rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
}

.loading::after {
    content: '...';
    display: inline-block;
    animation: loading-dots 1.5s infinite;
}

@keyframes loading-dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* ===== FORM OVERLAY ===== */
.form-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 2rem;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.entity-form-container {
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .entity-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .user-dashboard {
        padding: 1rem;
    }

    .dashboard-header {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }

    .dashboard-user-info {
        flex-direction: column;
        text-align: center;
    }

    .dashboard-user-info h1 {
        font-size: 1.5rem;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

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

    .dashboard-filters {
        flex-direction: column;
    }

    .filter-select,
    .search-input {
        width: 100%;
    }

    .btn-primary {
        width: 100%;
        justify-content: center;
    }

    .entity-grid {
        grid-template-columns: 1fr;
    }

    .panel-actions {
        flex-direction: column;
    }

    .panel-action-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .dashboard-avatar {
        width: 60px;
        height: 60px;
    }

    .stat-value {
        font-size: 2rem;
    }

    .entity-icon {
        font-size: 2.5rem;
    }

    .entity-name {
        font-size: 1.25rem;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible for keyboard navigation */
.filter-select:focus-visible,
.search-input:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.panel-action-btn:focus-visible {
    outline: 2px solid #FFD700;
    outline-offset: 2px;
}

/* High contrast support */
@media (prefers-contrast: high) {
    .entity-panel {
        border-width: 2px;
    }

    .stat-card {
        border-width: 2px;
    }

    .entity-tag {
        border-width: 2px;
    }
}

/* ===== DARK MODE ADJUSTMENTS ===== */
[data-theme="dark"] .user-dashboard {
    /* Already dark by default */
}

[data-theme="light"] .user-dashboard {
    background: #f7fafc;
}

[data-theme="light"] .dashboard-header {
    background: linear-gradient(135deg, #fff, #f7fafc);
    border: 1px solid #e2e8f0;
}

[data-theme="light"] .dashboard-user-info h1 {
    color: #2d3748;
}

[data-theme="light"] .dashboard-user-name {
    color: #4a5568;
}

[data-theme="light"] .stat-card {
    background: #fff;
    border-color: #e2e8f0;
}

[data-theme="light"] .stat-value {
    color: #2d3748;
}

[data-theme="light"] .stat-label {
    color: #718096;
}

[data-theme="light"] .filter-select,
[data-theme="light"] .search-input {
    background: #fff;
    border-color: #cbd5e0;
    color: #2d3748;
}

[data-theme="light"] .entity-panel {
    background: #fff;
    border-color: #e2e8f0;
}

[data-theme="light"] .entity-name {
    color: #2d3748;
}

[data-theme="light"] .entity-description {
    color: #4a5568;
}

[data-theme="light"] .entity-tag {
    background: #edf2f7;
    border-color: #cbd5e0;
    color: #2d3748;
}

[data-theme="light"] .panel-action-btn {
    background: #edf2f7;
    border-color: #cbd5e0;
    color: #2d3748;
}

[data-theme="light"] .empty-state,
[data-theme="light"] .empty-container {
    background: #f7fafc;
    border-color: #cbd5e0;
}
