/* ========== VIEWED PAPERS - COMPLETE STYLES ========== */

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* Debug: Force sidebar visibility */
#sidebar {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
}

/* Override any conflicting container styles */
.container {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Ensure dashboard layout takes precedence */
.dashboard-container {
    display: flex !important;
    width: 100% !important;
    min-height: 100vh !important;
}

.sidebar {
    display: flex !important;
    width: 280px !important;
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    height: 100vh !important;
    z-index: 1000 !important;
}

.main-content {
    margin-left: 280px !important;
    flex: 1 !important;
    width: calc(100% - 280px) !important;
    position: relative;
    z-index: 1;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: #fafafa;
    color: #000;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* CSS Variables */
:root {
    --primary-black: #000000;
    --primary-white: #ffffff;
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;
    
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-yellow: #f59e0b;
    --accent-red: #ef4444;
    --accent-purple: #8b5cf6;
    
    --success: #10b981;
    --error: #ef4444;
    --error-dark: #dc2626;
    --error-light: #fef2f2;
    --warning: #f59e0b;
    --info: #3b82f6;
    --primary: #6366f1;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 20px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Particle Background */
#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, var(--gray-50), var(--gray-100));
}

/* Loading Screen */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-white);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
    max-width: 400px;
    padding: 2rem;
}

.loader-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.paper-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-black), var(--gray-800));
    color: var(--primary-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    animation: paperPulse 2s ease-in-out infinite;
    box-shadow: var(--shadow-xl);
}

@keyframes paperPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.loader-text h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-black);
    margin-bottom: 0.5rem;
}

.loader-text p {
    color: var(--gray-600);
    font-size: 1rem;
}

.progress-bar {
    width: 300px;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-black), var(--gray-700));
    width: 0;
    animation: progressAnimation 3s ease-in-out infinite;
}

@keyframes progressAnimation {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* Navigation */
.main-nav {
    background: var(--primary-white);
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
}

.nav-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--primary-black);
    font-weight: 700;
    font-size: 1.2rem;
    transition: var(--transition);
}

.logo:hover {
    transform: translateY(-2px);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-black);
    color: var(--primary-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition);
}

.logo:hover .logo-icon {
    background: var(--accent-blue);
    transform: rotate(5deg);
}

.logo-text {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 900;
}

.nav-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.menu-bar {
    width: 100%;
    height: 3px;
    background: var(--primary-black);
    border-radius: 2px;
    transition: var(--transition);
}

.mobile-menu-btn.active .menu-bar:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-btn.active .menu-bar:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active .menu-bar:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Dashboard Container */
.dashboard-container {
    display: flex !important;
    min-height: 100vh;
    background: var(--gray-50);
    position: relative;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: 280px !important;
    background: var(--primary-white) !important;
    border-right: 1px solid var(--gray-200) !important;
    display: flex !important;
    flex-direction: column !important;
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    height: 100vh !important;
    z-index: 1000 !important;
    transition: var(--transition);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1) !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-image {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-black);
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--gray-600);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.sidebar-close:hover {
    background: var(--gray-100);
    color: var(--primary-black);
}

.sidebar-user {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.user-avatar-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.user-avatar {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--primary-white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-status {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid var(--primary-white);
}

.user-status.online {
    background: var(--success);
}

.avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-white);
    font-size: 1.5rem;
    opacity: 0;
    transition: var(--transition);
}

.user-avatar:hover .avatar-overlay {
    opacity: 1;
}

.user-info {
    text-align: center;
}

.user-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary-black);
    margin-bottom: 0.25rem;
}

.user-university {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 1rem;
}

.user-level {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.level-badge {
    background: var(--primary-black);
    color: var(--primary-white);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.level-progress {
    width: 100%;
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    overflow: hidden;
}

.level-bar {
    height: 100%;
    background: var(--primary-black);
    width: 60%;
    transition: var(--transition);
}

.sidebar-menu {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.menu-item {
    list-style: none;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.5rem;
    text-decoration: none;
    color: var(--gray-700);
    transition: var(--transition);
    position: relative;
}

.menu-link:hover {
    background: var(--gray-50);
    color: var(--primary-black);
}

.menu-item.active .menu-link {
    background: var(--primary-black);
    color: var(--primary-white);
}

.menu-icon {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.menu-text {
    flex: 1;
    font-weight: 500;
}

.menu-badge {
    background: var(--success);
    color: var(--primary-white);
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.menu-badge.transfer-badge {
    background: var(--warning);
}

.menu-badge.chat-badge {
    background: var(--info);
}

.menu-badge.buyplan-badge {
    background: var(--primary);
}

.menu-badge.coming-soon {
    background: var(--gray-500);
}

.menu-indicator {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: var(--primary-black);
    transition: var(--transition);
}

.menu-item.active .menu-indicator {
    height: 100%;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.credit-widget {
    background: var(--gray-50);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.credit-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.credit-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-black);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-white);
    font-size: 1.25rem;
}

.credit-info {
    flex: 1;
}

.credit-amount {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-black);
}

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

.credit-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-credit-buy {
    background: var(--primary-black);
    color: var(--primary-white);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-credit-buy:hover {
    background: var(--gray-800);
    transform: translateY(-1px);
}

.logout-btn {
    width: 100%;
    background: var(--error);
    color: var(--primary-white);
    border: none;
    padding: 0.875rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.logout-btn:hover {
    background: var(--error-dark);
}

/* Main Content */
.main-content {
    flex: 1 !important;
    margin-left: 280px !important;
    min-height: 100vh;
    background: var(--gray-50);
    position: relative;
    z-index: 1;
}

/* Dashboard Header */
.dashboard-header {
    background: var(--primary-white);
    border-bottom: 1px solid var(--gray-200);
    padding: 1.5rem 2rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-menu-trigger {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--gray-600);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.mobile-menu-trigger:hover {
    background: var(--gray-100);
    color: var(--primary-black);
}

.welcome-section {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.welcome-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--primary-black);
}

.greeting {
    color: var(--gray-600);
}

.user-name {
    color: var(--primary-black);
}

.welcome-subtitle {
    color: var(--gray-600);
    font-size: 1rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-widgets {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-widget {
    position: relative;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 0.5rem 0.75rem;
    transition: var(--transition);
}

.search-input-wrapper:focus-within {
    border-color: var(--primary-black);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.search-input {
    border: none;
    background: none;
    outline: none;
    padding: 0;
    font-size: 0.875rem;
    color: var(--gray-700);
    width: 200px;
}

.search-input::placeholder {
    color: var(--gray-500);
}

.search-btn {
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.search-btn:hover {
    color: var(--primary-black);
    background: var(--gray-100);
}

.credits-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--gray-50);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
}

.credits-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.credits-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-black);
}

.credits-label {
    font-size: 0.75rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.notifications-dropdown {
    position: relative;
}

.notification-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--gray-600);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.notification-btn:hover {
    background: var(--gray-100);
    color: var(--primary-black);
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--error);
    color: var(--primary-white);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 1rem;
    min-width: 18px;
    text-align: center;
}

.notification-dropdown-content {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    background: var(--primary-white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 1000;
}

.notifications-dropdown:hover .notification-dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.notification-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-black);
}

.mark-all-read {
    background: none;
    border: none;
    color: var(--primary-black);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
}

.notification-list {
    max-height: 300px;
    overflow-y: auto;
}

.notification-empty {
    padding: 2rem;
    text-align: center;
    color: var(--gray-500);
}

.notification-empty i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.profile-dropdown {
    position: relative;
}

.profile-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    transition: var(--transition);
}

.profile-btn:hover {
    background: var(--gray-100);
}

.profile-btn img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gray-200);
}

.profile-status {
    position: absolute;
    bottom: 0;
    right: 0;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--primary-white);
}

.status-dot.online {
    background: var(--success);
}

.profile-dropdown-content {
    position: absolute;
    top: 100%;
    right: 0;
    width: 280px;
    background: var(--primary-white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 1000;
}

.profile-dropdown:hover .profile-dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.profile-info img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-details {
    flex: 1;
}

.profile-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary-black);
    margin-bottom: 0.25rem;
}

.profile-email {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.profile-badge {
    background: var(--primary-black);
    color: var(--primary-white);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.profile-menu {
    padding: 1rem 0;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    text-decoration: none;
    color: var(--gray-700);
    transition: var(--transition);
}

.profile-menu-item:hover {
    background: var(--gray-50);
    color: var(--primary-black);
}

.profile-menu-item i:last-child {
    margin-left: auto;
    color: var(--gray-400);
}

.menu-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 0.5rem 0;
}

.logout-item {
    color: var(--error);
}

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

/* Dashboard Content */
.dashboard-content {
    padding: 2rem;
}

/* Welcome Card */
.welcome-card {
    background: var(--primary-white);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.welcome-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.bg-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle at 1px 1px, var(--gray-200) 1px, transparent 0);
    background-size: 20px 20px;
    opacity: 0.3;
}

.bg-gradient {
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-black) 0%, var(--gray-800) 100%);
    opacity: 0.05;
}

.welcome-content {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 200px;
}

.welcome-text {
    flex: 1;
}

.welcome-heading {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-black);
    margin-bottom: 0.75rem;
}

.welcome-description {
    font-size: 1.125rem;
    color: var(--gray-600);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.welcome-stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-black);
}

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

.welcome-actions {
    display: flex;
    gap: 1rem;
}

.btn-action {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.welcome-illustration {
    position: relative;
    z-index: 1;
}

.floating-elements {
    position: relative;
    width: 200px;
    height: 200px;
    flex-shrink: 0;
}

.element {
    position: absolute;
    width: 60px;
    height: 60px;
    background: var(--primary-black);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-white);
    font-size: 1.5rem;
    animation: float 6s ease-in-out infinite;
}

.element:nth-child(1) {
    top: 0;
    left: 0;
    animation-delay: 0s;
}

.element:nth-child(2) {
    top: 50%;
    right: 0;
    animation-delay: 1.5s;
}

.element:nth-child(3) {
    bottom: 0;
    left: 25%;
    animation-delay: 3s;
}

.element:nth-child(4) {
    top: 25%;
    left: 50%;
    animation-delay: 4.5s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Mobile Backdrop */
.mobile-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.mobile-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--primary-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    transition: var(--transition);
}

.modal.active .modal-content {
    transform: translate(-50%, -50%) scale(1);
}

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

.modal-title h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-black);
    margin-bottom: 0.5rem;
}

.modal-title p {
    color: var(--gray-600);
    font-size: 0.875rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--primary-black);
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Credit Packages */
.credit-packages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.package {
    background: var(--primary-white);
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.package:hover {
    border-color: var(--primary-black);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.package.popular {
    border-color: var(--primary-black);
    box-shadow: var(--shadow-lg);
}

.package-ribbon {
    position: absolute;
    top: -10px;
    right: 20px;
    background: var(--primary-black);
    color: var(--primary-white);
    padding: 0.5rem 1rem;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
}

.package-ribbon.best {
    background: var(--success);
}

.package-ribbon.premium {
    background: var(--warning);
}

.package-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.package-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-black);
    margin-bottom: 1rem;
}

.package-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
}

.currency {
    font-size: 1rem;
    color: var(--gray-600);
}

.amount {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-black);
}

.original-price {
    font-size: 1rem;
    color: var(--gray-500);
    text-decoration: line-through;
}

.package-credits {
    text-align: center;
    margin-bottom: 1.5rem;
}

.credits-amount {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-black);
}

.credits-text {
    color: var(--gray-600);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.package-features {
    margin-bottom: 1.5rem;
}

.feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    color: var(--gray-700);
}

.feature i {
    color: var(--success);
    font-size: 1rem;
}

.feature.highlight {
    color: var(--primary-black);
    font-weight: 600;
}

.feature.highlight i {
    color: var(--warning);
}

.package-footer {
    text-align: center;
}

.package-value {
    display: block;
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.savings {
    background: var(--success);
    color: var(--primary-white);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.payment-security {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
}

.security-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-600);
    font-size: 0.875rem;
}

.security-item i {
    color: var(--success);
    font-size: 1rem;
}

.selected-package {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
}

.package-name {
    font-weight: 600;
    color: var(--primary-black);
}

.package-price {
    color: var(--gray-600);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    text-align: center;
    color: var(--primary-white);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--gray-600);
    border-top: 4px solid var(--primary-white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner p {
    font-size: 1.125rem;
    font-weight: 500;
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    font-family: inherit;
    text-align: center;
    white-space: nowrap;
}

.btn::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;
}

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

.btn-primary {
    background: var(--primary-black);
    color: var(--primary-white);
    border: 2px solid var(--primary-black);
}

.btn-primary:hover {
    background: var(--gray-800);
    border-color: var(--gray-800);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--primary-white);
    color: var(--primary-black);
    border: 2px solid var(--gray-200);
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--primary-black);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--gray-600);
    border: 2px solid var(--gray-200);
}

.btn-ghost:hover {
    background: var(--gray-50);
    border-color: var(--primary-black);
    color: var(--primary-black);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Page Header */
.page-header {
    margin-bottom: 3rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 2rem;
}

.page-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    color: var(--primary-black);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-title i {
    color: var(--accent-blue);
}

.page-subtitle {
    font-size: 1.2rem;
    color: var(--gray-600);
    font-weight: 400;
}

.header-stats {
    display: flex;
    gap: 1.5rem;
}

.stat-card {
    text-align: center;
    padding: 1.5rem;
    background: var(--primary-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    min-width: 120px;
    transition: var(--transition);
}

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

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-black);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--gray-600);
    font-weight: 500;
}

/* Filters Section */
.filters-section {
    background: var(--primary-white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    margin-left: 0;
    margin-right: 0;
}

.filters-container {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 300px;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 1rem;
}

.search-box input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background: var(--primary-white);
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-black);
    box-shadow: var(--shadow-md);
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.75rem 1.25rem;
    border: 2px solid var(--gray-200);
    background: var(--primary-white);
    color: var(--gray-700);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-btn:hover {
    border-color: var(--primary-black);
    color: var(--primary-black);
}

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

.sort-dropdown select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius);
    background: var(--primary-white);
    color: var(--gray-700);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.sort-dropdown select:focus {
    outline: none;
    border-color: var(--primary-black);
}

/* Papers Grid */
.papers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.paper-card {
    background: var(--primary-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.paper-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
}

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

.paper-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.paper-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-black);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.paper-subtitle {
    font-size: 0.9rem;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

.paper-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.action-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--gray-200);
    background: var(--primary-white);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.action-btn:hover {
    border-color: var(--primary-black);
    color: var(--primary-black);
}

.action-btn.favorite.active {
    background: var(--accent-yellow);
    color: var(--primary-white);
    border-color: var(--accent-yellow);
}

.paper-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--gray-600);
}

.meta-item i {
    color: var(--accent-blue);
    font-size: 0.8rem;
}

.paper-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-badge {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: var(--gray-100);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--gray-600);
    font-weight: 500;
}

.stat-badge i {
    font-size: 0.7rem;
}

.viewed-badge {
    background: linear-gradient(135deg, var(--accent-green), #0d9488);
    color: var(--primary-white);
}

.paper-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-100);
}

.viewed-date {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.view-again-btn {
    padding: 0.5rem 1rem;
    background: var(--accent-blue);
    color: var(--primary-white);
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.view-again-btn:hover {
    background: var(--primary-black);
    transform: translateY(-1px);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--primary-white);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-md);
}

.empty-icon {
    font-size: 5rem;
    color: var(--gray-300);
    margin-bottom: 2rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: var(--primary-black);
    margin-bottom: 1rem;
}

.empty-state p {
    color: var(--gray-600);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 4rem 2rem;
}

.loading-spinner {
    font-size: 3rem;
    color: var(--accent-blue);
    margin-bottom: 1rem;
}

.loading-state p {
    color: var(--gray-600);
    font-size: 1.1rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
}

.toast {
    background: var(--primary-white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    box-shadow: var(--shadow-lg);
    animation: toastSlideIn 0.3s ease;
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
}

.toast.success::before {
    background: var(--accent-green);
}

.toast.error::before {
    background: var(--accent-red);
}

.toast.info::before {
    background: var(--accent-blue);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-icon {
    flex-shrink: 0;
    font-size: 1.2rem;
}

.toast.success .toast-icon {
    color: var(--accent-green);
}

.toast.error .toast-icon {
    color: var(--accent-red);
}

.toast.info .toast-icon {
    color: var(--accent-blue);
}

.toast-message {
    flex: 1;
    font-size: 0.9rem;
    color: var(--gray-700);
    line-height: 1.4;
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem;
    border-radius: 4px;
    transition: var(--transition);
    flex-shrink: 0;
}

.toast-close:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* Comprehensive Responsive Design */

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
    .main-content {
        padding: 2.5rem;
        max-width: 1600px;
        margin-left: 280px;
        margin-right: auto;
    }
    
    .papers-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
        gap: 2rem;
    }
    
    .header-stats {
        gap: 2rem;
    }
}

/* Desktop (1200px - 1439px) */
@media (max-width: 1439px) {
    .main-content {
        padding: 2rem;
    }
    
    .papers-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 1.5rem;
    }
}

/* Tablet Landscape (1024px - 1199px) */
@media (max-width: 1199px) {
    .main-content {
        padding: 1.5rem;
    }
    
    .papers-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

/* Tablet Portrait (768px - 1023px) */
@media (max-width: 1023px) {
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        position: relative;
        z-index: 1;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }
    
    .header-stats {
        align-self: stretch;
        justify-content: center;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .filters-container {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .search-box {
        min-width: auto;
        width: 100%;
    }
    
    .filter-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .papers-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.25rem;
    }
}

/* Mobile Landscape & Large Mobile (481px - 767px) */
@media (max-width: 767px) {
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        position: relative;
        z-index: 1;
    }
    
    .container {
        padding: 1rem;
    }
    
    .page-title {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .page-subtitle {
        font-size: 0.9rem;
    }
    
    .papers-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .paper-card {
        padding: 1.25rem;
    }
    
    .paper-title {
        font-size: 1rem;
        line-height: 1.3;
    }
    
    .paper-meta {
        font-size: 0.8rem;
    }
    
    .paper-stats {
        gap: 0.75rem;
    }
    
    .header-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .stat-card {
        min-width: auto;
        padding: 1rem;
        text-align: center;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .filter-buttons {
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .search-input {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .toast-container {
        left: 1rem;
        right: 1rem;
        max-width: none;
        top: 10px;
    }
    
    .toast {
        min-width: auto;
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
    
    /* Mobile Sidebar */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 280px;
        z-index: 2000;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .mobile-menu-trigger {
        display: block;
    }
    
    .sidebar-close {
        display: block;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .mobile-backdrop {
        display: block;
    }
    
    .mobile-backdrop.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* Dashboard header */
    .dashboard-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .header-content {
        align-items: stretch;
    }
    
    .welcome-section {
        text-align: center;
    }
}

/* Mobile Portrait (320px - 480px) */
@media (max-width: 480px) {
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        position: relative;
        z-index: 1;
    }
    
    .container {
        padding: 0.75rem;
    }
    
    .page-title {
        font-size: 1.5rem;
        line-height: 1.1;
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .page-subtitle {
        font-size: 0.8rem;
    }
    
    .papers-grid {
        gap: 1rem;
    }
    
    .paper-card {
        padding: 1rem;
    }
    
    .paper-title {
        font-size: 0.9rem;
    }
    
    .paper-meta {
        font-size: 0.75rem;
    }
    
    .paper-stats {
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .stat {
        font-size: 0.7rem;
    }
    
    .header-stats {
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .stat-number {
        font-size: 1.6rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .filter-buttons {
        gap: 0.4rem;
    }
    
    .filter-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .search-input {
        padding: 0.6rem;
        font-size: 0.85rem;
    }
    
    .toast-container {
        left: 0.5rem;
        right: 0.5rem;
    }
    
    .toast {
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .sidebar {
        width: 100vw;
        max-width: 320px;
    }
    
    .sidebar-header {
        padding: 1rem;
    }
    
    .logo-text {
        font-size: 1rem;
    }
    
    .sidebar-menu {
        padding: 0.5rem;
    }
    
    .menu-link {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
    
    .menu-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    /* Dashboard header mobile */
    .dashboard-header {
        padding: 0.75rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .header-widgets {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .welcome-title {
        font-size: 1.3rem;
    }
    
    .welcome-heading {
        font-size: 1.3rem;
    }
    
    .welcome-stats {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .welcome-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
    
    .btn-sm {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }
}

/* Small Mobile (320px - 375px) */
@media (max-width: 375px) {
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        position: relative;
        z-index: 1;
    }
    
    .container {
        padding: 0.5rem;
    }
    
    .page-title {
        font-size: 1.3rem;
    }
    
    .paper-card {
        padding: 0.75rem;
    }
    
    .paper-title {
        font-size: 0.85rem;
    }
    
    .stat-card {
        padding: 0.6rem;
    }
    
    .stat-number {
        font-size: 1.4rem;
    }
    
    .dashboard-header {
        padding: 0.6rem;
    }
    
    .welcome-title {
        font-size: 1.2rem;
    }
    
    .sidebar {
        max-width: 280px;
    }
    
    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
}

/* Landscape orientation fixes */
@media (max-height: 500px) and (orientation: landscape) {
    .dashboard-header {
        padding: 0.5rem 1rem;
    }
    
    .papers-grid {
        gap: 1rem;
    }
    
    .paper-card {
        padding: 0.75rem;
    }
    
    .sidebar {
        width: 260px;
    }
    
    .sidebar-user {
        padding: 0.75rem;
    }
    
    .menu-link {
        padding: 0.5rem 0.75rem;
    }
}
    
    /* Dashboard Content */
    .dashboard-content {
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .nav-content {
        padding: 0 1rem;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .papers-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .paper-card {
        padding: 1.5rem;
    }
    
    .header-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .stat-card {
        min-width: auto;
    }
    
    .filter-buttons {
        flex-wrap: wrap;
    }
    
    .toast-container {
        left: 1rem;
        right: 1rem;
        max-width: none;
    }
    
    .toast {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .nav-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .paper-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .paper-actions {
        align-self: flex-end;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 4px;
}

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

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.animate__animated {
    animation-duration: 0.5s;
} 
.content-section { padding: 1.5rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.paper-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.05); transition: transform .2s ease, box-shadow .2s ease; }
.paper-card:hover { transform: translateY(-2px); box-shadow: 0 10px 15px -3px rgba(0,0,0,.1); }
.paper-card-body { display: flex; align-items: center; gap: 1rem; padding: 1rem; }
.paper-icon { width: 44px; height: 44px; border-radius: 50%; background: #000; color: #fff; display: flex; align-items: center; justify-content: center; }
.paper-meta { flex: 1; min-width: 0; }
.paper-title { font-size: 1rem; font-weight: 700; color: #111827; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.paper-sub { color: #6b7280; font-size: .85rem; margin: .25rem 0; }
.paper-time { color: #9ca3af; font-size: .75rem; }
.paper-actions { display: flex; gap: .5rem; }
.empty-state { text-align: center; padding: 3rem 1rem; color: #6b7280; }
.empty-icon { font-size: 3rem; color: #9ca3af; margin-bottom: .5rem; }

.viewer-section { display: grid; grid-template-rows: auto 1fr; height: calc(100vh - 80px); }
.viewer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1rem; border-bottom: 1px solid #e5e7eb; background: #fff; position: sticky; top: 0; z-index: 10; }
.toolbar-left { display: flex; align-items: center; gap: .75rem; }
.toolbar-right { display: flex; align-items: center; gap: .5rem; }
.viewer-title { font-weight: 700; color: #111827; }
.page-indicator { color: #6b7280; font-weight: 600; }
.divider { width: 1px; height: 24px; background: #e5e7eb; margin: 0 .25rem; }

.pdf-container { position: relative; overflow: auto; background: #f9fafb; display: flex; align-items: flex-start; justify-content: center; padding: 1rem; }
#pdfCanvas { background: #fff; box-shadow: 0 10px 20px rgba(0,0,0,.08); border: 1px solid #e5e7eb; border-radius: 8px; }
.watermark { position: fixed; bottom: 12px; right: 12px; opacity: .25; pointer-events: none; font-weight: 800; font-family: 'JetBrains Mono', monospace; color: #111827; background: rgba(255,255,255,.7); padding: .25rem .5rem; border-radius: 6px; }

@media (max-width: 768px) {
  .grid { grid-template-columns: 1fr; }
} 