/* assets/css/style.css */
:root {
    --primary-red: #ff0000;
    --dark-red: #8b0000;
    --darker-red: #660000;
    --black: #0a0a0a;
    --dark-gray: #1a1a1a;
    --medium-gray: #2a2a2a;
    --light-gray: #3a3a3a;
    --text-light: #ffffff;
    --text-muted: #cccccc;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
}

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

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--black) 0%, var(--dark-gray) 100%);
    color: var(--text-light);
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Container Unificado */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Público */
.header {
    background: linear-gradient(135deg, var(--primary-red), var(--dark-red));
    padding: 1.5rem 0;
    box-shadow: 0 4px 30px rgba(255, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" opacity="0.1"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="white" stroke-width="2"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
}

.logo {
    text-align: center;
}

.logo h1 {
    font-size: 2.8rem;
    font-weight: 800;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
    letter-spacing: -1px;
    margin-bottom: 0.2rem;
}

.logo span {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 300;
    letter-spacing: 2px;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 600;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.nav-link:hover::before {
    left: 100%;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Header Admin */
.admin-header {
    background: linear-gradient(135deg, var(--primary-red), var(--dark-red));
    padding: 2rem 0;
    margin-bottom: 3rem;
    border-radius: 0 0 30px 30px;
    box-shadow: 0 8px 40px rgba(255, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.admin-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" opacity="0.15"><defs><pattern id="circuit" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="white"/><path d="M 10 0 L 10 20 M 0 10 L 20 10" fill="none" stroke="white" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23circuit)"/></svg>');
}

.admin-header .container {
    text-align: center;
    position: relative;
    z-index: 2;
}

.admin-header h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.6);
    background: linear-gradient(135deg, #fff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-actions {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

/* Botões */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 2.2rem;
    text-decoration: none;
    border-radius: 15px;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-red), var(--darker-red));
    color: var(--text-light);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.4);
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 30px rgba(255, 0, 0, 0.6);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--medium-gray), var(--light-gray));
    color: var(--text-light);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.btn-danger {
    background: linear-gradient(135deg, #dc2626, #7f1d1d);
    color: var(--text-light);
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.6);
}

.btn-edit {
    background: linear-gradient(135deg, var(--info), #1d4ed8);
    color: var(--text-light);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
}

.btn-edit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.6);
}

/* Conteúdo Principal */
.main-title {
    text-align: center;
    font-size: 3.5rem;
    margin: 3rem 0;
    background: linear-gradient(135deg, var(--primary-red), #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 0, 0, 0.3);
}

/* Grid de Apps Público */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 2.5rem;
    margin: 4rem 0;
}

.app-card {
    background: linear-gradient(145deg, var(--medium-gray), var(--dark-gray));
    border-radius: 25px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid var(--light-gray);
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.app-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-red), var(--dark-red));
}

.app-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 25px 60px rgba(255, 0, 0, 0.25);
    border-color: var(--primary-red);
}

.app-image {
    height: 220px;
    overflow: hidden;
    position: relative;
}

.app-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.app-card:hover .app-image img {
    transform: scale(1.1);
}

.app-info {
    padding: 2rem;
}

.app-info h3 {
    color: var(--primary-red);
    font-size: 1.5rem;
    margin-bottom: 1.2rem;
    font-weight: 700;
}

.downloader-code {
    background: var(--black);
    padding: 1.2rem;
    border-radius: 12px;
    margin: 1.5rem 0;
    border-left: 4px solid var(--primary-red);
    font-family: 'Courier New', monospace;
    position: relative;
}

.downloader-code::before {
    content: '🔒 Código Downloader';
    position: absolute;
    top: -10px;
    left: 15px;
    background: var(--black);
    padding: 0 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
}

.downloader-code code {
    color: var(--success);
    font-size: 0.9rem;
    word-break: break-all;
}

.download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    background: linear-gradient(135deg, var(--primary-red), var(--dark-red));
    color: var(--text-light);
    padding: 1.2rem 2rem;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    transition: all 0.3s ease;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.download-btn:hover {
    background: linear-gradient(135deg, var(--dark-red), var(--darker-red));
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 0, 0, 0.4);
}

/* Painel Admin */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: linear-gradient(145deg, var(--medium-gray), var(--dark-gray));
    padding: 2.5rem 2rem;
    border-radius: 20px;
    border: 1px solid var(--light-gray);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-red), var(--dark-red));
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(255, 0, 0, 0.2);
}

.stat-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-red), var(--dark-red));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
}

.stat-info h3 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    color: var(--primary-red);
    font-weight: 800;
}

.stat-info p {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 1.1rem;
}

.apps-list {
    background: linear-gradient(145deg, var(--medium-gray), var(--dark-gray));
    border-radius: 25px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--light-gray);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--light-gray);
}

.section-header h2 {
    color: var(--primary-red);
    font-size: 2rem;
    font-weight: 700;
}

.badge {
    background: linear-gradient(135deg, var(--primary-red), var(--dark-red));
    color: var(--text-light);
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.3);
}

.table-container {
    overflow-x: auto;
    border-radius: 15px;
}

.apps-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--dark-gray);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.apps-table th {
    background: linear-gradient(135deg, var(--primary-red), var(--dark-red));
    color: var(--text-light);
    font-weight: 700;
    padding: 1.5rem;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.apps-table td {
    padding: 1.5rem;
    border-bottom: 1px solid var(--light-gray);
    transition: background 0.3s ease;
}

.apps-table tr:hover td {
    background: rgba(255, 0, 0, 0.05);
}

.apps-table tr:last-child td {
    border-bottom: none;
}

.thumb {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid var(--primary-red);
    transition: transform 0.3s ease;
}

.thumb:hover {
    transform: scale(1.2);
}

.action-buttons {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

/* Formulários */
.app-form {
    background: linear-gradient(145deg, var(--medium-gray), var(--dark-gray));
    padding: 3.5rem;
    border-radius: 25px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--light-gray);
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 2.5rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 1rem;
    color: var(--primary-red);
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 1.2rem 1.5rem;
    background: var(--dark-gray);
    border: 2px solid var(--light-gray);
    border-radius: 12px;
    color: var(--text-light);
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.2);
    background: var(--black);
}

.form-group textarea {
    resize: vertical;
    min-height: 140px;
    font-family: 'Courier New', monospace;
}

.form-group input[type="file"] {
    padding: 1rem;
    background: var(--dark-gray);
    border: 2px dashed var(--light-gray);
    cursor: pointer;
}

.form-group input[type="file"]:hover {
    border-color: var(--primary-red);
    background: var(--black);
}

.current-file {
    background: var(--dark-gray);
    padding: 1.2rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary-red);
}

.current-file small {
    color: var(--text-muted);
    font-weight: 600;
}

.thumb-preview {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid var(--primary-red);
    margin-top: 0.8rem;
}

.file-help {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: block;
}

.form-actions {
    display: flex;
    gap: 1.5rem;
    justify-content: flex-start;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--light-gray);
}

/* Alertas */
.alert {
    padding: 1.8rem;
    border-radius: 15px;
    margin: 2.5rem 0;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border: 2px solid transparent;
    font-size: 1.1rem;
}

.alert.success {
    background: linear-gradient(135deg, #065f46, #047857);
    color: var(--success);
    border-color: var(--success);
}

.alert.error {
    background: linear-gradient(135deg, #7f1d1d, #991b1b);
    color: var(--error);
    border-color: var(--error);
}

/* Estados Vazios */
.no-apps {
    text-align: center;
    font-size: 1.4rem;
    color: var(--text-muted);
    margin: 4rem 0;
    padding: 4rem;
    background: var(--dark-gray);
    border-radius: 20px;
    border: 3px dashed var(--light-gray);
}

/* Footer */
.footer {
    background: linear-gradient(135deg, var(--dark-gray), var(--black));
    padding: 3rem 0;
    text-align: center;
    margin-top: 5rem;
    border-top: 1px solid var(--light-gray);
}

/* Animações */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.app-card {
    animation: fadeInUp 0.6s ease;
}

.stat-card {
    animation: slideInLeft 0.6s ease;
}

.apps-table tbody tr {
    animation: fadeInUp 0.5s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header .container {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .logo h1 {
        font-size: 2.2rem;
    }
    
    .nav {
        gap: 1rem;
    }
    
    .admin-header h1 {
        font-size: 2.2rem;
    }
    
    .header-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .main-title {
        font-size: 2.5rem;
        margin: 2rem 0;
    }
    
    .apps-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .apps-table {
        font-size: 0.9rem;
    }
    
    .apps-table th,
    .apps-table td {
        padding: 1rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .app-form {
        padding: 2rem 1.5rem;
    }
}

/* Scrollbar Customizada */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--dark-gray);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--primary-red), var(--dark-red));
    border-radius: 6px;
    border: 2px solid var(--dark-gray);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(var(--dark-red), var(--darker-red));
}

/* Botão de Logout */
.btn-logout {
    background: linear-gradient(135deg, #dc2626, #7f1d1d);
    color: var(--text-light);
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
}

.btn-logout:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.6);
}