/* =====================================================
   SoftHub - Estilos Personalizados
   Tema: Morado/Purple con modo oscuro por defecto
   ===================================================== */

/* CSS Variables - Dark Theme (Default) */
:root {
    /* Primary Purple Palette */
    --primary-50: #faf5ff;
    --primary-100: #f3e8ff;
    --primary-200: #e9d5ff;
    --primary-300: #d8b4fe;
    --primary-400: #c084fc;
    --primary-500: #a855f7;
    --primary-600: #9333ea;
    --primary-700: #7c3aed;
    --primary-800: #6b21a8;
    --primary-900: #581c87;

    /* Dark Theme Colors */
    --bg-primary: #0f0a1a;
    --bg-secondary: #1a1025;
    --bg-card: #1e1529;
    --bg-card-hover: #2a1f3d;
    --bg-input: #251a35;

    --text-primary: #f8f4fc;
    --text-secondary: #a89bb8;
    --text-muted: #6b5f7a;

    --border-color: #3d2d52;
    --border-light: #2d1f42;

    /* Accent Colors */
    --accent-gradient: linear-gradient(135deg, var(--primary-500), var(--primary-700));
    --accent-glow: 0 0 40px rgba(168, 85, 247, 0.3);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(168, 85, 247, 0.2);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #faf8fc;
    --bg-secondary: #f3eff8;
    --bg-card: #ffffff;
    --bg-card-hover: #f8f5fc;
    --bg-input: #f0ebf5;

    --text-primary: #1a0f2e;
    --text-secondary: #5c4d6e;
    --text-muted: #8a7a9c;

    --border-color: #e2d8ed;
    --border-light: #ebe4f2;

    --shadow-sm: 0 2px 8px rgba(88, 28, 135, 0.08);
    --shadow-md: 0 4px 20px rgba(88, 28, 135, 0.12);
    --shadow-lg: 0 8px 40px rgba(88, 28, 135, 0.15);
}

/* =====================================================
   Base Styles
   ===================================================== */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: var(--primary-400);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-300);
}

/* =====================================================
   Navbar
   ===================================================== */

.navbar {
    background: rgba(15, 10, 26, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    padding: 0.75rem 0;
}

[data-theme="light"] .navbar {
    background: rgba(250, 248, 252, 0.9);
}

.navbar-brand {
    font-size: 1.5rem;
    color: var(--text-primary) !important;
}

.navbar-brand i {
    color: var(--primary-500);
    font-size: 1.75rem;
}

.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary) !important;
    background: var(--bg-card);
}

/* Search Form */
.search-form {
    width: 100%;
    max-width: 400px;
}

.search-form .input-group {
    background: var(--bg-input);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.search-form .input-group:focus-within {
    border-color: var(--primary-500);
    box-shadow: var(--shadow-glow);
}

.search-form .input-group-text {
    background: transparent;
    color: var(--text-muted);
    padding-left: 1rem;
}

.search-form .form-control {
    background: transparent;
    color: var(--text-primary);
    padding: 0.75rem 1rem 0.75rem 0;
}

.search-form .form-control::placeholder {
    color: var(--text-muted);
}

.search-form .form-control:focus {
    box-shadow: none;
}

/* Theme Toggle Button */
.btn-theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--primary-400);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.btn-theme-toggle:hover {
    background: var(--primary-600);
    color: white;
    transform: rotate(15deg);
}

/* =====================================================
   Hero Section
   ===================================================== */

.hero-section {
    padding: 5rem 0;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 150%;
    background: radial-gradient(ellipse, rgba(168, 85, 247, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.text-gradient {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    color: var(--text-secondary);
    opacity: 0.9;
}

.hero-illustration {
    position: relative;
    height: 300px;
}

.floating-card {
    position: absolute;
    width: 80px;
    height: 80px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary-400);
    box-shadow: var(--shadow-md);
    animation: float 6s ease-in-out infinite;
}

.floating-card.card-1 {
    top: 10%;
    left: 20%;
    animation-delay: 0s;
}

.floating-card.card-2 {
    top: 40%;
    right: 15%;
    animation-delay: -2s;
}

.floating-card.card-3 {
    bottom: 10%;
    left: 40%;
    animation-delay: -4s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

/* =====================================================
   Buttons
   ===================================================== */

.btn-primary {
    background: var(--accent-gradient);
    border: none;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--accent-glow);
    background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
}

.btn-outline-secondary {
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 600;
    border-radius: var(--radius-md);
    background: transparent;
}

.btn-outline-secondary:hover {
    background: var(--bg-card);
    border-color: var(--primary-500);
    color: var(--primary-400);
}

/* Filter Buttons */
.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.btn-filter {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-lg);
    font-weight: 500;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.btn-filter:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--primary-600);
}

.btn-filter.active {
    background: var(--primary-600);
    color: white;
    border-color: var(--primary-600);
}

/* =====================================================
   Stats Section
   ===================================================== */

.stats-section {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* =====================================================
   Categories Section
   ===================================================== */

.section-header h2 {
    color: var(--text-primary);
}

.section-header h2 i {
    color: var(--primary-500);
}

.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: all var(--transition-normal);
    cursor: pointer;
    text-decoration: none;
    display: block;
}

.category-card:hover {
    transform: translateY(-5px);
    background: var(--bg-card-hover);
    border-color: var(--primary-500);
    box-shadow: var(--shadow-glow);
}

.category-card i {
    font-size: 2.5rem;
    color: var(--primary-400);
    margin-bottom: 0.75rem;
    display: block;
}

.category-card h5 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.category-card span {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* =====================================================
   App Cards
   ===================================================== */

.app-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.app-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary-500);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.app-card-header {
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.app-icon {
    width: 64px;
    height: 64px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.75rem;
    flex-shrink: 0;
}

.app-info {
    flex: 1;
    min-width: 0;
}

.app-info h5 {
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-info .author {
    color: var(--text-muted);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.app-card-body {
    padding: 0 1.5rem 1rem;
    flex: 1;
}

.app-card-body p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.app-card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge-custom {
    background: var(--bg-input);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-lg);
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.badge-custom.language {
    background: rgba(168, 85, 247, 0.15);
    color: var(--primary-400);
}

.app-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #fbbf24;
    font-weight: 600;
}

.app-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.app-card-link:hover {
    color: inherit;
}

/* =====================================================
   Loading & Empty States
   ===================================================== */

#loadingSpinner {
    color: var(--text-muted);
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 4rem;
    color: var(--border-color);
    margin-bottom: 1rem;
}

/* =====================================================
   Footer
   ===================================================== */

.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
}

.footer-link {
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: var(--primary-400);
}

/* =====================================================
   Responsive Adjustments
   ===================================================== */

@media (max-width: 991px) {
    .hero-section {
        padding: 3rem 0;
        text-align: center;
    }

    .hero-section .d-flex {
        justify-content: center;
    }
}

@media (max-width: 767px) {
    .hero-section h1 {
        font-size: 2rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .app-card-header {
        padding: 1rem;
    }

    .app-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }
}

/* =====================================================
   Scrollbar Styling
   ===================================================== */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-600);
}

/* =====================================================
   Animations
   ===================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.5s ease forwards;
}