/* ==========================================================================
   1. LAYOUT GLOBAL E ESTRUTURA
   ========================================================================== */
:root {
    /* Assumindo que estas variáveis já existem no seu :root principal */
}

.main-wrapper {
    display: grid;
    grid-template-columns: 7fr 3fr;
    gap: 25px;
    padding: 2rem 2%;
    max-width: 98%;
    margin: 0 auto;
}

.content-area {
    min-width: 0;
}

/* ==========================================================================
   2. SEÇÕES E CABEÇALHOS
   ========================================================================== */
.section-header {
    border-left: 5px solid var(--primary-green);
    padding-left: 15px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title {
    font-family: var(--font-righteous);
    font-size: 1.4rem;
    text-transform: uppercase;
}

/* ==========================================================================
   3. GRID DE ANIMES E CARDS (HOME)
   ========================================================================== */
.anime-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.anime-card {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #222;
    position: relative;
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    aspect-ratio: 2/3;
}

.anime-card:hover {
    transform: scale(1.05);
    border-color: var(--primary-green);
    box-shadow: 0 10px 20px rgba(0,0,0,0.6);
    z-index: 10;
}

.anime-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Badges e Selos */
.ep-badge, .rating-badge {
    position: absolute;
    top: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 800;
    z-index: 5;
}

.ep-badge {
    left: 10px;
    background: var(--primary-green);
    color: #000;
    font-size: 0.8rem;
}

.rating-badge {
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: var(--accent-gold);
    font-size: 0.75rem;
    border: 1px solid var(--accent-gold);
    display: flex;
    align-items: center;
    gap: 3px;
}

.anime-card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 40px 10px 12px 10px;
    background: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0.8) 50%, transparent 100%);
    pointer-events: none;
    display: flex;
    align-items: flex-end;
    min-height: 80px;
}

.anime-card-title {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-white);
    text-align: center;
    width: 100%;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.9);
    transition: 0.3s;
    word-wrap: break-word;
}

.anime-card:hover .anime-card-title {
    color: var(--primary-green);
    transform: translateY(-2px);
}

/* ==========================================================================
   4. SIDEBAR - ESTRUTURA E PESQUISA
   ========================================================================== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.sidebar-box {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 15px;
    border: 1px solid #222;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.sidebar-title {
    font-family: var(--font-righteous);
    font-size: 1.2rem;
    text-transform: uppercase;
    color: var(--primary-green);
    margin-bottom: 20px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
    letter-spacing: 1px;
}

.sidebar-search-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
}

.sidebar-search {
    width: 100%;
    padding: 8px 35px 8px 12px;
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 4px;
    color: white;
    font-size: 0.85rem;
    outline: none;
}

.sidebar-search:focus { border-color: var(--primary-green); }

.btn-clear-sidebar {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-gray);
    cursor: pointer;
    font-size: 1.2rem;
    display: none;
    transition: 0.2s;
    line-height: 1;
}

.btn-clear-sidebar:hover { color: var(--primary-green); }

/* ==========================================================================
   5. COMPONENTES DA SIDEBAR (LISTAS E CALENDÁRIO)
   ========================================================================== */

/* Truncamento Universal para Sidebar */
.download-item .download-name,
.calendar-item .cal-name,
.site-item .cal-name {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

/* Download e Episódios */
.download-item-wrapper { border-bottom: 1px solid #1a1a1a; }
.download-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    gap: 10px;
}

.download-name { font-size: 0.9rem; font-weight: 600; color: var(--text-white); flex: 1; }

.btn-download {
    background: #1a1a1a;
    color: var(--primary-green);
    border: 1px solid var(--primary-green);
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.3s;
    font-weight: bold;
}

.btn-download.active { background: var(--primary-green); color: #000; }

.download-options {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    background: #0a0a0a;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.download-options.show { max-height: 500px; padding: 10px; margin-bottom: 10px; border-radius: 6px; }

.btn-server {
    background: #1a1a1a;
    border: 1px solid #333;
    color: #ccc;
    padding: 6px;
    font-size: 0.7rem;
    text-align: center;
    border-radius: 4px;
    transition: 0.2s;
}

.btn-server:hover { border-color: var(--accent-orange); color: var(--accent-orange); }

/* Calendário e Sites */
.calendar-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0px 10px;
    border-bottom: 1px solid #1a1a1a;
    gap: 10px;
    margin: 0 -10px;
}

.site-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-bottom: 1px solid #1a1a1a;
    gap: 10px;
    margin: 0 -10px;
}

.calendar-item.released, .site-item.released {
    background: rgba(46, 248, 97, 0.05);
    border-left: 4px solid var(--primary-green);
}

.cal-name { font-size: 0.95rem; font-weight: 600; flex: 1; color: var(--text-white); line-height: 1.3; }

.cal-info { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.cal-time {
    background: #000;
    color: var(--accent-orange);
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid #333;
    font-weight: 700;
}

/* Favoritos e Estatísticas */
.fav-item { display: flex; gap: 12px; margin-bottom: 15px; align-items: center; }
.fav-img { width: 45px; height: 60px; border-radius: 4px; object-fit: cover; border: 1px solid #333; }
.fav-name { font-size: 0.9rem; font-weight: 700; color: var(--text-white); display: block; margin-bottom: 4px; }
.fav-progress-bg { width: 100%; height: 6px; background: #222; border-radius: 10px; }
.fav-progress-fill { height: 100%; background: var(--primary-green); border-radius: 10px; }

.stats-box-single {
    display: block;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #222;
    border-radius: 8px;
    text-align: center;
    transition: 0.3s ease;
    padding: 10px;
}

.stats-box-single:hover {
    border-color: var(--primary-green);
    background: rgba(46, 248, 97, 0.05);
}

.stat-value-large {
    display: block;
    font-family: var(--font-righteous);
    font-size: 1.6rem;
    color: var(--primary-green);
    text-shadow: 0 0 10px rgba(46, 248, 97, 0.3);
    line-height: 1;
}

.stat-label-sub {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-gray);
    letter-spacing: 2px;
    margin-top: 8px;
    font-weight: 700;
}

/* ==========================================================================
   6. COMPONENTES EXTRA (BANNER, SUGESTÕES, BOTÕES)
   ========================================================================== */
.welcome-banner {
    width: 100%;
    height: 320px;
    background: url('/img/banner-small.png') no-repeat center center;
    background-size: contain;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid #222;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.banner-overlay {
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex; align-items: center; justify-content: center;
}

.banner-text { display: none; text-align: center; }

.load-more-container { display: flex; justify-content: center; margin: 20px 0 50px 0; }

.btn-load-more {
    background: transparent;
    color: var(--primary-green);
    border: 2px solid var(--primary-green);
    padding: 10px 30px;
    border-radius: 5px;
    font-family: var(--font-righteous);
    text-transform: uppercase;
    cursor: pointer;
    transition: 0.3s;
}

.btn-load-more:hover { background: var(--primary-green); color: #000; }

/* Sugestões */
.suggestion-box { border-top: 2px solid var(--primary-green); }
.suggestion-text { font-size: 0.8rem; color: var(--text-gray); margin-bottom: 15px; line-height: 1.4; }
.suggestion-form { display: flex; flex-direction: column; }
#siteSuggestion { padding-right: 12px !important; margin-bottom: 0; }

.success-message {
    display: none;
    color: var(--primary-green);
    text-align: center;
    margin-top: 15px;
    font-size: 0.85rem;
    font-weight: bold;
    background: rgba(46, 248, 97, 0.1);
    padding: 10px;
    border-radius: 5px;
    border: 1px solid var(--primary-green);
    animation: fadeIn 0.4s ease-out;
}

/* ==========================================================================
   7. ANIMAÇÕES
   ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseCheck {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; }
}

/* ==========================================================================
   8. RESPONSIVIDADE (MEDIA QUERIES)
   ========================================================================== */
@media (max-width: 1100px) {
    .main-wrapper { grid-template-columns: 1fr; }
    .anime-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 900px) {
    .anime-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .welcome-banner { height: 200px; }
}

@media (max-width: 600px) {
    .anime-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .download-item .download-name,
    .calendar-item .cal-name { max-width: 275px; }
}

@media (max-width: 420px) {
    .main-wrapper { padding: 1rem 3%; }
    .anime-grid { gap: 12px; }
    .anime-card-title { font-size: 0.7rem; }
    .ep-badge, .rating-badge { font-size: 0.65rem; top: 5px; left: 5px; }
    .welcome-banner { height: 150px; }
}


/* Estilo Base do Botão */
.btn-quick-search {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 8px; /* Quadrado levemente arredondado fica mais moderno */
    background: rgba(0, 0, 0, 0.4); /* Bem transparente */
    backdrop-filter: blur(4px); /* Efeito de vidro fosco */
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0; /* Invisível por padrão */
    transform: translateY(-5px); /* Deslocado para efeito de entrada */
}

/* Efeito ao passar o mouse no CARD */
.anime-card:hover .btn-quick-search {
    opacity: 1;
    transform: translateY(0);
}

/* Efeito ao passar o mouse no BOTÃO */
.btn-quick-search:hover {
    background: var(--primary-green);
    color: #000;
    border-color: var(--primary-green);
    box-shadow: 0 0 15px rgba(46, 248, 97, 0.4);
}

/* Ícone do Font Awesome */
.btn-quick-search i {
    font-size: 0.9rem;
}


/* Estilo comum para ambos os botões dinâmicos */
.btn-quick-search, .btn-quick-play {
    position: absolute;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0; /* Invisível por padrão */
}

/* Posicionamento Individual */
.btn-quick-search {
    top: 10px; /* Busca em cima */
    transform: translateX(10px);
}

.btn-quick-play {
    top: 48px; /* Player logo abaixo da busca */
    transform: translateX(10px);
}

/* Aparecer no Hover do Card */
.anime-card:hover .btn-quick-search,
.anime-card:hover .btn-quick-play {
    opacity: 1;
    transform: translateX(0);
}

/* Hover específico nos botões */
.btn-quick-play:hover {
    background: var(--accent-orange); /* Ou var(--primary-green) */
    color: #000;
    border-color: var(--accent-orange);
}

.btn-quick-search:hover {
    background: var(--primary-green);
    color: #000;
    border-color: var(--primary-green);
}

/* Ajuste no ícone de play para centralizar melhor visualmente */
.btn-quick-play i {
    font-size: 0.8rem;
    margin-left: 2px; /* Correção óptica para o triângulo do play */
}