/* Preon Medicine - Modern Stylesheet */

:root {
    --primary-color: #1a365d;
    --primary-light: #2c5282;
    --primary-dark: #0f2442;
    --accent-color: #00b4d8;
    --accent-light: #48cae4;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    --bg-light: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

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

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
}

/* Navbar Styles */
.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%) !important;
    box-shadow: var(--shadow-md);
    padding: 0.75rem 0;
}

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

.navbar-brand img {
    height: 40px;
    width: auto;
}

.navbar-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.navbar-brand-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}

.navbar-brand-subtitle {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.8);
    letter-spacing: 0.5px;
}

.nav-link {
    font-weight: 500;
    color: rgba(255,255,255,0.9) !important;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: #fff !important;
    background-color: rgba(255,255,255,0.1);
}

.nav-link.active {
    color: #fff !important;
    background-color: rgba(255,255,255,0.15);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 50%, var(--primary-light) 100%);
    min-height: 70vh;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to top, rgba(248,250,252,1), transparent);
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    max-width: 500px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    border: 1px solid rgba(255,255,255,0.2);
}

.min-vh-50 {
    min-height: 50vh;
}

/* Hero Stats Card */
.hero-stats-card {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255,255,255,0.2);
}

.stat-item {
    text-align: center;
    padding: 1rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Buttons */
.btn {
    border-radius: var(--radius-md);
    padding: 0.625rem 1.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border: none;
    box-shadow: 0 4px 14px 0 rgba(26, 54, 93, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: translateY(-1px);
    box-shadow: 0 6px 20px 0 rgba(26, 54, 93, 0.4);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-light));
    border: none;
    color: #fff;
    box-shadow: 0 4px 14px 0 rgba(0, 180, 216, 0.3);
}

.btn-accent:hover {
    background: linear-gradient(135deg, #0096c7, var(--accent-color));
    color: #fff;
    transform: translateY(-1px);
}

.btn-outline-light {
    border-width: 2px;
    font-weight: 600;
}

.btn-outline-light:hover {
    transform: translateY(-1px);
}

.btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1rem;
}

/* Section Styles */
.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 2rem;
}

/* Feature Cards */
.feature-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    height: 100%;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-icon-wrapper {
    width: 70px;
    height: 70px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: #fff;
    box-shadow: 0 4px 14px 0 rgba(26, 54, 93, 0.25);
}

.feature-icon-wrapper.success {
    background: linear-gradient(135deg, var(--success-color), #34d399);
}

.feature-icon-wrapper.info {
    background: linear-gradient(135deg, var(--info-color), #22d3ee);
}

.feature-icon-wrapper.warning {
    background: linear-gradient(135deg, var(--warning-color), #fbbf24);
}

.feature-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.feature-text {
    color: var(--text-muted);
    font-size: 0.9375rem;
}

/* Article Cards */
.article-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

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

.article-type-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-light));
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.article-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.article-title a {
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.2s ease;
}

.article-title a:hover {
    color: var(--primary-color);
}

.article-abstract {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.article-meta i {
    margin-right: 0.25rem;
}

.article-card .card-footer {
    padding: 1rem 1.5rem;
    background: transparent;
    border-top: 1px solid var(--border-color);
}

/* Topic Cards */
.topic-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    transition: all 0.3s ease;
    height: 100%;
}

.topic-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: transparent;
}

.topic-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.topic-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9375rem;
}

.topic-name-cn {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Volume Cards */
.volume-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
}

.volume-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-color);
}

.volume-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.volume-year {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Editor Cards */
.editor-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
}

.editor-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.editor-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0 auto 1rem;
    box-shadow: var(--shadow-md);
}

.editor-name {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-dark);
}

.editor-role {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.editor-affiliation {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.editor-specialty {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Footer Styles */
footer {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #0a1628 100%);
    color: rgba(255,255,255,0.8);
    padding: 4rem 0 2rem;
}

.footer-title {
    color: #fff;
    font-weight: 700;
    margin-bottom: 1.25rem;
    font-size: 1rem;
}

.footer-link {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    display: block;
    padding: 0.375rem 0;
    transition: color 0.2s ease;
}

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

.footer-link i {
    margin-right: 0.5rem;
    font-size: 0.875rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 2rem;
    margin-top: 3rem;
}

/* Status Badges */
.status-draft { background-color: var(--text-muted); }
.status-submitted { background-color: var(--info-color); }
.status-under_review { background-color: var(--warning-color); color: #000; }
.status-revision_requested { background-color: #f97316; }
.status-accepted { background-color: var(--success-color); }
.status-rejected { background-color: var(--danger-color); }
.status-published { background-color: var(--success-color); }

/* Card Styles */
.card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.card-header {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
}

/* Alert Styles */
.alert {
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow-sm);
}

/* Form Styles */
.form-label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.form-control {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 0.625rem 1rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.15);
}

/* Table Styles */
.table {
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table th {
    font-weight: 600;
    background-color: var(--bg-light);
    border-bottom: 2px solid var(--border-color);
}

/* File Upload */
.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    text-align: center;
    transition: all 0.2s ease;
    background: var(--bg-light);
}

.file-upload-area:hover,
.file-upload-area.dragover {
    border-color: var(--accent-color);
    background: rgba(0, 180, 216, 0.05);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ========================================
   Responsive Design - Mobile First
   ======================================== */

/* Large devices (desktops, less than 1200px) */
@media (max-width: 1199.98px) {
    .hero-title {
        font-size: 3rem;
    }
    
    .stat-number {
        font-size: 2.25rem;
    }
}

/* Medium devices (tablets, less than 992px) */
@media (max-width: 991.98px) {
    .hero-section {
        min-height: auto;
        padding: 4rem 0;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-stats-card {
        margin-top: 2rem;
        max-width: 100% !important;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    /* Navbar mobile optimization */
    .navbar {
        padding: 0.5rem 0;
    }
    
    .navbar-brand img {
        height: 36px;
    }
    
    .navbar-collapse {
        background: var(--primary-dark);
        margin: 0.5rem -1rem -0.5rem;
        padding: 1rem;
        border-radius: 0 0 var(--radius-md) var(--radius-md);
    }
    
    .navbar-nav {
        gap: 0.25rem;
    }
    
    .nav-link {
        padding: 0.75rem 1rem !important;
        border-radius: var(--radius-sm);
    }
    
    .navbar .dropdown-menu {
        background: rgba(0,0,0,0.2);
        border: none;
        padding: 0.5rem;
        margin-top: 0.25rem;
    }
    
    .navbar .dropdown-item {
        color: rgba(255,255,255,0.9) !important;
        padding: 0.5rem 1rem;
        border-radius: var(--radius-sm);
    }
    
    .navbar .dropdown-item:hover {
        background: rgba(255,255,255,0.1);
        color: #fff !important;
    }
    
    .navbar .dropdown-item.text-danger {
        color: #f87171 !important;
    }
    
    /* Feature cards */
    .feature-card {
        padding: 1.5rem;
    }
    
    .feature-icon-wrapper {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    /* Footer */
    footer {
        padding: 3rem 0 2rem;
    }
    
    .footer-title {
        margin-top: 1.5rem;
    }
}

/* Small devices (landscape phones, less than 768px) */
@media (max-width: 767.98px) {
    /* Typography */
    body {
        font-size: 0.9375rem;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.125rem; }
    
    .hero-section {
        padding: 3rem 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-badge {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
    
    .hero-stats-card {
        padding: 1.5rem;
    }
    
    .stat-item {
        padding: 0.75rem;
    }
    
    .stat-number {
        font-size: 1.75rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    /* Buttons */
    .btn-lg {
        padding: 0.625rem 1.25rem;
        font-size: 0.9375rem;
    }
    
    /* Sections */
    .section-title {
        font-size: 1.5rem;
    }
    
    .section-subtitle {
        font-size: 0.875rem;
    }
    
    /* Cards */
    .feature-card,
    .article-card,
    .topic-card,
    .volume-card,
    .editor-card {
        padding: 1rem;
    }
    
    .article-title {
        font-size: 1rem;
    }
    
    .article-abstract {
        font-size: 0.8125rem;
    }
    
    .topic-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .topic-name {
        font-size: 0.875rem;
    }
    
    .volume-card {
        padding: 1rem;
    }
    
    .volume-number {
        font-size: 1.125rem;
    }
    
    .editor-avatar {
        width: 64px;
        height: 64px;
        font-size: 1.25rem;
    }
    
    .editor-name {
        font-size: 1rem;
    }
    
    /* Navbar */
    .navbar-brand-text {
        display: none;
    }
    
    .navbar-brand img {
        height: 32px;
    }
    
    /* CTA Section */
    .cta-section {
        padding: 3rem 0;
    }
    
    .cta-section h2 {
        font-size: 1.5rem;
    }
    
    .cta-section .lead {
        font-size: 0.9375rem;
    }
    
    /* Footer */
    footer {
        padding: 2rem 0 1.5rem;
    }
    
    .footer-bottom {
        margin-top: 2rem;
        padding-top: 1.5rem;
    }
    
    /* Tables - Responsive */
    .table-responsive {
        font-size: 0.8125rem;
    }
    
    .table th, .table td {
        padding: 0.5rem;
    }
    
    /* Forms */
    .form-control {
        padding: 0.5rem 0.875rem;
        font-size: 1rem; /* Prevent iOS zoom on focus */
    }
    
    .form-label {
        font-size: 0.875rem;
    }
    
    /* Alerts */
    .alert {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    /* Pagination */
    .pagination .page-link {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575.98px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 0.9375rem;
        margin-bottom: 1.5rem;
    }
    
    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    /* Cards in grid */
    .article-card .card-body,
    .article-card .card-footer {
        padding: 1rem;
    }
    
    /* Feature cards */
    .feature-icon-wrapper {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .feature-title {
        font-size: 1rem;
    }
    
    .feature-text {
        font-size: 0.8125rem;
    }
    
    /* Volume cards */
    .volume-number {
        font-size: 1rem;
    }
    
    .volume-year {
        font-size: 0.75rem;
    }
    
    /* Hide secondary elements on very small screens */
    .hero-badge {
        display: none;
    }
    
    /* Dashboard specific */
    .card-body {
        padding: 1rem;
    }
    
    /* Mobile card stacking */
    .row.g-4 {
        --bs-gutter-y: 1rem;
    }
}

/* ========================================
   Mobile-Specific Enhancements
   ======================================== */

/* Touch-friendly interactions */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .dropdown-item {
        min-height: 44px;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }
    
    /* Remove hover effects that don't work on touch */
    .feature-card:hover,
    .article-card:hover,
    .topic-card:hover,
    .volume-card:hover,
    .editor-card:hover {
        transform: none;
    }
    
    /* Add active states for touch */
    .feature-card:active,
    .article-card:active,
    .topic-card:active {
        transform: scale(0.98);
    }
    
    .btn:active {
        transform: scale(0.97);
    }
}

/* Safe area insets for notched devices */
@supports (padding: env(safe-area-inset-bottom)) {
    .navbar {
        padding-top: max(0.75rem, env(safe-area-inset-top));
    }
    
    footer {
        padding-bottom: max(2rem, env(safe-area-inset-bottom));
    }
    
    .navbar-collapse {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .feature-card,
    .article-card,
    .topic-card,
    .volume-card,
    .editor-card {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* Can add dark mode styles here if needed */
}

/* ========================================
   Dashboard & Admin Mobile Styles
   ======================================== */

@media (max-width: 767.98px) {
    /* Admin sidebar becomes horizontal */
    .row > .col-md-3 + .col-md-9 {
        margin-top: 1rem;
    }
    
    /* Stats cards in dashboard */
    .card .display-4 {
        font-size: 1.5rem;
    }
    
    /* Table actions */
    .table .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    /* Action buttons stack */
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        border-radius: var(--radius-sm) !important;
        margin-bottom: 0.25rem;
    }
    
    /* Modal adjustments */
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    /* File upload */
    .file-upload-area {
        padding: 1.5rem 1rem;
    }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .navbar, footer, .btn, .no-print,
    .navbar-collapse, .dropdown-menu {
        display: none !important;
    }
    
    .container {
        max-width: 100%;
    }
    
    body {
        font-size: 12pt;
        color: #000;
    }
    
    a {
        text-decoration: none;
        color: #000;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
