/* ============================================================
   PlayTema — Folha de Estilo Principal
   Paleta: Azul profundo #042C53 → #185FA5 → branco
   ============================================================ */

/* --- Variáveis --- */
:root {
    --pt-900:   #042C53;
    --pt-800:   #0C447C;
    --pt-700:   #185FA5;
    --pt-600:   #2272C3;
    --pt-500:   #378ADD;
    --pt-400:   #5BA3E8;
    --pt-300:   #85B7EB;
    --pt-200:   #B5D4F4;
    --pt-100:   #DDEDFB;
    --pt-50:    #F0F7FD;
    --white:    #FFFFFF;
    --gray-900: #0F1117;
    --gray-800: #1A1D27;
    --gray-700: #2D3142;
    --gray-600: #495270;
    --gray-500: #6B7494;
    --gray-400: #9CA3BC;
    --gray-300: #C8CEDD;
    --gray-200: #E2E5EF;
    --gray-100: #F1F3F9;
    --gray-50:  #F8F9FC;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 3px rgba(4,44,83,.08), 0 1px 2px rgba(4,44,83,.06);
    --shadow-md: 0 4px 16px rgba(4,44,83,.10), 0 2px 6px rgba(4,44,83,.06);
    --shadow-lg: 0 8px 32px rgba(4,44,83,.14);
    --transition: 0.18s ease;
}

/* --- Base --- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 15px;
    color: var(--gray-900);
    background: var(--gray-50);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--pt-700); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--pt-800); }
h1,h2,h3,h4,h5,h6 { font-weight: 600; color: var(--gray-900); }
img { max-width: 100%; }
.fw-500 { font-weight: 500; }

/* --- Navbar --- */
.navbar-playtema {
    background: linear-gradient(135deg, var(--pt-900) 0%, var(--pt-800) 100%);
    padding: 0.75rem 0;
    box-shadow: 0 2px 20px rgba(4,44,83,.25);
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.logo-icon-nav {
    width: 36px; height: 36px;
    background: rgba(255,255,255,.15);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255,255,255,.2);
}

.logo-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.5px;
}
.logo-accent { color: var(--pt-400); }

.navbar-search { max-width: 420px; width: 100%; }
.navbar-search .form-control {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    color: var(--white);
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    padding: 0.5rem 1rem;
    font-size: 14px;
}
.navbar-search .form-control::placeholder { color: rgba(255,255,255,.55); }
.navbar-search .form-control:focus {
    background: rgba(255,255,255,.18);
    border-color: rgba(255,255,255,.4);
    color: var(--white);
    box-shadow: none;
}
.btn-search {
    background: var(--pt-500);
    border: none;
    color: var(--white);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 0.5rem 1rem;
}
.btn-search:hover { background: var(--pt-400); color: var(--white); }

.text-white-75 { color: rgba(255,255,255,.80) !important; }
.text-white-75:hover { color: var(--white) !important; }

.avatar-nav {
    width: 34px; height: 34px;
    background: var(--pt-500);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 13px; color: var(--white);
    border: 2px solid rgba(255,255,255,.3);
}

.dropdown-playtema {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    min-width: 220px;
}
.dropdown-playtema .dropdown-item {
    border-radius: var(--radius-sm);
    font-size: 14px;
    padding: 0.55rem 0.75rem;
    color: var(--gray-800);
    transition: background var(--transition);
}
.dropdown-playtema .dropdown-item:hover { background: var(--pt-50); color: var(--pt-700); }

.text-primary-dark { color: var(--pt-800) !important; }

/* --- Hero / Busca principal --- */
.hero-section {
    background: linear-gradient(160deg, var(--pt-900) 0%, var(--pt-700) 60%, var(--pt-500) 100%);
    padding: 5rem 0 4rem;
    color: var(--white);
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-title { font-size: 2.6rem; font-weight: 700; color: var(--white); line-height: 1.2; }
.hero-sub   { font-size: 1.1rem; color: rgba(255,255,255,.80); }

.hero-search-box {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 6px 6px 6px 20px;
    display: flex; align-items: center; gap: 8px;
    box-shadow: var(--shadow-lg);
    max-width: 640px; margin: 2rem auto 0;
}
.hero-search-box input {
    border: none; outline: none; flex: 1;
    font-size: 16px; color: var(--gray-900);
    background: transparent;
}
.hero-search-box input::placeholder { color: var(--gray-400); }
.btn-hero-search {
    background: var(--pt-700);
    color: var(--white);
    border: none;
    border-radius: var(--radius-lg);
    padding: 0.65rem 1.5rem;
    font-weight: 600;
    font-size: 15px;
    transition: background var(--transition), transform var(--transition);
    white-space: nowrap;
}
.btn-hero-search:hover { background: var(--pt-800); color: var(--white); transform: scale(1.02); }

/* --- Cards de Vídeo --- */
.video-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: transform var(--transition), box-shadow var(--transition);
    height: 100%;
    display: flex; flex-direction: column;
}
.video-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.video-thumb {
    position: relative;
    padding-top: 56.25%;
    overflow: hidden;
    background: var(--gray-200);
}
.video-thumb img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.video-card:hover .video-thumb img { transform: scale(1.04); }

.play-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(4,44,83,.35);
    opacity: 0; transition: opacity var(--transition);
}
.video-card:hover .play-overlay { opacity: 1; }
.play-btn-overlay {
    width: 52px; height: 52px;
    background: var(--white);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--pt-700);
    font-size: 22px;
    transform: scale(0.85);
    transition: transform var(--transition);
}
.video-card:hover .play-btn-overlay { transform: scale(1); }

.video-badge-vis {
    position: absolute; top: 10px; right: 10px;
    font-size: 11px; font-weight: 600;
    padding: 3px 8px; border-radius: 20px;
    background: rgba(4,44,83,.75);
    color: var(--white);
    backdrop-filter: blur(4px);
}

.video-card-body {
    padding: 1rem 1.1rem;
    flex: 1; display: flex; flex-direction: column;
}
.video-card-cat {
    font-size: 11px; font-weight: 600;
    color: var(--pt-700);
    text-transform: uppercase; letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
}
.video-card-title {
    font-size: 14px; font-weight: 600;
    color: var(--gray-900); line-height: 1.4;
    margin-bottom: 0.4rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.video-card-desc {
    font-size: 12px; color: var(--gray-500);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}
.video-card-footer {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 0.75rem; padding-top: 0.75rem;
    border-top: 1px solid var(--gray-100);
}
.video-card-author { font-size: 12px; color: var(--gray-500); }
.video-card-views  { font-size: 12px; color: var(--gray-400); }

/* --- Badges de categoria --- */
.cat-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 0.45rem 1rem;
    border-radius: 50px;
    font-size: 13px; font-weight: 500;
    background: var(--pt-50);
    color: var(--pt-800);
    border: 1px solid var(--pt-200);
    transition: all var(--transition);
    cursor: pointer;
}
.cat-badge:hover, .cat-badge.active {
    background: var(--pt-700);
    color: var(--white);
    border-color: var(--pt-700);
}

/* --- Planos --- */
.plano-card {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: 2rem 1.75rem;
    text-align: center;
    transition: all var(--transition);
    position: relative;
    height: 100%;
}
.plano-card:hover { border-color: var(--pt-400); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.plano-card.destaque {
    border-color: var(--pt-700);
    box-shadow: 0 0 0 4px rgba(24,95,165,.12);
}
.plano-destaque-badge {
    position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
    background: var(--pt-700); color: var(--white);
    font-size: 12px; font-weight: 600;
    padding: 4px 16px; border-radius: 20px;
    white-space: nowrap;
}
.plano-preco { font-size: 2.4rem; font-weight: 700; color: var(--pt-800); }
.plano-preco span { font-size: 14px; font-weight: 400; color: var(--gray-500); }
.plano-feature {
    display: flex; align-items: center; gap: 10px;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 14px; text-align: left;
}
.plano-feature .bi-check-circle-fill { color: var(--pt-600); }
.plano-feature .bi-x-circle { color: var(--gray-300); }

/* --- Botões principais --- */
.btn-primary {
    background: var(--pt-700);
    border-color: var(--pt-700);
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition);
}
.btn-primary:hover { background: var(--pt-800); border-color: var(--pt-800); transform: translateY(-1px); }
.btn-outline-primary { border-color: var(--pt-700); color: var(--pt-700); border-radius: var(--radius-md); font-weight: 500; }
.btn-outline-primary:hover { background: var(--pt-700); border-color: var(--pt-700); }

/* --- Seções --- */
.section-title { font-size: 1.5rem; font-weight: 700; color: var(--gray-900); }
.section-sub   { color: var(--gray-500); font-size: 15px; }
.section-divider { width: 48px; height: 4px; background: var(--pt-700); border-radius: 2px; margin: 0.5rem 0 0; }

/* --- Player de vídeo --- */
.video-player-wrapper {
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.video-player-wrapper iframe {
    width: 100%; aspect-ratio: 16/9; display: block; border: none;
}

/* --- Painel Usuário e Admin --- */
.sidebar-playtema {
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    min-height: calc(100vh - 70px);
    padding: 1.5rem 0;
    width: 250px;
    flex-shrink: 0;
}
.sidebar-brand {
    padding: 0 1.25rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
    margin-bottom: 0.75rem;
}
.sidebar-label {
    font-size: 10px; font-weight: 700;
    color: var(--gray-400);
    text-transform: uppercase; letter-spacing: 0.1em;
    padding: 0.75rem 1.25rem 0.25rem;
}
.sidebar-link {
    display: flex; align-items: center; gap: 10px;
    padding: 0.6rem 1.25rem;
    color: var(--gray-600);
    font-size: 14px; font-weight: 500;
    border-radius: 0;
    transition: all var(--transition);
    border-left: 3px solid transparent;
}
.sidebar-link:hover { color: var(--pt-700); background: var(--pt-50); }
.sidebar-link.active { color: var(--pt-700); background: var(--pt-50); border-left-color: var(--pt-700); }
.sidebar-link i { font-size: 16px; width: 20px; text-align: center; }

.panel-layout { display: flex; min-height: calc(100vh - 70px); }
.panel-content { flex: 1; padding: 2rem; background: var(--gray-50); overflow-x: hidden; }

/* --- Cards de métricas admin --- */
.metric-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex; align-items: center; gap: 1rem;
}
.metric-icon {
    width: 52px; height: 52px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.metric-icon.blue   { background: var(--pt-100); color: var(--pt-700); }
.metric-icon.green  { background: #d1fae5; color: #065f46; }
.metric-icon.amber  { background: #fef3c7; color: #92400e; }
.metric-icon.purple { background: #ede9fe; color: #5b21b6; }
.metric-value { font-size: 1.8rem; font-weight: 700; color: var(--gray-900); line-height: 1; }
.metric-label { font-size: 13px; color: var(--gray-500); margin-top: 4px; }
.metric-delta { font-size: 12px; font-weight: 500; }
.metric-delta.up   { color: #059669; }
.metric-delta.down { color: #dc2626; }

/* --- Tabelas admin --- */
.table-playtema { border-collapse: separate; border-spacing: 0; }
.table-playtema thead th {
    background: var(--gray-50);
    font-size: 12px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--gray-500);
    border-bottom: 1px solid var(--gray-200);
    padding: 0.85rem 1rem;
    white-space: nowrap;
}
.table-playtema tbody td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
    font-size: 14px;
}
.table-playtema tbody tr:last-child td { border-bottom: none; }
.table-playtema tbody tr:hover { background: var(--pt-50); }

/* --- Status badges --- */
.status-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 20px;
    font-size: 12px; font-weight: 600;
}
.status-badge.ativo     { background: #d1fae5; color: #065f46; }
.status-badge.inativo   { background: var(--gray-100); color: var(--gray-500); }
.status-badge.banido    { background: #fee2e2; color: #991b1b; }
.status-badge.publico   { background: var(--pt-100); color: var(--pt-800); }
.status-badge.privado   { background: var(--gray-100); color: var(--gray-600); }
.status-badge.pago      { background: #d1fae5; color: #065f46; }
.status-badge.pendente  { background: #fef3c7; color: #92400e; }
.status-badge.cancelada { background: #fee2e2; color: #991b1b; }

/* --- Formulários --- */
.form-playtema .form-label { font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 0.4rem; }
.form-playtema .form-control, .form-playtema .form-select {
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 0.6rem 0.9rem;
    font-size: 14px;
    color: var(--gray-900);
    transition: border-color var(--transition), box-shadow var(--transition);
    background: var(--white);
}
.form-playtema .form-control:focus, .form-playtema .form-select:focus {
    border-color: var(--pt-500);
    box-shadow: 0 0 0 3px rgba(55,138,221,.15);
    outline: none;
}
.form-playtema .form-text { font-size: 12px; color: var(--gray-400); }

/* --- Auth pages --- */
.auth-wrapper {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(160deg, var(--pt-900) 0%, var(--pt-800) 50%, var(--pt-50) 100%);
    padding: 2rem 1rem;
}
.auth-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    width: 100%; max-width: 440px;
    box-shadow: var(--shadow-lg);
}
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo .logo-text { font-size: 1.6rem; }

/* --- Footer --- */
.footer-playtema {
    background: linear-gradient(160deg, var(--pt-900) 0%, var(--pt-800) 100%);
    color: rgba(255,255,255,.80);
    margin-top: auto;
}
.logo-icon-footer {
    width: 32px; height: 32px;
    background: rgba(255,255,255,.15);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
}
.footer-brand { font-size: 1.2rem; font-weight: 700; color: var(--white); }
.footer-accent { color: var(--pt-400); }
.footer-desc { font-size: 13px; color: rgba(255,255,255,.60); line-height: 1.6; }
.footer-heading { font-size: 13px; font-weight: 700; color: var(--white); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 1rem; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 0.5rem; }
.footer-links a { font-size: 13px; color: rgba(255,255,255,.65); transition: color var(--transition); }
.footer-links a:hover { color: var(--white); }
.footer-social { color: rgba(255,255,255,.60); font-size: 18px; transition: color var(--transition); }
.footer-social:hover { color: var(--pt-300); }
.footer-divider { border-color: rgba(255,255,255,.1); }
.footer-copy { font-size: 13px; color: rgba(255,255,255,.50); }
.footer-newsletter .form-control {
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    color: var(--white); font-size: 13px;
    border-radius: var(--radius-md);
}
.footer-newsletter .form-control::placeholder { color: rgba(255,255,255,.4); }
.footer-newsletter .form-control:focus { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.4); box-shadow: none; color: var(--white); }

/* --- Utilitários --- */
.card-playtema {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}
.avatar-lg {
    width: 56px; height: 56px;
    background: var(--pt-700);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; font-weight: 700; color: var(--white);
}
.empty-state { text-align: center; padding: 4rem 2rem; color: var(--gray-400); }
.empty-state i { font-size: 3.5rem; display: block; margin-bottom: 1rem; }

/* --- Paginação --- */
.pagination .page-link {
    color: var(--pt-700);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
    margin: 0 2px;
    font-size: 14px;
}
.pagination .page-item.active .page-link { background: var(--pt-700); border-color: var(--pt-700); }

/* --- Responsivo --- */
@media (max-width: 768px) {
    .hero-title { font-size: 1.8rem; }
    .panel-layout { flex-direction: column; }
    .sidebar-playtema { width: 100%; min-height: auto; border-right: none; border-bottom: 1px solid var(--gray-200); }
    .panel-content { padding: 1.25rem; }
    .auth-card { padding: 1.75rem 1.25rem; }
}
