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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #141414;
    color: #fff;
    overflow-x: hidden;
}

/* Header estilo Netflix */
.header {
    background: linear-gradient(180deg, rgba(0,0,0,0.7) 80%, transparent);
    padding: 25px 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

@media (max-width: 768px) {
    .header {
        background: linear-gradient(180deg, rgba(0,0,0,0.7) 80%, transparent);
        padding: 10px 20px;
    }

    .hero-banner {
        margin-top: 0px !important;
    }

    .category-section {
        padding: 0px 20px 20px !important;
    }

}

.logo {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(90deg, #E50914 0%, #B20710 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo img {
    width: 150px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Botão LIVE */
.live-button {
    background: #E50914;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: pulse 2s infinite;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

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

.refresh-button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.refresh-button:active {
    transform: scale(0.9);
    background: rgba(255,255,255,0.2);
}

.refresh-button.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.user-info:hover {
    background: rgba(255,255,255,0.15);
}

.user-info:active {
    transform: scale(0.95);
}

.user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

/* Hero Banner */
.hero-banner {
    margin-top: 100px;
    height: 290px;
    background: linear-gradient(to bottom, transparent, #141414),
                url('assets/img/banner.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 40px 20px;
    position: relative;
}

.hero-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.hero-description {
    font-size: 16px;
    color: #e5e5e5;
    margin-bottom: 20px;
    max-width: 500px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.hero-status {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(76, 175, 80, 0.9);
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.button-secondary {
    padding: 10px 20px;
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.button-secondary:hover {
    background: rgba(255,255,255,0.3);
}

.button-secondary:active {
    transform: scale(0.98);
}

/* Seção de Categorias */
.category-section {
    padding: 40px 20px 20px;
}

.category-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #e5e5e5;
}

.category-wrapper {
    position: relative;
}

.category-row {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 16px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.category-row::-webkit-scrollbar {
    display: none;
}

/* Botões de navegação do carrossel */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s;
}

.carousel-nav:hover {
    background: rgba(229, 9, 20, 0.9);
    border-color: #E50914;
    transform: translateY(-50%) scale(1.1);
}

.carousel-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-nav-left {
    left: -20px;
}

.carousel-nav-right {
    right: -20px;
}

.carousel-nav.hidden {
    display: none !important;
}

/* Mostrar botões apenas em desktop */
@media (min-width: 768px) {
    .carousel-nav {
        display: flex;
    }

    .category-wrapper:hover .carousel-nav {
        opacity: 1;
    }

    .category-section {
        padding: 40px 40px 20px;
    }
}

/* Card de Grupo estilo Netflix */
.group-card {
    min-width: 160px;
    width: 160px;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.3s ease;
    position: relative;
}

.group-card:hover {
    transform: scale(1.05);
}

.group-card:active {
    transform: scale(0.98);
}

.group-image {
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: 8px;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.group-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

/* Lazy loading states */
.group-image img.lazy-image {
    opacity: 0;
}

.group-image img.lazy-image.loaded {
    opacity: 1;
}

.group-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-size: 48px;
}

.group-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(229, 9, 20, 0.9);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.group-name {
    margin-top: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #e5e5e5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.group-description {
    font-size: 12px;
    color: #808080;
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.spinner {
    border: 4px solid rgba(255,255,255,0.1);
    border-top: 4px solid #E50914;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

/* Modal Genérico (Base para os outros) */
.modal-base {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
    overflow-y: auto;
}

.modal-base.active {
    display: flex;
}

/* Modal de Grupo */
.group-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
    overflow-y: auto;
}
.group-modal.active { display: flex; }

/* Modal de Live */
.live-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 400;
}

.live-modal.active {
    display: flex;
}

.live-content {
    width: 100%;
    max-width: 800px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    animation: modalSlideUp 0.3s ease;
}

.live-video-container {
    position: relative;
    padding-bottom: 56.25%; /* Aspect ratio 16:9 */
    height: 0;
    overflow: hidden;
    background: #000;
}

.live-video-container iframe,
.live-video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.live-header {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #141414;
}

.live-title {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.live-badge {
    background: #E50914;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
}

.modal-content {
    background: #181818;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    overflow: hidden;
    animation: modalSlideUp 0.3s ease;
}

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

.modal-header {
    position: relative;
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.8);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.modal-body {
    padding: 24px;
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.modal-description {
    color: #b3b3b3;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.modal-info {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    font-size: 14px;
}

.modal-info-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #b3b3b3;
}

.button-primary {
    width: 100%;
    padding: 14px;
    background: #E50914;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
}

.button-primary:hover {
    background: #f40612;
}

.button-primary:active {
    transform: scale(0.98);
}

/* Modal de Planos */
.plans-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 300;
    padding: 20px;
    overflow-y: auto;
}

.plans-modal.active {
    display: flex;
}

.plans-content {
    background: #181818;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    overflow: hidden;
    animation: modalSlideUp 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

/* Modal de Perfil */
.profile-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 300;
    padding: 20px;
    overflow-y: auto;
}

.profile-modal.active {
    display: flex;
}

.profile-content {
    background: #181818;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    overflow: hidden;
    animation: modalSlideUp 0.3s ease;
    margin-top: 350px;
}

.profile-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 32px 24px;
    text-align: center;
    position: relative;
}

.profile-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: 4px solid rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 700;
    margin: 0 auto 16px;
    color: white;
}

.profile-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
    color: white;
}

.profile-username {
    font-size: 14px;
    color: rgba(255,255,255,0.8);
}

.profile-body {
    padding: 24px;
}

.profile-section {
    margin-bottom: 24px;
}

.profile-section:last-child {
    margin-bottom: 0;
}

.profile-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #808080;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.profile-info-grid {
    display: grid;
    gap: 12px;
}

.profile-info-item {
    background: rgba(255,255,255,0.05);
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profile-info-label {
    color: #b3b3b3;
    font-size: 14px;
}

.profile-info-value {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.profile-plan-card {
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.2) 0%, rgba(229, 9, 20, 0.05) 100%);
    border: 2px solid rgba(229, 9, 20, 0.3);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.profile-plan-badge {
    display: inline-block;
    background: #4CAF50;
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.profile-plan-badge.expired {
    background: #E50914;
}

.profile-plan-name {
    font-size: 22px;
    font-weight: 700;
    color: #E50914;
    margin-bottom: 8px;
}

.profile-plan-validity {
    color: #e5e5e5;
    font-size: 14px;
    margin-bottom: 4px;
}

.profile-plan-days {
    color: #b3b3b3;
    font-size: 13px;
}

.profile-plan-days.warning {
    color: #ff9800;
    font-weight: 600;
}

.profile-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.profile-button {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.profile-button-primary {
    background: #E50914;
    color: white;
}

.profile-button-primary:hover {
    background: #f40612;
}

.profile-button-secondary {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
}

.profile-button-secondary:hover {
    background: rgba(255,255,255,0.15);
}

.profile-button:active {
    transform: scale(0.98);
}

.profile-no-plan {
    text-align: center;
    padding: 32px 16px;
}

.profile-no-plan-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.profile-no-plan-text {
    color: #b3b3b3;
    font-size: 14px;
    margin-bottom: 20px;
}

.plans-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    position: sticky;
    top: 0;
    background: #181818;
    z-index: 1;
}

.plans-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.plans-header p {
    color: #b3b3b3;
    font-size: 14px;
}

.plans-list {
    padding: 24px;
}

.plan-card {
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.3s;
}

.plan-card.current {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

.plan-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 12px;
}

.plan-name {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

.plan-badge {
    background: #4CAF50;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.plan-price {
    font-size: 28px;
    font-weight: 700;
    color: #E50914;
    margin-bottom: 8px;
}

.plan-duration {
    color: #b3b3b3;
    font-size: 14px;
    margin-bottom: 16px;
}

.plan-features {
    list-style: none;
    margin-bottom: 16px;
}

.plan-features li {
    color: #e5e5e5;
    font-size: 14px;
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.plan-features li:before {
    content: "✓";
    color: #4CAF50;
    font-weight: 700;
    font-size: 16px;
}

.plan-groups {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.plan-groups-title {
    font-size: 12px;
    color: #b3b3b3;
    margin-bottom: 8px;
    text-transform: uppercase;
    font-weight: 600;
}

.plan-groups-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.plan-group-tag {
    background: rgba(255,255,255,0.1);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    color: #e5e5e5;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-description {
    color: #808080;
    font-size: 14px;
}