/* Reset e Variáveis */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --brand-1: #0A84FF;
    --brand-2: #2563EB;
    --brand-3: #00D4FF;
    --bg: #030711;
    --bg-secondary: #0a0a0f;
    --text: #E6F0FF;
    --muted: #A8C2F0;
    --ok: #34C759;
    --warn: #FFB020;
    --err: #FF453A;
    --card-bg: rgba(15, 23, 42, 0.6);
    --border: rgba(100, 150, 255, 0.15);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 12px 48px rgba(10, 132, 255, 0.25);
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Background Gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 30%, rgba(10, 132, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(0, 212, 255, 0.12) 0%, transparent 50%),
        var(--bg);
    z-index: -1;
    pointer-events: none;
}

/* Hero Header com Background TMDB */
.hero-cover {
    position: relative;
    min-height: 320px;
    padding: 48px 20px 56px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-bottom: 1px solid var(--border);
    margin-bottom: 48px;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(3, 7, 17, 0.96) 0%,
        rgba(10, 132, 255, 0.35) 50%,
        rgba(0, 212, 255, 0.25) 100%
    );
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--brand-1), var(--brand-3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 36px;
    text-align: center;
    letter-spacing: -0.02em;
}

/* Hero User Section (Avatar estilo Twitter) */
.hero-user-section {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 32px;
    justify-content: center;
}

.hero-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-1), var(--brand-3));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 700;
    box-shadow: 0 8px 32px rgba(10, 132, 255, 0.5), 0 0 0 4px rgba(10, 132, 255, 0.1);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.hero-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(10, 132, 255, 0.6), 0 0 0 4px rgba(10, 132, 255, 0.2);
}

.hero-user-info {
    text-align: left;
}

.welcome-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.welcome-subtitle {
    font-size: 1.05rem;
    color: var(--muted);
    font-weight: 400;
}

.hero-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-icon, .btn-card, .btn-card-secondary {
    padding: 13px 26px;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    color: white;
    box-shadow: var(--shadow-md), 0 4px 20px rgba(10, 132, 255, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 6px 28px rgba(10, 132, 255, 0.45);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: var(--brand-1);
    transform: translateY(-1px);
}

.btn-secondary:active {
    transform: translateY(0);
}

/* Botão Icon (Sininho) */
.btn-icon {
    width: 50px;
    height: 50px;
    padding: 0;
    justify-content: center;
    position: relative;
}

.btn-notification {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn-notification:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: var(--brand-1);
    transform: translateY(-2px);
}

.btn-notification:active {
    transform: translateY(0);
}

.btn-notification i {
    transition: transform 0.3s ease;
}

.btn-notification:hover i {
    transform: rotate(15deg);
}

.pulse-dot {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    background: var(--ok);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.6);
    animation: bellPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes bellPulse {
    0% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.6);
    }
    50% {
        opacity: 0.8;
        transform: scale(0.95);
        box-shadow: 0 0 0 4px rgba(52, 199, 89, 0);
    }
    100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(52, 199, 89, 0);
    }
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

.group-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}

.group-subtitle {
    font-size: 0.95rem;
    color: var(--muted);
    margin-bottom: 24px;
}

/* Card de Status dos Serviços */
.status-summary-card {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.12), rgba(10, 132, 255, 0.06));
    border: 1px solid rgba(52, 199, 89, 0.35);
    border-radius: 18px;
    padding: 28px;
    margin-bottom: 48px;
    display: flex;
    gap: 24px;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.status-summary-card:hover {
    border-color: rgba(52, 199, 89, 0.5);
    box-shadow: var(--shadow-md), 0 0 30px rgba(52, 199, 89, 0.15);
}

.status-summary-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--ok), #5ECC7B);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(52, 199, 89, 0.3);
}

.status-summary-icon i {
    width: 30px;
    height: 30px;
    color: white;
}

.status-summary-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 14px;
    letter-spacing: -0.01em;
}

.status-summary-list {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.status-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--ok);
}

.status-item i {
    width: 18px;
    height: 18px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

/* Dashboard Card */
.dashboard-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 28px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.dashboard-card:hover {
    transform: translateY(-6px);
    border-color: var(--brand-1);
    box-shadow: var(--shadow-xl);
}

.dashboard-card.card-highlight {
    border-color: var(--brand-1);
    background: linear-gradient(135deg, rgba(10, 132, 255, 0.12), var(--card-bg));
}

.dashboard-card.card-highlight:hover {
    box-shadow: var(--shadow-xl), 0 0 40px rgba(10, 132, 255, 0.2);
}

.dashboard-card.card-telegram {
    border-color: var(--brand-3);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.12), var(--card-bg));
}

.dashboard-card.card-telegram:hover {
    box-shadow: var(--shadow-xl), 0 0 40px rgba(0, 212, 255, 0.2);
}

.dashboard-card.card-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dashboard-card.card-disabled:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand-1), var(--brand-3));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px rgba(10, 132, 255, 0.3);
    transition: transform 0.3s ease;
}

.dashboard-card:hover .card-icon {
    transform: scale(1.05);
}

.card-icon i {
    width: 30px;
    height: 30px;
    color: white;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.card-description {
    font-size: 0.95rem;
    color: var(--muted);
    margin-bottom: 24px;
    line-height: 1.5;
}

.card-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-card {
    flex: 1;
    padding: 12px 18px;
    background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
    color: white;
    font-size: 0.9rem;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(10, 132, 255, 0.25);
}

.btn-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(10, 132, 255, 0.4);
}

.btn-card:active {
    transform: translateY(0);
}

.btn-card:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-card:disabled:hover {
    transform: none;
}

.btn-card-secondary {
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border: 1px solid var(--border);
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn-card-secondary:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: var(--brand-1);
    transform: translateY(-1px);
}

.btn-card-secondary:active {
    transform: translateY(0);
}

.card-footer {
    border-top: 1px solid var(--border);
    padding-top: 18px;
    display: flex;
    justify-content: flex-end;
}

.card-link {
    color: var(--brand-1);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.25s ease;
}

.card-link:hover {
    gap: 10px;
    color: var(--brand-3);
}

.card-link i {
    transition: transform 0.25s ease;
}

.card-link:hover i {
    transform: translateX(2px);
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal.visible {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.modal-content {
    position: relative;
    z-index: 1001;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 24px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl), 0 0 60px rgba(10, 132, 255, 0.2);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(40px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.top5-modal {
    max-width: 1000px;
}

.modal-header {
    padding: 28px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.modal-close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    padding: 10px;
    border-radius: 10px;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--brand-1);
    transform: rotate(90deg);
}

.modal-close:active {
    transform: rotate(90deg) scale(0.95);
}

.modal-body {
    padding: 28px;
}

/* Top 5 Grid */
.top5-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
}

.top5-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--brand-1);
    letter-spacing: -0.01em;
}

.top5-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.top5-item {
    display: flex;
    gap: 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 14px;
    padding: 14px;
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.top5-item:hover {
    border-color: var(--brand-1);
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.top5-rank {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--brand-1), var(--brand-3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    min-width: 45px;
    text-align: center;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.top5-poster {
    width: 65px;
    height: 95px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--bg-secondary);
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease;
}

.top5-item:hover .top5-poster {
    transform: scale(1.05);
}

.top5-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.top5-item-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: -0.01em;
}

.top5-meta {
    display: flex;
    gap: 14px;
    font-size: 0.9rem;
    color: var(--muted);
}

.top5-year, .top5-rating {
    display: flex;
    align-items: center;
    gap: 5px;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--muted);
    gap: 12px;
}

.loading-spinner i {
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Custom Scrollbar */
.modal-content::-webkit-scrollbar {
    width: 10px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(10, 132, 255, 0.3);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(10, 132, 255, 0.5);
    background-clip: padding-box;
}

/* Selection Color */
::selection {
    background: rgba(10, 132, 255, 0.3);
    color: var(--text);
}

::-moz-selection {
    background: rgba(10, 132, 255, 0.3);
    color: var(--text);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-cover {
        padding: 40px 16px;
        min-height: 250px;
    }

    .hero-user-section {
        flex-direction: column;
        text-align: center;
    }

    .hero-user-info {
        text-align: center;
    }

    .welcome-title {
        font-size: 1.5rem;
    }

    .hero-avatar {
        width: 70px;
        height: 70px;
        font-size: 1.6rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 0 14px 40px;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .hero-actions a,
    .hero-actions button {
        width: 100%;
        justify-content: center;
    }

    .top5-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .status-summary-card {
        flex-direction: column;
        text-align: center;
    }

    .status-summary-list {
        flex-direction: column;
        gap: 12px;
    }
}
