/* ========================================
   USER DASHBOARD CSS
   Dashboard per utenti normali u-prompt
   Stile Amazon-like coerente con main.css
   ======================================== */



/* ========================================
   3. DASHBOARD MAIN CONTENT
   ======================================== */
.dashboard-main {
    flex: 1 !important;
    padding: 30px !important;
    background: transparent !important;
    min-width: 0 !important;
}

/* Ensure all dashboard content is visible */
.dashboard-header,
.dashboard-stats,
.dashboard-recent,
.dashboard-prompts {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Dashboard Header */
.dashboard-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gray-200);
}

.dashboard-header h1 {
    font-size: 24px;
    color: var(--gray-900);
    font-weight: 400;
    margin-bottom: 8px;
}

.dashboard-subtitle {
    font-size: 14px;
    color: var(--gray-600);
    margin: 0;
}

/* ========================================
   4. DASHBOARD STATS CARDS
   ======================================== */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: box-shadow 0.2s, transform 0.2s;
}

.stat-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: #fff3e0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon i {
    font-size: 20px;
    color: var(--uprompt-orange);
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 2px;
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--gray-600);
    font-weight: 400;
}

/* ========================================
   5. DASHBOARD SECTIONS
   ======================================== */
.dashboard-section {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    margin-bottom: 30px;
    overflow: hidden;
}

.dashboard-section-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--gray-200);
    background: #f8f9fa;
}

.dashboard-section-header h2 {
    font-size: 18px;
    color: var(--gray-900);
    margin: 0;
    font-weight: 500;
}

.dashboard-section-content {
    padding: 25px;
}

/* ========================================
   6. QUICK ACTIONS
   ======================================== */
.dashboard-recent {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    padding: 25px;
    margin-bottom: 30px;
}

.dashboard-recent h2 {
    font-size: 18px;
    color: var(--gray-900);
    margin: 0 0 20px 0;
    font-weight: 500;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
}

.action-card {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: 6px;
    padding: 20px;
    text-align: center;
    text-decoration: none;
    color: var(--gray-700);
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: var(--uprompt-orange);
    transition: left 0.3s;
}

.action-card:hover::before {
    left: 0;
}

.action-card:hover {
    border-color: var(--uprompt-orange);
    color: var(--uprompt-orange);
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.action-card i {
    font-size: 24px;
    margin-bottom: 10px;
    display: block;
    color: inherit;
}

.action-card span {
    font-size: 14px;
    font-weight: 500;
    display: block;
}

/* ========================================
   7. PROMPTS SECTION
   ======================================== */
.dashboard-prompts {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    padding: 25px;
    margin-bottom: 30px;
}

.dashboard-prompts h2 {
    font-size: 18px;
    color: var(--gray-900);
    margin: 0 0 20px 0;
    font-weight: 500;
}

.prompt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

/* Placeholder per quando non ci sono prompts */
.prompt-card-placeholder {
    background: #f8f9fa;
    border: 2px dashed var(--gray-200);
    border-radius: 6px;
    padding: 40px 20px;
    text-align: center;
    color: var(--gray-600);
    grid-column: 1 / -1; /* Prende tutta la larghezza */
}

.placeholder-icon {
    font-size: 36px;
    color: var(--gray-400);
    margin-bottom: 15px;
}

.prompt-card-placeholder p {
    margin: 0;
    font-size: 14px;
}

/* ========================================
   8. ALERT STYLES (per debug)
   ======================================== */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-info {
    background: #e7f3ff;
    border-color: #b3d7ff;
    color: #004085;
}

.alert i {
    font-size: 16px;
}

/* ========================================
   9. MOBILE MENU TOGGLE
   ======================================== */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 110px; /* Sotto header + nav */
    left: 15px;
    z-index: 1000;
    width: 40px;
    height: 40px;
    background: var(--uprompt-orange);
    color: var(--white);
    border: none;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    cursor: pointer;
    font-size: 16px;
    transition: transform 0.2s;
}

.mobile-menu-toggle:hover {
    transform: scale(1.05);
}

.mobile-menu-toggle.active {
    background: var(--gray-700);
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

/* ========================================
   10. RESPONSIVE DESIGN
   ======================================== */

/* Tablet Portrait */
@media (max-width: 1024px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-main {
        padding: 25px;
    }
}

/* Tablet Landscape & Mobile */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .user-sidebar {
        position: fixed;
        left: -240px;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: 4px 0 12px rgba(0,0,0,0.15);
        height: 100vh;
        top: 0;
    }
    
    .user-sidebar.active {
        left: 0;
    }
    
    .dashboard-container {
        flex-direction: column;
    }
    
    .dashboard-main {
        margin-left: 0;
        padding: 20px 60px 20px 20px; /* Spazio per menu toggle */
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .action-card {
        padding: 15px 10px;
    }
    
    .action-card i {
        font-size: 20px;
        margin-bottom: 8px;
    }
    
    .action-card span {
        font-size: 12px;
    }
    
    .dashboard-section-content,
    .dashboard-recent,
    .dashboard-prompts {
        padding: 20px;
    }
    
    .prompt-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile Portrait */
@media (max-width: 480px) {
    .dashboard-main {
        padding: 15px 50px 15px 15px;
    }
    
    .dashboard-header h1 {
        font-size: 20px;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
    }
    
    .stat-icon i {
        font-size: 18px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .action-card {
        padding: 20px;
    }
    
    .user-profile-card {
        padding: 20px 15px;
    }
    
    .user-avatar {
        width: 60px;
        height: 60px;
    }
    
    .user-name {
        font-size: 15px;
    }
    
    .user-nav-item {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    .user-nav-item i {
        width: 16px;
        font-size: 13px;
    }
}

/* Large Mobile Landscape */
@media (max-width: 640px) and (orientation: landscape) {
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quick-actions {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ========================================
   11. ANIMATIONS & TRANSITIONS
   ======================================== */
@keyframes pulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.7; 
        transform: scale(1.02);
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* Animazioni al caricamento */
.stat-card {
    animation: fadeInUp 0.6s ease forwards;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

.action-card {
    animation: slideInFromLeft 0.6s ease forwards;
}

.action-card:nth-child(1) { animation-delay: 0.1s; }
.action-card:nth-child(2) { animation-delay: 0.2s; }
.action-card:nth-child(3) { animation-delay: 0.3s; }
.action-card:nth-child(4) { animation-delay: 0.4s; }

/* ========================================
   12. DARK MODE SUPPORT (opzionale)
   ======================================== */
@media (prefers-color-scheme: dark) {
    /* Opzionale: aggiungere supporto dark mode se necessario */
}

/* ========================================
   13. PRINT STYLES
   ======================================== */
@media print {
    .user-sidebar,
    .mobile-menu-toggle,
    .action-card {
        display: none !important;
    }
    
    .dashboard-main {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .stat-card,
    .dashboard-section {
        break-inside: avoid;
    }
}