/* ===============================================
   VREYA - CSS LIVE & CORSI
   Dashboard professionista per gestione live e corsi
   =============================================== */

/* ===============================================
   TAB NAVIGATION
   =============================================== */
.tabs-navigation {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 0;
}

.tab-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    bottom: -2px;
}

.tab-btn:hover {
    color: var(--color-primary);
    background: rgba(105, 109, 216, 0.05);
}

.tab-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* ===============================================
   TAB CONTENT
   =============================================== */
.tabs-content {
    min-height: 400px;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

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

/* ===============================================
   STATS GRID
   =============================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.stat-card {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
}

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

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: var(--color-secondary);
    font-weight: 500;
}

/* ===============================================
   CONTENT CARD
   =============================================== */
.content-card {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 24px;
}

.content-card h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
}

.card-header-action {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 16px;
}

/* ===============================================
   LIVE CARD
   =============================================== */
.live-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

.live-card {
    background: linear-gradient(135deg, #fff 0%, #fafafa 100%);
    border: 2px solid var(--color-border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 20px;
    align-items: center;
    transition: all 0.3s ease;
}

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

.live-card.live-now {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #ef4444;
}

.live-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.live-icon.live-now::after {
    content: 'LIVE';
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 4px;
    animation: pulse 1.5s infinite;
}

.live-icon svg {
    color: white;
}

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

.live-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 8px 0;
}

.live-details {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 8px;
}

.live-detail-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--color-secondary);
}

.live-detail-item svg {
    width: 16px;
    height: 16px;
    opacity: 0.6;
}

.live-countdown {
    background: rgba(105, 109, 216, 0.1);
    border: 1px solid var(--color-primary);
    border-radius: 8px;
    padding: 12px 16px;
    text-align: center;
    min-width: 140px;
}

.countdown-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-secondary);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.countdown-time {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-primary);
    font-variant-numeric: tabular-nums;
}

.live-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-go-live {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-go-live:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-go-live:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
}

.btn-manage {
    background: white;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-manage:hover {
    background: #f9fafb;
    border-color: var(--color-primary);
}

.live-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-scheduled {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.badge-live {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.badge-ended {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: var(--color-secondary);
}

.empty-state svg {
    opacity: 0.3;
    margin-bottom: 16px;
}

.empty-state p {
    margin: 8px 0;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ===============================================
   CORSI CARD
   =============================================== */
.corsi-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.corso-card {
    background: white;
    border: 2px solid var(--color-border);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.corso-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    border-color: var(--color-primary);
}

.corso-header {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.corso-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.corso-icon svg {
    color: white;
}

.corso-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 4px 0;
}

.corso-subtitle {
    font-size: 14px;
    color: var(--color-secondary);
    margin: 0;
}

.corso-stats {
    display: flex;
    gap: 20px;
    padding: 16px 0;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 16px;
}

.corso-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.corso-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text);
}

.corso-stat-label {
    font-size: 12px;
    color: var(--color-secondary);
    text-transform: uppercase;
}

.corso-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: auto;
}

.btn-corso-action {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.btn-corso-action:hover {
    background: #f9fafb;
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-corso-action svg {
    width: 20px;
    height: 20px;
}

/* ===============================================
   MODALI
   =============================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.active,
.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

.modal-large {
    max-width: 800px;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text);
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--color-secondary);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f3f4f6;
    color: var(--color-text);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--color-border);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

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

/* Tabella iscritti */
.iscritti-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.iscritti-table th,
.iscritti-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.iscritti-table th {
    background: #f9fafb;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    color: var(--color-secondary);
}

.iscritti-table td {
    font-size: 14px;
}

.presenza-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.presenza-high {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.presenza-medium {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.presenza-low {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Upload area */
.upload-area {
    border: 2px dashed var(--color-border);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: var(--color-primary);
    background: rgba(105, 109, 216, 0.05);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(105, 109, 216, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* ===============================================
   RESPONSIVE
   =============================================== */
@media (max-width: 768px) {
    .tabs-navigation {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab-btn {
        white-space: nowrap;
        padding: 12px 16px;
        font-size: 13px;
    }

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

    .corsi-list {
        grid-template-columns: 1fr;
    }

    .live-card {
        flex-direction: column;
    }

    .corso-actions {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
}

/* ===============================================
   MODAL DETTAGLI CONSULENZA
   =============================================== */
.dettagli-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--color-border);
}

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

.dettagli-section h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 16px 0;
}

.dettagli-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.dettaglio-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dettaglio-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-secondary);
    text-transform: uppercase;
}

.dettaglio-value {
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text);
}

.documenti-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.documento-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f9fafb;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.documento-item:hover {
    background: #f3f4f6;
}

.documento-item svg {
    flex-shrink: 0;
    color: var(--color-primary);
}

.documento-item span {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
}

.btn-icon {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

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

.btn-icon:hover svg {
    color: white;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    background: #5a5eba;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(105, 109, 216, 0.3);
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

@media (max-width: 768px) {
    .dettagli-grid {
        grid-template-columns: 1fr;
    }
}

/* Stili aggiuntivi per h5 nei dettagli */
.dettagli-section h5 {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 8px 0;
}

/* Stile per consulenze list */
.consulenze-list,
.storico-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}
