/* APK Store - Professional Purple Theme */

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #8b5cf6;
    --accent-color: #a78bfa;
    --purple-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --purple-gradient-dark: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    --purple-gradient-light: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
    --dark-bg: #1e1b4b;
    --card-shadow: 0 10px 30px rgba(99, 102, 241, 0.15);
    --card-shadow-hover: 0 20px 50px rgba(99, 102, 241, 0.25);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: 
        radial-gradient(circle at 20% 50%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(168, 85, 247, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, #f5f3ff 0%, #ede9fe 25%, #e0e7ff 50%, #ddd6fe 75%, #faf5ff 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: #1e293b;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(139, 92, 246, 0.03) 35px, rgba(139, 92, 246, 0.03) 70px),
        repeating-linear-gradient(-45deg, transparent, transparent 35px, rgba(99, 102, 241, 0.03) 35px, rgba(99, 102, 241, 0.03) 70px);
    pointer-events: none;
    z-index: 0;
}

main {
    position: relative;
    z-index: 1;
}

/* Navbar Styles */
.navbar {
    background: var(--purple-gradient) !important;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    border-bottom: 3px solid rgba(255, 255, 255, 0.1);
    position: sticky !important;
    top: 0;
    z-index: 1050 !important;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: white !important;
}

.nav-link {
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    margin: 0 0.25rem;
    color: rgba(255, 255, 255, 0.9) !important;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    color: white !important;
}

/* Dashboard Tabs Styles */
.nav-tabs {
    border-bottom: 2px solid #dee2e6;
    background: white;
    border-radius: 12px 12px 0 0;
    padding: 0.5rem 0.5rem 0 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.nav-tabs .nav-item .nav-link {
    color: #6366f1 !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 3px solid transparent !important;
    padding: 0.75rem 1.5rem !important;
    font-weight: 600;
    transition: all 0.3s ease;
    margin: 0 0.25rem;
    border-radius: 8px 8px 0 0;
}

.nav-tabs .nav-item .nav-link:hover {
    color: #4f46e5 !important;
    background: rgba(99, 102, 241, 0.1) !important;
    border-bottom-color: rgba(99, 102, 241, 0.5) !important;
    transform: translateY(-2px);
}

.nav-tabs .nav-item .nav-link.active {
    color: #4f46e5 !important;
    background: white !important;
    border-bottom-color: #6366f1 !important;
    border-bottom-width: 3px !important;
    font-weight: 700;
    box-shadow: 0 -2px 8px rgba(99, 102, 241, 0.1);
}

.nav-tabs .nav-item .nav-link.active i {
    color: #6366f1;
}

.nav-tabs .nav-item .nav-link i {
    color: #6366f1;
    margin-right: 0.5rem;
}

.nav-tabs .nav-item .nav-link .badge {
    margin-left: 0.5rem;
    background: #6366f1 !important;
    color: white !important;
}

.nav-tabs .nav-item .nav-link.active .badge {
    background: #4f46e5 !important;
}

/* Card Styles */
.card {
    border: none;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    overflow: hidden;
    background: white;
    position: relative;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

/* APK Card Text Truncation */
.card .card-body .flex-grow-1 {
    min-width: 0; /* Important for truncation to work in flexbox */
}

.card .card-body .card-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    display: block;
}

.card .card-body .text-muted {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    display: block;
    font-size: 0.85rem;
}

/* Responsive truncation for smaller screens */
@media (max-width: 576px) {
    .card .card-body .card-title {
        font-size: 1rem;
    }
    
    .card .card-body .text-muted {
        font-size: 0.8rem;
    }
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--purple-gradient);
    transform: scaleX(0);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--primary-color);
}

.card:hover::before {
    transform: scaleX(1);
}

/* APK Icon with Wave Background */
.apk-icon {
    width: 80px;
    height: 80px;
    min-width: 80px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
    transition: var(--transition);
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 5px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
}

@media (max-width: 576px) {
    .apk-icon {
        width: 70px;
        height: 70px;
        min-width: 70px;
        border-radius: 16px;
        padding: 4px;
    }
}

.apk-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM60 91c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM35 41c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 60c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3z' fill='%23ffffff' fill-opacity='0.15' fill-rule='evenodd'/%3E%3C/svg%3E");
    animation: waveMove 15s linear infinite;
    opacity: 0.6;
    z-index: 0;
}

@keyframes waveMove {
    0% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-30px, -30px) rotate(180deg); }
    100% { transform: translate(0, 0) rotate(360deg); }
}

.apk-icon {
    position: relative;
    z-index: 1;
}

.apk-icon img {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px;
    background: white;
}

.card:hover .apk-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 35px rgba(99, 102, 241, 0.5);
    border-color: rgba(255, 255, 255, 0.5);
}

.card:hover .apk-icon::before {
    animation-duration: 10s;
}

/* Button Styles */
.btn-download, .btn-primary {
    background: var(--purple-gradient);
    border: none;
    border-radius: 12px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-download::before, .btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-download:hover::before, .btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-download:hover, .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
    background: var(--purple-gradient-dark);
}

.btn-download:active, .btn-primary:active {
    transform: translateY(-1px);
}

.btn-outline-secondary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-secondary:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Banner Ad */
.banner-ad {
    max-height: 300px;
    height: 300px;
    width: 100%;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.2);
    transition: var(--transition);
    border: 2px solid rgba(99, 102, 241, 0.1);
}

@media (max-width: 768px) {
    .banner-ad {
        max-height: 180px;
        height: 180px;
        border-radius: 12px;
    }
}

@media (max-width: 576px) {
    .banner-ad {
        max-height: 150px;
        height: 150px;
        border-radius: 10px;
    }
}

.banner-ad:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.3);
    border-color: var(--primary-color);
}

/* Search & Filter */
.input-group {
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(99, 102, 241, 0.1);
}

.input-group:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 4px 25px rgba(99, 102, 241, 0.2);
}

.form-control, .form-select {
    border: none;
    padding: 0.75rem 1.25rem;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    box-shadow: none;
    border-color: var(--primary-color);
    outline: none;
}

.input-group-text {
    background: var(--purple-gradient);
    color: white;
    border: none;
}

/* Pagination */
.pagination {
    margin-top: 3rem;
}

.page-link {
    border: none;
    border-radius: 10px;
    margin: 0 0.25rem;
    padding: 0.75rem 1.25rem;
    color: var(--primary-color);
    transition: var(--transition);
    border: 2px solid rgba(99, 102, 241, 0.2);
}

.page-link:hover {
    background: var(--purple-gradient);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    border-color: var(--primary-color);
}

.page-item.active .page-link {
    background: var(--purple-gradient);
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    color: white;
}

/* Alert Messages */
.alert {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.3s ease-out;
    border-left: 4px solid;
}

.alert-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-left-color: #10b981;
    color: #065f46;
}

.alert-danger, .alert-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-left-color: #ef4444;
    color: #991b1b;
}

.alert-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-left-color: #3b82f6;
    color: #1e40af;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dashboard Table */
.table {
    border-radius: 12px;
    overflow: hidden;
    background: white;
}

.table thead {
    background: var(--purple-gradient);
    color: white;
}

.table thead th {
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: var(--transition);
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.table tbody tr:hover {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    transform: scale(1.01);
}

/* Badge */
.badge {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
}

.badge.bg-success {
    background: var(--purple-gradient) !important;
}

.badge.bg-secondary {
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%) !important;
}

.badge.bg-warning {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s infinite;
}

/* Footer */
.footer {
    margin-top: 5rem;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    border-top: 4px solid var(--primary-light);
}

.footer h5, .footer h6 {
    color: white;
}

.footer a {
    color: #cbd5e1;
    transition: var(--transition);
}

.footer a:hover {
    color: var(--primary-light);
    padding-right: 5px;
}

.footer ul li {
    transition: var(--transition);
}

.footer ul li:hover {
    transform: translateX(5px);
}

/* Carousel Styles */
.carousel {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .carousel {
        border-radius: 12px;
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .carousel {
        border-radius: 10px;
        margin-bottom: 1rem;
    }
}

.carousel-item img {
    border-radius: 16px;
}

.carousel-control-prev,
.carousel-control-next {
    width: 50px;
    height: 50px;
    background: rgba(102, 126, 234, 0.7);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    margin: 0 20px;
    transition: var(--transition);
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    background: rgba(102, 126, 234, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.carousel-indicators {
    margin-bottom: 1rem;
}

.carousel-indicators button {
    background-color: rgba(102, 126, 234, 0.5);
    border-radius: 50%;
    width: 12px;
    height: 12px;
    margin: 0 5px;
    border: none;
    transition: var(--transition);
}

.carousel-indicators button.active {
    background-color: var(--primary-color);
    width: 30px;
    border-radius: 6px;
}

/* Dropdown Styles */
.navbar-nav .dropdown {
    position: relative;
}

.dropdown-menu {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    background: white;
    z-index: 1060 !important;
    position: absolute;
    min-width: 200px;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.98);
}

.dropdown-menu.show {
    display: block !important;
}

.dropdown-item {
    padding: 0.6rem 1.5rem;
    transition: var(--transition);
    color: #333;
    font-weight: 500;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    color: var(--primary-color);
    padding-left: 1.8rem;
}

.dropdown-item i {
    margin-right: 0.5rem;
    width: 20px;
    text-align: center;
    color: var(--primary-color);
}

.dropdown-divider {
    margin: 0.5rem 0;
    border-color: rgba(102, 126, 234, 0.1);
}

/* Form Styles */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25);
}

.form-label {
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.5rem;
}

/* Empty State */
.empty-state {
    padding: 4rem 2rem;
    text-align: center;
}

.empty-state i {
    font-size: 5rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
    background: var(--purple-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .apk-icon {
        width: 60px;
        height: 60px;
    }
    
    .card:hover {
        transform: translateY(-5px) scale(1.01);
    }
    
    .display-1 {
        font-size: 4rem !important;
    }
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: var(--purple-gradient);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--purple-gradient-dark);
}

/* Responsive Container */
.container-fluid {
    max-width: 1400px;
    margin: 0 auto;
}

@media (max-width: 576px) {
    .h4-md {
        font-size: 1.1rem !important;
    }
    
    .small-md {
        font-size: 0.85rem;
    }
}

/* Text Colors */
.text-muted {
    color: #64748b !important;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    color: #1e293b;
    font-weight: 700;
}

/* Links */
a {
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* Card Header */
.card-header {
    background: var(--purple-gradient);
    color: white;
    border: none;
    font-weight: 600;
}

.card-header.bg-primary {
    background: var(--purple-gradient) !important;
}

.card-header.bg-secondary {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%) !important;
}
