/**
 * AppRanker Custom Styles
 * Modern, responsive design for app testing platform
 */

/* ===== Variables ===== */
:root {
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #6366f1;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark-color: #1f2937;
    --light-color: #f3f4f6;
    --gray-color: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* ===== Global Styles ===== */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f9fafb;
    color: var(--dark-color);
    line-height: 1.6;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* ===== Navbar ===== */
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color) !important;
}

.navbar {
    background-color: #fff;
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
}

.nav-link {
    font-weight: 500;
    color: var(--gray-color) !important;
    padding: 0.5rem 1rem !important;
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color) !important;
}

/* ===== Hero Section ===== */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    padding: 5rem 0;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
}

.hero-section p {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

/* ===== Cards ===== */
.card {
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    padding: 1rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* ===== Buttons ===== */
.btn {
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-success {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-success:hover {
    background-color: #059669;
    border-color: #059669;
}

/* ===== Forms ===== */
.form-control,
.form-select {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.625rem 1rem;
    font-size: 1rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.25);
}

.form-label {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* ===== Auth Pages ===== */
.auth-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.auth-page .card {
    border: none;
    border-radius: 1rem;
}

/* ===== Dashboard ===== */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background-color: #fff;
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar-nav {
    padding: 1.5rem 0;
}

.sidebar-nav .nav-link {
    padding: 0.75rem 1.5rem;
    border-radius: 0;
    color: var(--gray-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    background-color: var(--light-color);
    color: var(--primary-color);
}

.sidebar-nav .nav-link i {
    width: 20px;
    text-align: center;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
}

/* ===== Status Badges ===== */
.badge {
    padding: 0.375rem 0.75rem;
    font-weight: 500;
    border-radius: 0.375rem;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-secondary {
    background-color: var(--light-color);
    color: var(--gray-color);
}

/* ===== Progress Bars ===== */
.progress {
    height: 0.5rem;
    border-radius: 0.25rem;
    background-color: var(--light-color);
}

.progress-bar {
    background-color: var(--primary-color);
}

/* ===== Tables ===== */
.table {
    background-color: #fff;
    border-radius: 0.5rem;
    overflow: hidden;
}

.table thead th {
    background-color: var(--light-color);
    font-weight: 600;
    color: var(--dark-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
}

.table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background-color: var(--light-color);
}

/* ===== Trust Score ===== */
.trust-score {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--light-color);
    border-radius: 2rem;
    font-weight: 600;
}

.trust-score.high {
    background-color: #d1fae5;
    color: #065f46;
}

.trust-score.medium {
    background-color: #fef3c7;
    color: #92400e;
}

.trust-score.low {
    background-color: #fee2e2;
    color: #991b1b;
}

/* ===== App Cards ===== */
.app-card {
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.2s ease;
}

.app-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.app-card .app-icon {
    width: 64px;
    height: 64px;
    border-radius: 0.75rem;
    object-fit: cover;
}

.app-card .app-platform {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background-color: var(--light-color);
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

/* ===== Task Cards ===== */
.task-card {
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    background-color: #fff;
    transition: all 0.2s ease;
}

.task-card:hover {
    box-shadow: var(--shadow-md);
}

.task-card .reward-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    background-color: #d1fae5;
    color: #065f46;
    border-radius: 0.5rem;
    font-weight: 600;
}

/* ===== Wallet Cards ===== */
.wallet-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border-radius: 1rem;
    padding: 2rem;
}

.wallet-card .balance {
    font-size: 2.5rem;
    font-weight: 800;
}

.wallet-card .label {
    opacity: 0.9;
    font-size: 0.875rem;
}

/* ===== Notifications ===== */
.notification-dropdown {
    width: 350px;
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.notification-item:hover {
    background-color: var(--light-color);
}

.notification-item.unread {
    background-color: #eff6ff;
}

.notification-item:last-child {
    border-bottom: none;
}

/* ===== Messages ===== */
.message-thread {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
    background-color: var(--light-color);
    border-radius: 0.5rem;
}

.message-bubble {
    max-width: 70%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    margin-bottom: 1rem;
}

.message-bubble.sent {
    background-color: var(--primary-color);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 0.25rem;
}

.message-bubble.received {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 0.25rem;
}

/* ===== Admin Panel ===== */
.admin-sidebar {
    background-color: var(--dark-color);
    color: white;
}

.admin-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.7);
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

/* ===== Stats Cards ===== */
.stat-card {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card .icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card .icon.primary {
    background-color: #e0e7ff;
    color: var(--primary-color);
}

.stat-card .icon.success {
    background-color: #d1fae5;
    color: var(--secondary-color);
}

.stat-card .icon.warning {
    background-color: #fef3c7;
    color: var(--warning-color);
}

.stat-card .icon.danger {
    background-color: #fee2e2;
    color: var(--danger-color);
}

.stat-card .value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark-color);
}

.stat-card .label {
    color: var(--gray-color);
    font-size: 0.875rem;
}

/* ===== Footer ===== */
.footer {
    background-color: var(--dark-color);
    color: white;
    padding: 3rem 0;
    margin-top: 4rem;
}

.footer a {
    color: rgba(255, 255, 255, 0.7);
}

.footer a:hover {
    color: white;
}

/* ===== Responsive ===== */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
}

@media (max-width: 767px) {
    .hero-section {
        padding: 3rem 0;
    }
    
    .hero-section h1 {
        font-size: 1.75rem;
    }
    
    .main-content {
        padding: 1rem;
    }
}

/* ===== Utilities ===== */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-lg {
    width: 80px;
    height: 80px;
}

.avatar-sm {
    width: 32px;
    height: 32px;
}

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

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ===== Loading States ===== */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
