/**
 * Suellen Streaming - Estilos principais
 * Design system nutrição premium
 */

@import "design-tokens.css";

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--fundo);
    color: var(--texto);
    line-height: 1.6;
    min-height: 100vh;
    font-size: 15px;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ========== LOGIN ========== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(165deg, rgba(var(--primario-rgb), 0.12) 0%, var(--fundo) 40%, var(--fundo-secundario) 100%);
    background-image: 
        linear-gradient(to bottom, rgba(13, 17, 23, 0.85) 0%, rgba(13, 17, 23, 0.75) 100%),
        url('https://images.unsplash.com/photo-1512621776951-a57141f2eefd?w=1920');
    background-size: cover;
    background-position: center;
}

.login-container {
    width: 100%;
    max-width: 440px;
    padding: var(--space-lg);
}

.login-card {
    background: var(--fundo-card);
    padding: var(--space-2xl) 40px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--borda);
    box-shadow: var(--shadow-lg);
}

.login-brand {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.login-brand h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primario);
    margin-bottom: var(--space-sm);
}

.login-brand p {
    color: var(--texto-muted);
    font-size: 0.95rem;
}

.login-form .form-group {
    margin-bottom: var(--space-lg);
}

.login-form label {
    display: block;
    margin-bottom: var(--space-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--texto-sec);
}

.login-form input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    border: 1px solid var(--borda);
    border-radius: var(--radius-sm);
    background: var(--fundo-secundario);
    color: var(--texto);
    transition: border-color var(--transition-fast);
}

.login-form input:focus {
    outline: none;
    border-color: var(--primario);
    box-shadow: 0 0 0 2px rgba(var(--primario-rgb), 0.2);
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.btn-primario:hover {
    background: var(--primario-escuro);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
    padding: 14px;
    margin-top: var(--space-sm);
}

.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-lg);
    font-size: 0.9rem;
}

.alert-erro {
    background: rgba(217, 107, 107, 0.15);
    color: var(--erro);
    border: 1px solid rgba(217, 107, 107, 0.3);
}

.alert-sucesso {
    background: rgba(91, 185, 140, 0.15);
    color: var(--sucesso);
    border: 1px solid rgba(91, 185, 140, 0.3);
}

.login-footer {
    text-align: center;
    margin-top: var(--space-lg);
    color: var(--texto-muted);
    font-size: 0.85rem;
}

/* ========== LAYOUT GERAL ========== */
.layout-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: linear-gradient(180deg, rgba(13, 17, 23, 0.97) 0%, rgba(13, 17, 23, 0.9) 100%);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-xl);
    z-index: 100;
    border-bottom: 1px solid var(--borda-sutil);
}

.layout-logo {
    height: 36px;
    max-width: 180px;
    object-fit: contain;
}

.layout-logo-text {
    font-family: 'Poppins', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primario);
}

.layout-nav a {
    margin-left: var(--space-xl);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--texto-muted);
    transition: color var(--transition-fast);
}

.layout-nav a:hover {
    color: var(--texto);
}

.layout-user {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.layout-user img {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.layout-main {
    padding-top: 88px;
    min-height: 100vh;
}

/* ========== CARDS ========== */
.cursos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-lg);
    padding: var(--space-lg) 0;
}

.video-card {
    background: var(--fundo-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--borda-sutil);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-fast);
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(var(--primario-rgb), 0.2);
}

.video-card-thumb {
    aspect-ratio: 16/9;
    background: var(--fundo-hover);
    position: relative;
    overflow: hidden;
}

.video-card-thumb-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--fundo-hover) 0%, var(--fundo-secundario) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    opacity: 0.7;
}

.video-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-card-thumb .badge-estreia {
    position: absolute;
    top: var(--space-md);
    left: var(--space-md);
    background: var(--accent-premium);
    color: var(--fundo);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.video-card-body {
    padding: var(--space-lg);
}

.video-card-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--texto);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-card-desc {
    font-size: 0.9rem;
    color: var(--texto-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========== PLAYER ========== */
.player-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto var(--space-lg);
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.player-container iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
}

.player-container video {
    width: 100%;
    display: block;
}

.player-bloqueado {
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--fundo-secundario) 0%, var(--fundo-hover) 100%);
}

.player-bloqueado .icone {
    font-size: 4rem;
    opacity: 0.4;
}

/* ========== FORMULÁRIOS ========== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--texto-sec);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border: 1px solid var(--borda);
    border-radius: var(--radius-sm);
    background: var(--fundo-secundario);
    color: var(--texto);
    transition: border-color var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primario);
}

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

/* ========== TABELAS ========== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--fundo-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--borda-sutil);
}

.data-table th,
.data-table td {
    padding: var(--space-md) var(--space-lg);
    text-align: left;
    border-bottom: 1px solid var(--borda-sutil);
}

.data-table th {
    background: var(--fundo-secundario);
    font-weight: 600;
    color: var(--texto-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table tr:hover td {
    background: rgba(var(--primario-rgb), 0.04);
}

/* ========== WHATSAPP FLUTUANTE ========== */
.whatsapp-float {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    width: 56px;
    height: 56px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    z-index: 999;
    transition: transform var(--transition-fast);
}

.whatsapp-float:hover {
    transform: scale(1.08);
}

.whatsapp-float svg {
    width: 28px;
    height: 28px;
    fill: white;
}

/* ========== CHAT BASE ========== */
.chat-toggle {
    position: fixed;
    bottom: 90px;
    right: var(--space-lg);
    width: 56px;
    height: 56px;
    background: var(--primario);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 998;
    box-shadow: 0 4px 20px rgba(var(--primario-rgb), 0.4);
    transition: transform var(--transition-fast);
}

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

.chat-box {
    position: fixed;
    bottom: 160px;
    right: var(--space-lg);
    width: 380px;
    max-height: 480px;
    background: var(--fundo-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--borda);
    display: none;
    flex-direction: column;
    z-index: 997;
}

.chat-box.aberto {
    display: flex;
}

.chat-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--borda-sutil);
    font-weight: 600;
}

.chat-mensagens {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
    max-height: 320px;
}

.chat-placeholder {
    color: var(--texto-muted);
    font-size: 0.9rem;
}

.chat-msg-item {
    margin-bottom: var(--space-lg);
}

.chat-msg-aluno {
    background: var(--fundo-hover);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-xs);
}

.chat-msg-resposta {
    background: rgba(var(--primario-rgb), 0.12);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-xs);
}

.chat-msg-item small {
    color: var(--texto-muted);
    font-size: 0.75rem;
}

.aluno-chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    background: var(--accent-premium);
    color: var(--fundo);
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-input {
    padding: var(--space-lg);
    border-top: 1px solid var(--borda-sutil);
}

.chat-input input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--borda);
    border-radius: var(--radius-sm);
    background: var(--fundo);
    color: var(--texto);
}

.chat-input .btn {
    margin-top: var(--space-sm);
}

/* Form card */
.form-card {
    background: var(--fundo-card);
    padding: var(--space-xl);
    border-radius: var(--radius-md);
    border: 1px solid var(--borda-sutil);
    margin-bottom: var(--space-xl);
}

.form-card h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-lg);
    color: var(--texto);
}

/* Responsividade básica */
@media (max-width: 768px) {
    .layout-header { padding: 0 var(--space-md); }
    .layout-nav a { margin-left: var(--space-md); font-size: 0.85rem; }
    .gestor-sidebar { width: 200px; }
    .gestor-content { margin-left: 200px; }
    .cursos-grid { grid-template-columns: 1fr; }
    .dashboard-stats { grid-template-columns: 1fr 1fr; }
    .acoes-rapidas-grid { grid-template-columns: 1fr 1fr; }
}
