/* ============================================================
   Vento Digitale — Video Tools
   Custom CSS
   ============================================================ */

:root {
    --vd-accent: #0d6efd;
    --vd-bg: #f5f6f8;
    --vd-card-shadow: 0 0.125rem 0.5rem rgba(0,0,0,.08);
}

/* --- Tipografia base --- */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.925rem;
    background-color: var(--vd-bg);
    color: #212529;
}

/* --- Navbar --- */
.navbar {
    background-color: #f8f9fa !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.07);
}

.navbar-brand {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

/* --- Stat cards --- */
.stat-card {
    background: #fff;
    border-radius: .75rem;
    border: 1px solid #e9ecef;
    box-shadow: var(--vd-card-shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
}

.stat-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
}

.stat-label {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #6c757d;
}

/* --- Card generiche --- */
.card {
    border-radius: 10px;
}

.card-header {
    border-radius: 10px 10px 0 0 !important;
}

/* --- Upload Drag & Drop Zone --- */
.drop-zone {
    border: 2px dashed #ced4da;
    border-radius: 12px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    background-color: #fafbfc;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    user-select: none;
    outline: none;
}

.drop-zone:hover,
.drop-zone:focus {
    border-color: var(--vd-accent);
    background-color: #f0f4ff;
}

.drop-zone--active {
    border-color: var(--vd-accent);
    background-color: #e8f0fe;
    border-style: solid;
}

.drop-zone--has-file {
    border-color: #198754;
    background-color: #f0faf4;
}

/* alias per compatibilità */
.upload-zone { }
.upload-zone.dragover { border-color: var(--vd-accent); background: #f0f5ff; }
.upload-zone.has-file { border-color: #198754; background: #f0fff4; }

/* --- Progress bar animata --- */
.progress { border-radius: .5rem; }
.progress-bar.processing-bar {
    animation: progress-stripe 1s linear infinite;
    background-image: linear-gradient(
        45deg,
        rgba(255,255,255,.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255,255,255,.15) 50%,
        rgba(255,255,255,.15) 75%,
        transparent 75%
    );
    background-size: 1rem 1rem;
}

@keyframes progress-stripe {
    from { background-position-x: 1rem; }
    to   { background-position-x: 0; }
}

/* --- Video thumbnail cards --- */
.video-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: .75rem;
    box-shadow: var(--vd-card-shadow);
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.video-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12) !important;
}

.video-thumbnail-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background-color: #1a1a2e;
}

.video-thumbnail,
.video-card .video-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.video-card:hover .video-thumbnail,
.video-card:hover .video-thumb {
    transform: scale(1.03);
}

.video-thumbnail-placeholder,
.video-card .video-thumb-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 2rem;
}

.video-card .card-body {
    padding: .875rem 1rem;
}

.video-card .video-title,
.video-card .video-card-title {
    font-weight: 600;
    font-size: .95rem;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.video-card .video-meta {
    font-size: .8rem;
    color: #6c757d;
}

/* --- Badge status --- */
.badge {
    font-weight: 500;
    letter-spacing: 0.2px;
}

.badge.status-pending    { background: #6c757d; }
.badge.status-processing { background: #0d6efd; }
.badge.status-completed  { background: #198754; }
.badge.status-failed     { background: #dc3545; }

/* --- Tabelle --- */
.table-hover tbody tr:hover { background: rgba(13,110,253,.04); }

.table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #6c757d;
}

/* --- Form controls --- */
.form-control:focus,
.form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* --- Font monospace per API keys --- */
.font-monospace {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.875rem;
}

/* --- Settings page sections --- */
.settings-section {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: .75rem;
    box-shadow: var(--vd-card-shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.settings-section h5 {
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid #e9ecef;
}

/* --- Login page --- */
.login-page-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* --- Upload progress container --- */
#upload-progress-container { display: none; }
#upload-progress-container.show { display: block; }

/* --- Misc helpers --- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.page-title {
    font-weight: 700;
    font-size: 1.4rem;
    margin: 0;
}

/* --- Alert flash --- */
.alert {
    border-radius: 8px;
    border: none;
}

/* --- Paginazione --- */
.pagination .page-link {
    border-radius: 6px;
    margin: 0 2px;
    border: 1px solid #dee2e6;
    color: var(--vd-accent);
}

.pagination .page-item.active .page-link {
    background-color: var(--vd-accent);
    border-color: var(--vd-accent);
}

/* --- Scrollbar sottile (webkit) --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #ced4da; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #adb5bd; }

/* --- Responsive tweaks --- */
@media (max-width: 576px) {
    .stat-value { font-size: 1.4rem; }
    .video-thumbnail-wrapper { aspect-ratio: 16 / 9; }
}
