/* ==========================================================================
   Dashboard Page Specific Styles - Enhanced UI/UX 2025
   ========================================================================== */

/* CSS Variables for theming (extends design-system.css) */
:root {
    --bg-primary: var(--color-bg-white);
    --bg-secondary: var(--color-bg-light);
    --text-primary: var(--color-text-dark);
    --text-secondary: var(--color-text-light);
    --border-color: var(--color-border-light);
}

/* Dark mode support (optional) */
[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border-color: #404040;
}

.dashboard-page {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: var(--text-primary);
    transition: background-color 0.3s, color 0.3s;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-accent);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gradient-accent);
}

/* Main Layout
   ========================================================================== */

.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

.dashboard-main {
    flex-grow: 1;
    padding: 1rem 2rem 2rem 2rem;
    width: 100%;
    max-width: 1200px;
    margin: 90px auto 0 auto;
    transition: all 0.3s ease-in-out;
    min-height: calc(100vh - 90px);
}

.dashboard-section {
    display: none;
}

.dashboard-section.active {
    display: block;
}

/* Header - Will use main-header class from style.css
   ========================================================================== */



/* Header Layout */
.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dashboard-label {
    font-size: 1rem;
    font-weight: 600;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid #e0e0e0;
}

.header-right-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-left: auto;
}

/* Section Header
   ========================================================================== */

.section-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.section-header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin: 0 0 0.75rem 0;
    line-height: 1.2;
}

.section-header p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin: 0 auto;
    max-width: 600px;
}

.right-column-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    /* Spazio tra il pulsante e la card sottostante */
}

/* Stats Grid
   ========================================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.3s ease;
    opacity: 0;
    transform: translateY(30px);
}

.stat-card.reveal {
    opacity: 1;
    transform: translateY(0);
}

.stat-card:nth-child(1) {
    transition-delay: 0.1s;
}

.stat-card:nth-child(2) {
    transition-delay: 0.2s;
}

.stat-card:nth-child(3) {
    transition-delay: 0.3s;
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 28px rgba(0, 123, 255, 0.15);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon i {
    font-size: 24px;
    color: #fff;
}

.stat-icon.blue {
    background-color: #007bff;
}

.stat-icon.green {
    background-color: #28a745;
}

.stat-icon.orange {
    background-color: #fd7e14;
}

.stat-icon.purple {
    background-color: #6f42c1;
}

.stat-content h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
    color: var(--text-color-dark);
}

.stat-content p {
    margin: 0;
    color: var(--text-light);
    font-weight: 500;
}

.stat-content small {
    display: block;
    margin-top: 4px;
}

/* Dashboard Grid (Main Content)
   ========================================================================== */

.dashboard-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.projects-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
}

.projects-table th,
.projects-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.projects-table th {
    font-weight: 600;
    color: #333;
}

.project-actions .btn-icon {
    margin-right: 0.5rem;
}

.project-actions .btn-danger {
    color: #f5576c;
}


.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.main-layout-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* Mobile First: una colonna di default */
    gap: 1.5rem;
    align-items: stretch;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.card-content {
    padding: 1.618rem;
    /* Golden ratio spacing */
    flex-grow: 1;
}

/* Recent Projects List
   ========================================================================== */

.project-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    /* Ulteriormente ridotto lo spazio tra i progetti */
}

.project-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    /* Mobile First: layout semplice - Aumentato ulteriormente per icona più grande */
    gap: 1rem;
    padding: 0.6rem 1rem;
    /* Ulteriormente ridotto il padding verticale */
    border-radius: 16px;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 1) 0%,
            rgba(248, 249, 250, 1) 100%);
    border: 1px solid transparent;
    background-clip: padding-box;
    transition: all 0.3s ease;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
}

.project-item.reveal {
    opacity: 1;
    transform: translateY(0);
}

.project-item::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 2px;
    background: linear-gradient(135deg, #007bff, #00bcd4);
    -webkit-mask: linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    /* Non bloccare i click */
}

.project-item:hover::before {
    opacity: 1;
}

.project-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.project-item.shared-project {
    border-left: 4px solid #2196F3;
    background: linear-gradient(135deg, #f8fbff 0%, #ffffff 100%);
}

.project-thumbnail {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--gradient-accent);
}

.project-thumbnail::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle,
            rgba(255, 255, 255, 0.1) 0%,
            transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* .shared-badge styles moved to Dashboard Inline Styles Migration section */

.project-info {
    flex: 1;
    min-width: 0;
}

.project-info h4 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 0.15rem 0;
    /* Ulteriormente ridotto lo spazio sotto il titolo */
    color: var(--secondary-color);
    text-transform: capitalize;
    letter-spacing: -0.02em;
    /* Tighter kerning */
    line-height: 1.3;
}

.project-info p {
    font-size: 0.85rem;
    /* Leggermente più piccolo per compattare */
    color: #6c757d;
    margin: 0 0 0.4rem 0;
    /* Ulteriormente ridotto lo spazio sotto la descrizione */
    line-height: 1.6;
    /* Più aria tra le righe */
}

.project-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.4rem 0.8rem 0.4rem 1.5rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    position: relative;
}

.project-status::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: status-pulse 2s infinite;
}

@keyframes status-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.project-status.active::before {
    background: #28a745;
}

.project-status.shared {
    background-color: rgba(33, 150, 243, 0.1);
    color: #2196F3;
}

.project-status.shared::before {
    background: #2196F3;
}

.project-owner-info,
.project-share-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Project Dates */
.project-dates {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    /* Ulteriormente ridotto */
    margin-top: 0.4rem;
    /* Ulteriormente ridotto */
    padding-top: 0.4rem;
    border-top: 1px solid #f0f0f0;
}

.project-date-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #6c757d;
}

.project-date-item i {
    font-size: 16px;
    color: #9ca3af;
}

.project-stats {
    display: none;
}

.project-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    grid-column: 1 / -1;
    /* Occupa tutta la larghezza su mobile */
    justify-content: flex-end;
    align-self: start;
    /* Allinea i pulsanti in alto */
    position: relative;
    z-index: 10;
    /* Sopra il ::before del project-item */
}

.project-actions .action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    /* Ancora più piccoli */
    height: 38px;
    /* Ancora più piccoli */
    border: 2px solid #e9ecef;
    border-radius: 12px;
    background: #ffffff;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 1;
    pointer-events: auto;
    /* Assicura che riceva i click */
}

.project-actions .action-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
}

.project-actions .action-btn.primary {
    background: linear-gradient(135deg, var(--primary-color), #0099d4);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2);
}

.project-actions .action-btn.primary:hover {
    background: linear-gradient(135deg, #0099d4, #007acc);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 30px rgba(0, 123, 255, 0.4);
}

.project-actions .action-btn.delete-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: #ef4444;
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
}

.project-actions .action-btn.leave-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: #f59e0b;
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.3);
}

.project-actions .action-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.project-actions .action-btn.renders-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    border-color: #8b5cf6;
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.3);
}

/* ===== Renders gallery modal ===== */
.renders-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: rendersFadeIn 0.2s ease;
}

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

.renders-modal {
    background: #fff;
    border-radius: 18px;
    width: min(960px, 100%);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.renders-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid #eef0f4;
}

.renders-modal-header h3 {
    margin: 0;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: capitalize;
    color: #1e293b;
}

.renders-modal-header h3 .material-icons { color: #8b5cf6; }

.renders-modal-close {
    background: #f1f5f9;
    border: none;
    border-radius: 10px;
    width: 38px;
    height: 38px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    transition: background 0.15s ease;
}
.renders-modal-close:hover { background: #e2e8f0; }

.renders-modal-body {
    padding: 20px 22px 26px;
    overflow-y: auto;
}

.renders-count {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 14px;
}

.renders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.render-thumb {
    margin: 0;
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid #eef0f4;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.render-thumb:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.render-thumb img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    background: #e2e8f0;
}

.render-thumb figcaption {
    padding: 8px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.render-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.render-meta { font-size: 0.72rem; color: #94a3b8; }

.renders-loading,
.renders-empty {
    text-align: center;
    padding: 50px 20px;
    color: #94a3b8;
}
.renders-loading .material-icons,
.renders-empty .material-icons {
    font-size: 46px;
    margin-bottom: 10px;
    display: block;
    width: 100%;
}
.renders-empty span { font-size: 0.8rem; display: block; margin-top: 4px; }
.renders-empty.error { color: #ef4444; }

.rotating { animation: rendersSpin 1s linear infinite; }
@keyframes rendersSpin { to { transform: rotate(360deg); } }

/* ===== Lightbox ===== */
.render-lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    padding: 30px;
    animation: rendersFadeIn 0.2s ease;
}
.render-lightbox-overlay img {
    max-width: 92vw;
    max-height: 88vh;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.render-lightbox-close,
.render-lightbox-download {
    position: absolute;
    top: 22px;
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease;
}
.render-lightbox-close { right: 22px; }
.render-lightbox-download { right: 78px; }
.render-lightbox-close:hover,
.render-lightbox-download:hover { background: rgba(255, 255, 255, 0.3); }

/* Quick Actions & Subscription Widget
   ========================================================================== */

.quick-actions .new-project-btn {
    width: 100%;
    /* Occupa tutta la larghezza della colonna */
}

.new-project-btn {
    width: 100%;
    background: linear-gradient(135deg,
            #007bff 0%,
            #0099d4 50%,
            #00bcd4 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1.25rem;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.new-project-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.new-project-btn:active::after {
    width: 300px;
    height: 300px;
}

.new-project-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
    background: linear-gradient(135deg,
            #0099d4 0%,
            #00bcd4 50%,
            #007bff 100%);
}

.subscription-widget {
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
}

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

.subscription-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.plan-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.plan-badge.basic {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.plan-badge.plus {
    background-color: rgba(0, 123, 255, 0.1);
    color: #007bff;
}

.plan-badge.pro {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.subscription-features {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.feature-item i {
    color: #28a745;
    font-size: 1.1rem;
}

.upgrade-btn {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, #fd7e14, #e8590c);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.upgrade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(253, 126, 20, 0.3);
}

/* Subscription Progress Bar */
.subscription-progress {
    margin: 1rem 0;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.65, 0, 0.35, 1);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.5rem;
}

/* Project Tags/Labels */
.project-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.project-tag {
    padding: 0.25rem 0.75rem;
    background: rgba(0, 123, 255, 0.1);
    color: #007bff;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Loading & Empty States
   ========================================================================== */

.loading-state,
#noRecentProjects {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Enhanced Empty State */
.empty-state-icon {
    font-size: 80px;
    color: #cbd5e0;
    margin-bottom: 1.5rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.empty-state-description {
    color: #718096;
    max-width: 400px;
    margin: 0 auto 2rem;
}

/* Skeleton Loading */
.skeleton-card {
    background: linear-gradient(90deg,
            #f0f0f0 25%,
            #e0e0e0 50%,
            #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 12px;
    height: 120px;
    margin-bottom: 1rem;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Notification Badge Animation */
.notification-badge {
    animation: pulse-notification 2s infinite;
}

@keyframes pulse-notification {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }

    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 8px rgba(220, 53, 69, 0);
    }
}

.notification-btn {
    position: relative;
    transition: transform 0.3s;
}

.notification-btn:hover {
    transform: rotate(15deg) scale(1.1);
}

/* Search & Filter Toolbar */
.projects-toolbar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.3s;
    background: white;
}

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

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    pointer-events: none;
}

/* Filter button styles moved to Dashboard Inline Styles Migration section */

/* ==========================================================================
   RESPONSIVE DESIGN (Mobile First Approach)
   ========================================================================== */

/* Tablets (fino a 1200px) */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Stili per Smartphone e schermi piccoli (fino a 768px) */
@media (max-width: 768px) {
    .dashboard-main {
        padding: 1rem;
        margin-top: 60px;
        /* Altezza header mobile */
        min-height: auto;
        /* Remove min-height to avoid empty space */
    }

    .dashboard-layout {
        min-height: auto;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        /* Una colonna per le statistiche */
        gap: 1rem;
    }

    .stat-card {
        padding: 1rem;
        flex-direction: row;
        /* Mantiene l'icona a lato */
        text-align: left;
    }

    .section-header h1 {
        font-size: 1.8rem;
    }

    .project-actions {
        justify-content: center;
        /* Centra i bottoni */
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid #e9ecef;
    }

    /* IMPORTANTE: Inverte l'ordine delle colonne su mobile */
    /* La colonna progetti (primo div) viene mostrata prima */
    /* La colonna abbonamento (right-column-wrapper) viene mostrata dopo */
    .main-layout-grid {
        display: flex;
        flex-direction: column;
    }

    .main-layout-grid>.dashboard-card:first-child {
        order: 1;
        /* Progetti per primi */
    }

    .main-layout-grid>.right-column-wrapper {
        order: 2;
        /* Abbonamento dopo i progetti */
        margin-top: 1.5rem;
    }

    /* Rendi i bottoni new-project a larghezza piena su mobile */
    .new-project-btn {
        width: 100%;
        justify-content: center;
    }

    .quick-actions {
        width: 100%;
    }

    /* Migliora la leggibilità dei filtri progetti su mobile */
    .project-filters {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        width: 100%;
    }

    .filter-btn {
        flex: 1;
        min-width: 70px;
        font-size: 0.8125rem;
        padding: 0.5rem 0.75rem;
    }

    /* Ottimizza card header su mobile */
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .card-header h2 {
        font-size: 1.25rem;
    }

    /* Rendi i project-item più compatti su mobile */
    .project-item {
        grid-template-columns: 80px 1fr;
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .project-thumbnail {
        width: 80px;
        height: 80px;
    }

    .project-info h4 {
        font-size: 1rem;
    }

    .project-info p {
        font-size: 0.8125rem;
    }

    /* Project dates più compatte */
    .project-dates {
        gap: 0.25rem;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
    }

    .project-date-item {
        font-size: 0.75rem;
    }

    /* Action buttons più piccoli su mobile */
    .project-actions .action-btn {
        width: 34px;
        height: 34px;
        font-size: 16px;
    }

    /* Summary progetti più leggibile */
    .projects-summary {
        font-size: 0.75rem !important;
        margin-top: 0.5rem;
        display: block;
        width: 100%;
    }

    /* Hide user info on mobile, show only avatar with initials */
    .user-profile-btn .user-info {
        display: none !important;
    }

    .user-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.8125rem;
    }

    /* Reduce header padding on mobile */
    .header-container {
        padding: 0 1rem;
    }

    .header-right-section {
        gap: 0.5rem;
        margin-left: auto;
    }

    /* Language selector mobile fix */
    .language-selector {
        order: 1;
    }

    .lang-dropdown-toggle {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
        border-radius: 6px;
        background: white;
        min-height: 36px;
    }

    .lang-dropdown-arrow {
        font-size: 1rem;
    }

    /* Hide notifications on mobile */
    .user-notifications {
        display: none;
    }

    /* User profile button compact */
    .user-profile-btn {
        padding: 0.25rem;
    }

    .user-profile-btn>.material-icons {
        display: none;
        /* Hide expand arrow */
    }

    /* Hide notification badge number on mobile */
    .notification-badge {
        font-size: 0.625rem;
        min-width: 16px;
        height: 16px;
        padding: 0 0.25rem;
    }

    /* Adjust dashboard label */
    .dashboard-label {
        font-size: 0.875rem;
        margin-left: 0.5rem;
        padding-left: 0.5rem;
    }

    /* Ensure logo is readable on mobile */
    .logo {
        font-size: 1.25rem !important;
    }
}

/* Stili per Tablet (da 764px a 1023px) */
@media (min-width: 764px) and (max-width: 1023px) {
    .dashboard-main {
        padding: 1.5rem;
    }

    /* Su tablet, mantieni layout flex verticale come mobile */
    .main-layout-grid {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }

    .main-layout-grid>.dashboard-card:first-child {
        order: 1;
        /* Progetti per primi */
    }

    .main-layout-grid>.right-column-wrapper {
        order: 2;
        /* Abbonamento dopo i progetti */
    }

    .project-item {
        grid-template-columns: 120px 1fr auto;
        /* Layout a 3 colonne per tablet con icona grande */
        gap: 1.5rem;
        padding: 1.5rem;
    }

    .project-actions {
        grid-column: auto;
        /* Ripristina il comportamento di default */
        margin-top: 0;
        padding-top: 0;
        border-top: none;
    }
}

/* ==========================================================================
   Stili per Desktop (da 1024px in su)
   ========================================================================== */
@media (min-width: 1024px) {

    /* Modifica la griglia degli elementi del progetto per includere le statistiche */
    .project-item {
        /* Aggiungiamo una colonna per le statistiche per riempire meglio lo spazio */
        grid-template-columns: 120px 1fr auto auto;
        gap: 1.25rem;
        align-items: center;
    }

    /* Su desktop, layout a due colonne per sfruttare meglio lo spazio */
    .main-layout-grid {
        display: grid !important;
        grid-template-columns: 2fr 1fr;
        gap: 1.5rem;
    }

    /* Reset dell'order per desktop */
    .main-layout-grid>.dashboard-card:first-child,
    .main-layout-grid>.right-column-wrapper {
        order: 0;
    }

    /* Rendi visibile la sezione delle statistiche, che è nascosta di default */
    .project-stats {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        color: var(--text-muted);
        font-size: 0.85rem;
        white-space: nowrap;
        /* Evita che il testo vada a capo */
    }

    /* Assicura che la colonna delle azioni non sia troppo distante */
    .project-actions {
        justify-self: end;
    }

    /* Riduciamo la dimensione dei pulsanti di azione per tablet */
    .project-actions .action-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
        border-radius: 10px;
    }

    /* Riduciamo lo spazio tra i pulsanti */
    .project-actions {
        gap: 0.4rem;
    }
}

/* ==========================================================================
   Dashboard Responsive - Hamburger Menu (max-width: 768px)
   ========================================================================== */

@media (max-width: 768px) {
    .dashboard-main {
        margin-left: 0;
        max-width: 100%;
        padding: 1.5rem 1rem;
    }

    .dashboard-layout {
        padding-top: 60px;
        /* Altezza dell'header mobile */
    }
}

/* ==========================================================================
   Subscription Management Styles
   ========================================================================== */

/* Subscription action buttons container */
.subscription-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

/* Manage subscription button */
.manage-subscription-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--gradient-accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    /* Mobile Safari touch fixes */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-primary);
}

.manage-subscription-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

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

.manage-subscription-btn i {
    font-size: 18px;
}

/* Stripe Portal Button */
.stripe-portal-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #635bff 0%, #0a2540 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    /* Mobile Safari touch fixes */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-primary);
}

.stripe-portal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 91, 255, 0.4);
}

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

.stripe-portal-btn i {
    font-size: 18px;
}

.stripe-portal-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ==========================================================================
   Modal Styles (Unified)
   ========================================================================== */

.modal,
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    /* Hidden by default - show via .show class or JS */
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

/* Show modal when .show class is added */
.modal.show,
.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h2,
.modal-header h3 {
    margin: 0;
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.modal-close:hover {
    background: #f0f0f0;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    text-align: right;
    border-top: 1px solid #eee;
    background-color: #f9fafb;
}

.account-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.account-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.account-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.toggle-switch input:checked+.toggle-slider {
    background-color: #4F46E5;
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(24px);
}

.invoice-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 8px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.invoice-item:last-child {
    border-bottom: none;
}

.btn-download-invoice {
    color: #4F46E5;
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 50%;
}

.btn-download-invoice:hover {
    background: #f0f0f0;
}

.spin {
    animation: spin 1s linear infinite;
}

#invoicesList {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 10px;
}

/* Disabled buttons for Basic plan users */
.new-project-btn:disabled {
    background-color: #e0e0e0;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Responsive adjustments for subscription buttons */
@media (max-width: 768px) {
    .subscription-actions {
        gap: 8px;
    }

    .manage-subscription-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* ==========================================================================
   Delete Account Modal & Danger Zone Styles
   ========================================================================== */

.danger-zone {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f0f0f0;
}

.delete-account-btn:hover {
    background: #dc3545 !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

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

/* Delete Modal Step Indicators */
.step-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e9ecef;
    transition: all 0.3s ease;
    cursor: default;
}

.step-dot.active {
    background: linear-gradient(135deg, #dc3545, #c82333);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
    transform: scale(1.2);
}

.step-dot.completed {
    background: #28a745;
}

/* Delete Step Animation */
.delete-step {
    animation: fadeInStep 0.4s ease-in-out;
}

@keyframes fadeInStep {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Input focus states for delete confirmation */
#deleteEmailConfirm:focus,
#deleteTypeConfirm:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
    outline: none;
}

#deleteEmailConfirm.error,
#deleteTypeConfirm.error {
    border-color: #dc3545 !important;
    background: #fff5f5;
}

#deleteEmailConfirm.success,
#deleteTypeConfirm.success {
    border-color: #28a745 !important;
    background: #f0fff4;
}

/* Danger button styles */
.btn-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c82333, #bd2130);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

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

.btn-danger:disabled {
    background: #e9ecef !important;
    color: #6c757d !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Secondary button (cancel) */
.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

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

/* ==========================================================================
   Dashboard Inline Styles Migration
   Moved from dashboard.html for better maintainability
   ========================================================================== */

/* Disabled button states */
button:disabled,
.btn:disabled,
.new-project-btn:disabled,
.action-btn:disabled {
    background: #d8dde2 !important;
    color: #8a95a1 !important;
    cursor: not-allowed !important;
    border-color: #e0e0e0 !important;
    box-shadow: none !important;
}

button:disabled .material-icons {
    color: #8a95a1 !important;
}

/* Project filters */
.project-filters {
    display: flex;
    gap: 10px;
}

.filter-btn {
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 5px 15px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.filter-btn:hover:not(.active) {
    background: #e0e0e0;
}

/* Demo Filter Button - Special Style */
.filter-btn.demo-filter {
    border: 2px solid #FFB74D;
    color: #E65100;
    font-weight: 600;
}

.filter-btn.demo-filter:hover:not(.active) {
    background: #FFF8E1;
    border-color: #FF9800;
}

.filter-btn.demo-filter.active {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    border-color: #FF9800;
    color: white;
}

.projects-summary {
    margin-left: auto;
    font-size: 0.85rem;
    color: #666;
}

/* Shared Badge on Project Thumbnail - Override */
.shared-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(33, 150, 243, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    width: auto;
    height: auto;
    border: none;
}

.shared-badge i.material-icons {
    font-size: 16px;
}

/* Demo Badge on Project Thumbnail */
.demo-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    color: white;
    padding: 6px 10px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(255, 152, 0, 0.4);
    animation: pulse-demo 2s ease-in-out infinite;
}

.demo-badge i.material-icons {
    font-size: 18px;
}

@keyframes pulse-demo {

    0%,
    100% {
        box-shadow: 0 3px 10px rgba(255, 152, 0, 0.4);
    }

    50% {
        box-shadow: 0 3px 15px rgba(255, 152, 0, 0.6);
    }
}

/* Occupied Badge on Project Thumbnail */
.occupied-badge {
    position: absolute;
    top: 44px;
    right: 8px;
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
    animation: pulse-occupied 2s ease-in-out infinite;
}

.occupied-badge i.material-icons {
    font-size: 16px;
}

@keyframes pulse-occupied {

    0%,
    100% {
        box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 3px 12px rgba(255, 152, 0, 0.5);
        transform: scale(1.05);
    }
}

/* Modal Overlay Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Collaboration Modal */
.modal-overlay {
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.modal-content.collaboration-modal {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header h2 i.material-icons {
    color: var(--primary-color);
    font-size: 28px;
}

.modal-close i.material-icons {
    color: #666;
    font-size: 24px;
}

.collaboration-info {
    text-align: center;
    margin-bottom: 24px;
}

.occupied-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.occupied-icon i.material-icons {
    font-size: 36px;
    color: white;
}

.collaboration-info h3 {
    margin: 0 0 12px 0;
    font-size: 20px;
    color: #1a1a1a;
}

.collaboration-info p {
    margin: 8px 0;
    color: #666;
    font-size: 14px;
}

.collaboration-options {
    background: #f5f5f5;
    padding: 16px;
    border-radius: 12px;
}

.collaboration-options p {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #1a1a1a;
    font-weight: 500;
}

.collaboration-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.collaboration-note i.material-icons {
    font-size: 20px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.collaboration-note span {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

/* Generic button styles */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-secondary {
    background: #f5f5f5;
    color: #666;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(236, 64, 122, 0.3);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.rotating {
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Demo Project Status */
.project-status.demo {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    color: white;
    font-weight: 600;
}

/* Demo Project Card */
.demo-project {
    border-left: 3px solid #FF9800;
}

/* Demo Info Box */
.demo-info {
    background: linear-gradient(135deg, #FFF8E1 0%, #FFE0B2 100%);
    border-left: 3px solid #FF9800;
}

.demo-info .share-header {
    color: #E65100;
}

.demo-info .share-header i.material-icons {
    color: #FF9800;
}

/* Model Info Box */
.model-info {
    background: linear-gradient(135deg, #EDE7F6 0%, #D1C4E9 100%);
    border-left: 3px solid #673AB7;
}

.model-info .share-header {
    color: #4527A0;
}

.model-info .share-header i.material-icons {
    color: #673AB7;
}

.demo-description {
    padding: 6px 0 0 0;
}

.demo-description p {
    margin: 0;
    color: #424242;
    font-size: 12px;
    line-height: 1.4;
}

/* Model Badge on Project Thumbnail */
.model-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #673AB7 0%, #512DA8 100%);
    color: white;
    padding: 6px 10px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(103, 58, 183, 0.4);
    animation: pulse-model 2s ease-in-out infinite;
}

.model-badge i.material-icons {
    font-size: 18px;
}

@keyframes pulse-model {

    0%,
    100% {
        box-shadow: 0 3px 10px rgba(103, 58, 183, 0.4);
    }

    50% {
        box-shadow: 0 3px 15px rgba(103, 58, 183, 0.6);
    }
}

/* Model Project Status */
.project-status.model {
    background: linear-gradient(135deg, #673AB7 0%, #512DA8 100%);
    color: white;
    font-weight: 600;
}

/* Model Project Card */
.model-project {
    border-left: 3px solid #673AB7;
}

/* Inactive Overlay for Client 88 */
.inactive-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    z-index: 5;
}

.inactive-badge {
    background: rgba(244, 67, 54, 0.95);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.inactive-badge i.material-icons {
    font-size: 20px;
}

/* Demo Management Controls (Client 88 only) */
.demo-management-controls {
    margin-top: 12px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    border: 1px solid #e0e0e0;
}

.demo-management-controls .control-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.demo-management-controls label {
    font-size: 11px;
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
}

.demo-management-controls label i.material-icons {
    font-size: 14px;
    color: #6c757d;
}

.demo-management-controls select {
    padding: 6px 8px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: white;
    font-size: 12px;
    font-weight: 500;
    color: #212529;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%23666' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    padding-right: 24px;
}

.demo-management-controls select:hover {
    border-color: #80bdff;
    background-color: #fff;
}

.demo-management-controls select:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

/* Responsive design for management controls */
@media (max-width: 768px) {
    .demo-management-controls {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

/* Project Thumbnail Link positioning for badge */
.project-thumbnail-link {
    position: relative;
}

/* Shared Users List in Dashboard - Compact Version */
.project-share-info {
    margin-top: 8px;
    padding: 6px 8px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 2px solid #6c757d;
}

.share-header {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 10px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.share-header i.material-icons {
    font-size: 14px;
}

.shared-users-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.shared-user-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 6px;
    background: white;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    transition: border-color 0.15s ease;
}

.shared-user-item:hover {
    border-color: #adb5bd;
}

.shared-user-item.readonly {
    cursor: default;
}

.shared-user-name {
    flex: 1;
    font-size: 12px;
    color: #212529;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Permission Badge Small (for read-only view) - Compact */
.permission-badge-small {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 5px;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.permission-badge-small i.material-icons {
    font-size: 11px;
}

.permission-badge-small.permission-edit {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.permission-badge-small.permission-readonly {
    background: #e2e3e5;
    color: #6c757d;
    border: 1px solid #d6d8db;
}

/* Owner Badge - Compact */
.owner-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 5px;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 600;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.owner-badge i.material-icons {
    font-size: 11px;
}

.owner-item {
    border-color: #ffeaa7;
    background: #fffef7;
}

/* Inline Edit Toggle Button - Compact */
.inline-edit-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1px solid #ced4da;
    background: white;
    color: #6c757d;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
    flex-shrink: 0;
}

.inline-edit-toggle i.material-icons {
    font-size: 14px;
}

.inline-edit-toggle.active {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

.inline-edit-toggle:hover:not(.active) {
    background: #e9ecef;
    border-color: #adb5bd;
}

.inline-edit-toggle:hover.active {
    background: #218838;
}

/* Inline Remove User Button - Compact */
.inline-remove-user {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: white;
    border: 1px solid #ced4da;
    color: #dc3545;
    cursor: pointer;
    border-radius: 4px;
    padding: 0;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.inline-remove-user i.material-icons {
    font-size: 14px;
}

.inline-remove-user:hover {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

/* Loading state padding */
.loading-state {
    padding: 20px 0;
}

/* Empty state styles */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-state-icon {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 16px;
}

/* Quick actions container */
.quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Subscription widget margin reset */
.subscription-widget {
    margin-top: 0;
}

.danger-zone-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.5rem;
}

.danger-zone-header i {
    font-size: 18px;
    color: #dc3545;
}

.danger-zone-header h4 {
    margin: 0;
    font-size: 0.9rem;
    color: #6c757d;
}

.danger-zone-text {
    font-size: 0.8rem;
    color: #6c757d;
    margin: 0 0 0.75rem 0;
}

/* Delete account button */
.delete-account-btn {
    width: 100%;
    padding: 0.6rem 1rem;
    background: transparent;
    color: #dc3545;
    border: 1px solid #dc3545;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    /* Mobile Safari touch fixes */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
}

.delete-account-btn i {
    font-size: 18px;
}

.delete-account-btn:hover {
    background: #dc3545;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

/* Stat icon transform */
.stat-icon i.large {
    transform: scale(1.5);
    transform-origin: center;
}

/* Plan expiry small text */
.stat-content small {
    color: #6c757d;
    font-size: 0.8em;
}

/* Admin links visibility */
.admin-only {
    display: none;
}

.admin-only.visible {
    display: flex;
}

/* Subscription status indicator */
.subscription-status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}

.subscription-status.active {
    background-color: #e7f5e7;
    color: #2d5a2d;
}

.subscription-status.inactive {
    background-color: #fff3cd;
    color: #856404;
}

.subscription-status i {
    vertical-align: middle;
    font-size: 16px;
    margin-right: 5px;
}

/* Modal content variations */
.modal-content.delete-account-modal {
    max-width: 550px;
}

/* Help text utility */
.help-text {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}



/* User Section - Styles matching frontend aesthetic */
.dashboard-user-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

/* User Profile Dropdown - Matching frontend style */
/* User Profile Dropdown styles removed to use style.min.css standard */

/* Fix for user profile hover shadow - Aggressive Reset */
.user-profile-btn,
.user-profile-btn:hover,
.user-profile-btn:focus,
.user-profile-btn:active,
.user-profile-dropdown:hover .user-profile-btn,
.user-profile-dropdown.active .user-profile-btn {
    box-shadow: none !important;
    border: none !important;
    outline: none !important;
}

/* Hover state - flat background only */
.user-profile-btn:hover,
.user-profile-dropdown:hover .user-profile-btn,
.user-profile-dropdown.active .user-profile-btn {
    background-color: rgba(0, 0, 0, 0.04) !important;
}

/* Ensure inner elements don't get card styles */
.user-profile-btn .user-info,
.user-profile-btn .user-name,
.user-profile-btn .user-plan {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

/* =================================================================
   DASHBOARD INLINE STYLES EXTRACTED (Phase 2 Consolidation)
   Stili estratti da dashboard.html per migliorare manutenibilità
   ================================================================= */

/* =================================================================
   DELETE ACCOUNT MODAL
   ================================================================= */

.delete-modal-header {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    border-radius: 10px 10px 0 0;
}

.delete-modal-header h2 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.delete-modal-header .material-icons {
    vertical-align: middle;
}

.delete-modal-header .modal-close {
    color: white;
    opacity: 0.9;
}

.delete-modal-header .modal-close:hover {
    opacity: 1;
}

.delete-warning-box {
    background: #fff3cd;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
    margin-bottom: 1.5rem;
}

.delete-warning-box h4 {
    margin: 0 0 0.5rem 0;
    color: #856404;
    display: flex;
    align-items: center;
    gap: 8px;
}

.delete-warning-box p {
    margin: 0;
    color: #856404;
    font-size: 0.9rem;
}

.delete-consequences-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
}

.delete-consequences-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: start;
    gap: 10px;
}

.delete-consequences-list li:last-child {
    border-bottom: none;
}

.delete-consequences-list .material-icons {
    color: #dc3545;
    font-size: 20px;
    flex-shrink: 0;
}

.delete-consequences-list strong {
    display: block;
}

.delete-consequences-list p {
    margin: 0.25rem 0 0 0;
    font-size: 0.85rem;
    color: #6c757d;
}

/* =================================================================
   PROJECT ICONS & CARDS
   ================================================================= */

/* Base Project Icon Styles (Desktop) */
.project-icon {
    width: 120px;
    height: 120px;
    min-width: 120px;
    border-radius: 8px;
    background: #eeeeee;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    overflow: hidden;
    flex-shrink: 0;
}

.project-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.project-icon .material-icons {
    font-size: 48px;
}

/* Project Item Layout */
.project-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 1rem;
    padding: 0.6rem 1rem;
    border-radius: 16px;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 1) 0%,
            rgba(248, 249, 250, 1) 100%);
    border: 1px solid transparent;
    background-clip: padding-box;
    transition: all 0.3s ease;
    position: relative;
}

.project-thumbnail-link {
    flex-shrink: 0;
    position: relative;
}

/* Legacy classes for compatibility */
.project-icon-large {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    background: #eeeeee;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    overflow: hidden;
}

.project-icon-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.project-icon-small {
    background: var(--primary-color);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =================================================================
   UTILITY CLASSES
   ================================================================= */

.icon-inline {
    vertical-align: middle;
    font-size: 16px;
    margin-right: 5px;
}

.flex-between {
    display: flex;
    justify-content: space-between;
}

.flex-between-mb {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.text-center-muted {
    color: #666;
    text-align: center;
    padding: 10px 0;
}

.text-center-error {
    color: #ef4444;
    text-align: center;
    padding: 10px 0;
}

.slot-occupied {
    background: #ff9800;
}

/* =================================================================
   DASHBOARD MOBILE IMPROVEMENTS
   ================================================================= */

/* Feature Access Info */
.feature-access-info {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

/* =================================================================
   ACCOUNT SUMMARY
   ================================================================= */

.account-summary {
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 14px;
}

.account-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.account-summary-row:last-child {
    margin-bottom: 0;
}