/* =====================================================
   APP STORE - CSS MODERNO E RESPONSIVO
   Inspirado em Play Store / iOS App Store
   Suporte completo para TV Box / Controle Remoto
   ===================================================== */

/* Variáveis CSS */
:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.1);
    --bg-dark: #0f0f1a;
    --bg-dark-secondary: #1a1a2e;
    --bg-dark-card: #16162a;
    --bg-light: #f5f7fa;
    --bg-light-secondary: #ffffff;
    --bg-light-card: #ffffff;
    --text-dark: #ffffff;
    --text-dark-muted: #a0a0b0;
    --text-light: #1a1a2e;
    --text-light-muted: #6b7280;
    --border-dark: rgba(255, 255, 255, 0.1);
    --border-light: rgba(0, 0, 0, 0.1);
    --shadow-dark: 0 10px 40px rgba(0, 0, 0, 0.5);
    --shadow-light: 0 10px 40px rgba(0, 0, 0, 0.1);
    --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, #8b5cf6 100%);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    --border-radius: 16px;
    --border-radius-sm: 12px;
    --border-radius-lg: 24px;
}

/* Reset e Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Temas */
body.theme-dark {
    background: var(--bg-dark);
    color: var(--text-dark);
}

body.theme-light {
    background: var(--bg-light);
    color: var(--text-light);
}

/* Links */
a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

/* Imagens */
img {
    max-width: 100%;
    height: auto;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =====================================================
   HEADER
   ===================================================== */
.header {
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

body.theme-dark .header {
    background: rgba(15, 15, 26, 0.9);
    border-bottom: 1px solid var(--border-dark);
}

body.theme-light .header {
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid var(--border-light);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo img {
    height: 45px;
    width: auto;
    border-radius: var(--border-radius-sm);
}

.logo-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* =====================================================
   HERO SECTION
   ===================================================== */
.hero {
    padding: 60px 0;
    text-align: center;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 16px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

body.theme-dark .hero p {
    color: var(--text-dark-muted);
}

body.theme-light .hero p {
    color: var(--text-light-muted);
}

/* =====================================================
   GRID DE APPS
   ===================================================== */
.apps-section {
    padding: 40px 0 80px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 28px;
    background: var(--gradient-primary);
    border-radius: 4px;
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* =====================================================
   APP CARD
   ===================================================== */
.app-card {
    border-radius: var(--border-radius);
    padding: 24px;
    transition: var(--transition-normal);
    cursor: pointer;
    position: relative;
    outline: none;
    transform: scale(1);
}

body.theme-dark .app-card {
    background: var(--bg-dark-card);
    border: 2px solid transparent;
}

body.theme-light .app-card {
    background: var(--bg-light-card);
    border: 2px solid var(--border-light);
    box-shadow: var(--shadow-light);
}

/* Hover e Focus para TV/Controle */
.app-card:hover,
.app-card:focus,
.app-card.focused {
    transform: scale(1.05);
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 4px var(--primary-light), 0 20px 40px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

body.theme-dark .app-card:hover,
body.theme-dark .app-card:focus,
body.theme-dark .app-card.focused {
    background: var(--bg-dark-secondary);
}

/* Animação de pulso no foco (TV) */
.app-card.focused::after {
    content: '';
    position: absolute;
    inset: -4px;
    border: 2px solid var(--primary-color);
    border-radius: calc(var(--border-radius) + 4px);
    animation: pulse-border 1.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulse-border {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.02);
    }
}

.app-card-content {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.app-icon {
    width: 80px;
    height: 80px;
    border-radius: var(--border-radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
}

.app-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
}

.app-info {
    flex: 1;
    min-width: 0;
}

.badge-pc {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 2px 7px;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 6px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff;
    text-transform: uppercase;
}

.app-detail-name .badge-pc {
    font-size: 0.7rem;
    padding: 3px 9px;
}

.app-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-description {
    font-size: 0.9rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body.theme-dark .app-description {
    color: var(--text-dark-muted);
}

body.theme-light .app-description {
    color: var(--text-light-muted);
}

/* =====================================================
   PÁGINA DE DETALHES DO APP
   ===================================================== */
.app-detail {
    padding: 40px 0 80px;
}

.app-detail-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 40px;
}

.app-detail-left {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    flex-shrink: 0;
    width: 360px;
}

.app-detail-carousel {
    flex: 0 0 auto;
    width: 520px;
    max-width: calc(100% - 420px);
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.app-detail-icon {
    width: 150px;
    height: 150px;
    border-radius: var(--border-radius-lg);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: white;
}

.app-detail-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--border-radius-lg);
}

.app-detail-info {
    flex: 1;
    min-width: 280px;
}

.app-detail-name {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.app-detail-short-desc {
    font-size: 1.1rem;
    margin-bottom: 24px;
}

body.theme-dark .app-detail-short-desc {
    color: var(--text-dark-muted);
}

body.theme-light .app-detail-short-desc {
    color: var(--text-light-muted);
}

/* Botão de Download */
.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 40px;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    background: var(--gradient-primary);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition-normal);
    outline: none;
    text-decoration: none;
}

.btn-download:hover,
.btn-download:focus,
.btn-download.focused {
    transform: scale(1.05);
    box-shadow: 0 0 0 4px var(--primary-light), 0 10px 30px rgba(99, 102, 241, 0.4);
}

.btn-download.focused::after {
    content: '';
    position: absolute;
    inset: -4px;
    border: 2px solid white;
    border-radius: 54px;
    animation: pulse-border 1.5s ease-in-out infinite;
    pointer-events: none;
}

.btn-download svg {
    width: 24px;
    height: 24px;
}

.btn-download.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Screenshots */
.screenshots-section {
    margin-bottom: 40px;
}

.screenshots-section h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 20px;
}

/* Carousel */
.carousel-wrapper {
    overflow: hidden;
    border-radius: 18px;
    position: relative;
    width: 100%;
}

body.theme-dark .carousel-wrapper {
    box-shadow: 0 0 0 2px rgba(255,255,255,0.08), 0 12px 40px rgba(0,0,0,0.6);
}

body.theme-light .carousel-wrapper {
    box-shadow: 0 0 0 2px rgba(0,0,0,0.08), 0 12px 40px rgba(0,0,0,0.15);
}

.carousel-track {
    display: flex;
    width: 100%;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.carousel-slide img {
    width: 100%;
    height: auto;
    display: block;
}

body.theme-dark .carousel-slide img {
    background: #0a0a14;
}

body.theme-light .carousel-slide img {
    background: #f0f0f5;
}

/* Dots */
.carousel-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 16px;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: var(--transition-fast);
    cursor: pointer;
}

body.theme-dark .carousel-dot {
    background: var(--border-dark);
}

body.theme-light .carousel-dot {
    background: #c0c0d0;
}

.carousel-dot.active {
    background: var(--primary-color);
    width: 24px;
    border-radius: 4px;
}

/* Descrição Completa */
.description-section h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.description-section p {
    font-size: 1rem;
    line-height: 1.8;
}

body.theme-dark .description-section p {
    color: var(--text-dark-muted);
}

body.theme-light .description-section p {
    color: var(--text-light-muted);
}

/* Botão Voltar */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    transition: var(--transition-normal);
    outline: none;
    margin-bottom: 30px;
}

body.theme-dark .btn-back {
    background: var(--bg-dark-secondary);
    color: var(--text-dark);
    border: 1px solid var(--border-dark);
}

body.theme-light .btn-back {
    background: var(--bg-light-secondary);
    color: var(--text-light);
    border: 1px solid var(--border-light);
}

.btn-back:hover,
.btn-back:focus,
.btn-back.focused {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.btn-back svg {
    width: 20px;
    height: 20px;
}

/* =====================================================
   FOOTER
   ===================================================== */
.footer {
    padding: 30px 0;
    text-align: center;
    font-size: 0.9rem;
}

body.theme-dark .footer {
    border-top: 1px solid var(--border-dark);
    color: var(--text-dark-muted);
}

body.theme-light .footer {
    border-top: 1px solid var(--border-light);
    color: var(--text-light-muted);
}

/* =====================================================
   EMPTY STATE
   ===================================================== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 1rem;
}

body.theme-dark .empty-state p {
    color: var(--text-dark-muted);
}

body.theme-light .empty-state p {
    color: var(--text-light-muted);
}

/* =====================================================
   ADMIN STYLES
   ===================================================== */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: 280px;
    padding: 30px 20px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

body.theme-dark .admin-sidebar {
    background: var(--bg-dark-secondary);
    border-right: 1px solid var(--border-dark);
}

body.theme-light .admin-sidebar {
    background: var(--bg-light-secondary);
    border-right: 1px solid var(--border-light);
}

.admin-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 40px;
    padding: 0 10px;
}

.admin-logo span {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.admin-nav {
    flex: 1;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 8px;
    font-weight: 500;
    transition: var(--transition-fast);
}

body.theme-dark .admin-nav-item {
    color: var(--text-dark-muted);
}

body.theme-light .admin-nav-item {
    color: var(--text-light-muted);
}

.admin-nav-item:hover,
.admin-nav-item.active {
    background: var(--primary-light);
    color: var(--primary-color);
}

.admin-nav-item svg {
    width: 22px;
    height: 22px;
}

.admin-logout {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border-dark);
}

body.theme-light .admin-logout {
    border-top-color: var(--border-light);
}

/* Main Content */
.admin-main {
    flex: 1;
    margin-left: 280px;
    padding: 30px 40px;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

.admin-title {
    font-size: 1.8rem;
    font-weight: 700;
}

/* Cards de Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    padding: 24px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 16px;
}

body.theme-dark .stat-card {
    background: var(--bg-dark-card);
    border: 1px solid var(--border-dark);
}

body.theme-light .stat-card {
    background: var(--bg-light-card);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-light);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary-color);
}

.stat-icon svg {
    width: 28px;
    height: 28px;
}

.stat-info h3 {
    font-size: 2rem;
    font-weight: 800;
}

.stat-info p {
    font-size: 0.9rem;
}

body.theme-dark .stat-info p {
    color: var(--text-dark-muted);
}

body.theme-light .stat-info p {
    color: var(--text-light-muted);
}

/* Tabelas */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--border-radius);
}

body.theme-dark .table-wrapper {
    background: var(--bg-dark-card);
    border: 1px solid var(--border-dark);
}

body.theme-light .table-wrapper {
    background: var(--bg-light-card);
    border: 1px solid var(--border-light);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 16px 20px;
    text-align: left;
}

.admin-table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.theme-dark .admin-table th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-dark-muted);
    border-bottom: 1px solid var(--border-dark);
}

body.theme-light .admin-table th {
    background: rgba(0, 0, 0, 0.02);
    color: var(--text-light-muted);
    border-bottom: 1px solid var(--border-light);
}

body.theme-dark .admin-table td {
    border-bottom: 1px solid var(--border-dark);
}

body.theme-light .admin-table td {
    border-bottom: 1px solid var(--border-light);
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.table-app-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.table-app-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--gradient-primary);
}

/* Botões Admin */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-dark);
}

body.theme-dark .btn-secondary {
    color: var(--text-dark);
    border-color: var(--border-dark);
}

body.theme-light .btn-secondary {
    color: var(--text-light);
    border-color: var(--border-light);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-icon {
    padding: 10px;
    border-radius: 10px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
}

/* Forms */
.form-card {
    padding: 30px;
    border-radius: var(--border-radius);
    max-width: 700px;
}

body.theme-dark .form-card {
    background: var(--bg-dark-card);
    border: 1px solid var(--border-dark);
}

body.theme-light .form-card {
    background: var(--bg-light-card);
    border: 1px solid var(--border-light);
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 14px 18px;
    font-size: 1rem;
    border-radius: var(--border-radius-sm);
    border: 2px solid transparent;
    transition: var(--transition-fast);
    font-family: inherit;
}

body.theme-dark .form-input,
body.theme-dark .form-textarea,
body.theme-dark .form-select {
    background: var(--bg-dark);
    color: var(--text-dark);
    border-color: var(--border-dark);
}

body.theme-light .form-input,
body.theme-light .form-textarea,
body.theme-light .form-select {
    background: var(--bg-light);
    color: var(--text-light);
    border-color: var(--border-light);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-hint {
    font-size: 0.85rem;
    margin-top: 6px;
}

body.theme-dark .form-hint {
    color: var(--text-dark-muted);
}

body.theme-light .form-hint {
    color: var(--text-light-muted);
}

/* File Input */
.file-input-wrapper {
    position: relative;
}

.file-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-input-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 30px;
    border-radius: var(--border-radius-sm);
    border: 2px dashed;
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: center;
}

body.theme-dark .file-input-label {
    border-color: var(--border-dark);
    color: var(--text-dark-muted);
}

body.theme-light .file-input-label {
    border-color: var(--border-light);
    color: var(--text-light-muted);
}

.file-input-label:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Color Input */
.color-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-preview {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    border: 2px solid var(--border-dark);
}

body.theme-light .color-preview {
    border-color: var(--border-light);
}

input[type="color"] {
    width: 50px;
    height: 50px;
    padding: 0;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

/* Preview de imagem */
.image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.image-preview img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Login Page */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    border-radius: var(--border-radius-lg);
    text-align: center;
}

body.theme-dark .login-card {
    background: var(--bg-dark-card);
    border: 1px solid var(--border-dark);
}

body.theme-light .login-card {
    background: var(--bg-light-card);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-light);
}

.login-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.login-subtitle {
    margin-bottom: 30px;
}

body.theme-dark .login-subtitle {
    color: var(--text-dark-muted);
}

body.theme-light .login-subtitle {
    color: var(--text-light-muted);
}

.login-form .form-group {
    text-align: left;
}

.login-form .btn {
    width: 100%;
    margin-top: 10px;
}

/* =====================================================
   MODAL / OVERLAY DE CARREGAMENTO
   ===================================================== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.loading-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.loading-modal {
    min-width: 260px;
    max-width: 360px;
    padding: 32px 28px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-dark);
}

body.theme-dark .loading-modal {
    background: var(--bg-dark-card);
    border: 1px solid var(--border-dark);
    color: var(--text-dark);
}

body.theme-light .loading-modal {
    background: var(--bg-light-card);
    border: 1px solid var(--border-light);
    color: var(--text-light);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    border: 4px solid rgba(148, 163, 184, 0.3);
    border-top-color: var(--primary-color);
    margin: 0 auto 18px;
    animation: loading-spin 0.9s linear infinite;
}

.loading-title {
    font-weight: 700;
    margin-bottom: 6px;
}

.loading-text {
    font-size: 0.9rem;
}

body.theme-dark .loading-text {
    color: var(--text-dark-muted);
}

body.theme-light .loading-text {
    color: var(--text-light-muted);
}

@keyframes loading-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loading-progress-wrapper {
    margin-top: 16px;
    text-align: left;
}

.loading-progress-bar {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.3);
    overflow: hidden;
    margin-bottom: 8px;
}

.loading-progress-bar-inner {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: var(--gradient-primary);
    transition: width 0.15s linear;
}

.loading-progress-text {
    font-size: 0.8rem;
}

body.theme-dark .loading-progress-text {
    color: var(--text-dark-muted);
}

body.theme-light .loading-progress-text {
    color: var(--text-light-muted);
}

/* =====================================================
   RESPONSIVO
   ===================================================== */
@media (max-width: 1024px) {
    .admin-sidebar {
        width: 240px;
    }
    
    .admin-main {
        margin-left: 240px;
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .admin-wrapper {
        flex-direction: column;
    }
    
    .admin-sidebar {
        position: relative;
        width: 100%;
        height: auto;
        padding: 20px;
    }
    
    .admin-main {
        margin-left: 0;
        padding: 20px;
    }
    
    .admin-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .admin-nav-item {
        flex: 1;
        min-width: 120px;
        justify-content: center;
        margin-bottom: 0;
    }
    
    .admin-logout {
        margin-top: 20px;
        padding-top: 0;
        border-top: none;
    }
    
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .apps-grid {
        grid-template-columns: 1fr;
    }
    
    .app-detail-header {
        flex-direction: column;
    }

    .app-detail-left {
        width: 100%;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .app-detail-carousel {
        width: 100%;
    }
    
    .app-detail-info {
        text-align: center;
    }
    
    .hero {
        padding: 40px 0;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .app-card {
        padding: 16px;
    }
    
    .app-icon {
        width: 64px;
        height: 64px;
    }
    
    .form-card {
        padding: 20px;
    }
    
    .login-card {
        padding: 30px 20px;
    }
    
    .btn-download {
        width: 100%;
        justify-content: center;
    }
}

/* TV Mode - Larger Focus Areas */
@media (min-width: 1200px) and (pointer: coarse) {
    .app-card {
        padding: 30px;
    }
    
    .app-icon {
        width: 100px;
        height: 100px;
    }
    
    .app-name {
        font-size: 1.3rem;
    }
    
    .app-description {
        font-size: 1rem;
    }
}

/* =====================================================
   UTILITÁRIOS
   ===================================================== */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.gap-10 {
    gap: 10px;
}

.gap-20 {
    gap: 20px;
}
