/* ========================================
   GLOBAL MOBILE OPTIMIZATION
   - 30% Text Size Reduction
   - Performance Enhancements
   - Responsive Layout
   ======================================== */

/* Mobile Responsive - Text 30% Smaller */
@media (max-width: 768px) {

    /* ===== GLOBAL FONT SIZE REDUCTION ===== */
    html {
        font-size: 14px;
        /* Down from 16px */
    }

    body {
        font-size: 0.7rem;
        /* 70% = 30% reduction */
    }

    /* ===== TYPOGRAPHY ===== */
    h1 {
        font-size: 1.4rem;
        /* 30% smaller */
    }

    h2 {
        font-size: 1.26rem;
        /* 30% smaller */
    }

    h3 {
        font-size: 1.05rem;
        /* 30% smaller */
    }

    h4 {
        font-size: 0.91rem;
        /* 30% smaller */
    }

    h5,
    h6 {
        font-size: 0.77rem;
        /* 30% smaller */
    }

    p {
        font-size: 0.7rem;
        line-height: 1.6;
    }

    /* ===== LAYOUT & SPACING ===== */
    .container {
        margin: 15px auto !important;
        padding: 0 10px !important;
        max-width: 100% !important;
    }

    .header-container {
        flex-direction: column;
        gap: 10px !important;
        padding: 10px !important;
    }

    /* ===== NAVIGATION ===== */
    .nav {
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 5px;
        -webkit-overflow-scrolling: touch;
    }

    .nav-btn,
    .btn {
        font-size: 0.7rem !important;
        padding: 8px 12px !important;
    }

    /* ===== FORMS ===== */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    textarea,
    select {
        font-size: 0.7rem !important;
        padding: 10px !important;
    }

    label {
        font-size: 0.7rem !important;
    }

    button,
    .button {
        font-size: 0.7rem !important;
        padding: 10px 16px !important;
    }

    /* ===== CARDS & BOXES ===== */
    .card,
    .box,
    .panel {
        padding: 12px !important;
        margin-bottom: 15px !important;
    }

    .card-title,
    .box-title {
        font-size: 0.91rem !important;
        /* 30% smaller */
    }

    .card-text,
    .box-text {
        font-size: 0.7rem !important;
    }

    /* ===== STORY CARDS ===== */
    .story-card {
        padding: 10px !important;
    }

    .story-title {
        font-size: 0.7rem !important;
    }

    .story-info,
    .story-meta {
        font-size: 0.595rem !important;
        /* 30% smaller */
    }

    /* ===== TABLES ===== */
    table {
        font-size: 0.7rem !important;
    }

    th,
    td {
        padding: 8px !important;
        font-size: 0.7rem !important;
    }

    /* ===== COMMENTS SECTION ===== */
    .comments-section {
        padding: 15px !important;
        margin: 15px 0 !important;
    }

    .comments-header h3 {
        font-size: 0.91rem !important;
    }

    .comments-count {
        font-size: 0.63rem !important;
        padding: 3px 8px !important;
    }

    .comment-avatar {
        width: 36px !important;
        height: 36px !important;
        font-size: 0.9rem !important;
    }

    .comment-textarea {
        min-height: 70px !important;
        font-size: 0.7rem !important;
        padding: 10px !important;
    }

    .comment-author {
        font-size: 0.7rem !important;
    }

    .comment-text {
        font-size: 0.7rem !important;
        line-height: 1.5;
    }

    .comment-time {
        font-size: 0.595rem !important;
    }

    .user-badge {
        padding: 2px 6px !important;
        font-size: 0.49rem !important;
    }

    .btn-like,
    .btn-reply {
        font-size: 0.63rem !important;
        padding: 4px 8px !important;
    }

    /* ===== USER PROFILE ===== */
    .user-info {
        padding: 12px !important;
    }

    .user-name {
        font-size: 0.91rem !important;
    }

    .user-stats {
        font-size: 0.7rem !important;
    }

    .user-level,
    .user-rank {
        font-size: 0.595rem !important;
    }

    /* ===== CULTIVATION SYSTEM ===== */
    .cultivation-card {
        padding: 12px !important;
    }

    .rank-name {
        font-size: 0.91rem !important;
    }

    .exp-bar {
        height: 20px !important;
    }

    .exp-text {
        font-size: 0.595rem !important;
    }

    /* ===== ADMIN PANEL ===== */
    .admin-header {
        font-size: 0.91rem !important;
        padding: 10px !important;
    }

    .admin-content {
        font-size: 0.7rem !important;
    }

    /* ===== MODALS & POPUPS ===== */
    .modal-title {
        font-size: 0.91rem !important;
    }

    .modal-body {
        font-size: 0.7rem !important;
        padding: 15px !important;
    }

    /* ===== ALERTS & NOTIFICATIONS ===== */
    .alert,
    .notification {
        font-size: 0.7rem !important;
        padding: 10px !important;
    }

    .notification-title {
        font-size: 0.7rem !important;
    }

    /* ===== BREADCRUMBS ===== */
    .breadcrumb {
        font-size: 0.595rem !important;
    }

    /* ===== PAGINATION ===== */
    .pagination {
        font-size: 0.7rem !important;
    }

    .page-link {
        padding: 6px 10px !important;
        font-size: 0.7rem !important;
    }

    /* ===== SEARCH BAR ===== */
    .search-input {
        font-size: 0.7rem !important;
        padding: 8px 12px !important;
    }

    .search-button {
        font-size: 0.7rem !important;
        padding: 8px 12px !important;
    }

    /* ===== PERFORMANCE OPTIMIZATIONS ===== */
    /* Remove shadows for better performance */
    .card,
    .box,
    .button,
    .btn,
    .comment-content,
    .user-badge,
    .story-card {
        box-shadow: none !important;
    }

    /* Optimize images */
    img {
        max-width: 100%;
        height: auto;
    }

    /* ===== CHAPTER SPECIFIC ===== */
    .chapter-info {
        padding: 12px !important;
        margin-bottom: 15px !important;
    }

    .chapter-title {
        font-size: 1.26rem !important;
    }

    .chapter-meta {
        font-size: 0.63rem !important;
    }

    .chapter-content {
        padding: 15px !important;
    }

    .chapter-content p {
        font-size: 0.77rem !important;
        line-height: 1.6;
        margin-bottom: 10px !important;
    }

    .chapter-images {
        padding: 0 !important;
    }

    .chapter-images img {
        width: 100%;
        border-radius: 0 !important;
        margin-bottom: 0 !important;
    }

    /* ===== STORY PAGE ===== */
    .story-header {
        padding: 15px !important;
    }

    .story-description {
        font-size: 0.7rem !important;
        line-height: 1.6;
    }

    .chapter-list-item {
        padding: 8px !important;
        font-size: 0.7rem !important;
    }

    /* ===== UPLOAD FORMS ===== */
    .upload-form {
        padding: 15px !important;
    }

    .form-group {
        margin-bottom: 12px !important;
    }

    .form-label {
        font-size: 0.7rem !important;
        margin-bottom: 6px !important;
    }

    .form-help {
        font-size: 0.595rem !important;
    }

    /* ===== READING HISTORY ===== */
    .history-item {
        padding: 10px !important;
        font-size: 0.7rem !important;
    }

    .history-title {
        font-size: 0.7rem !important;
    }

    .history-meta {
        font-size: 0.595rem !important;
    }

    /* ===== FOLLOWING PAGE ===== */
    .following-item {
        padding: 10px !important;
    }

    .following-title {
        font-size: 0.7rem !important;
    }

    /* ===== CONTACT PAGE ===== */
    .contact-info {
        font-size: 0.7rem !important;
        padding: 12px !important;
    }

    /* ===== FOOTER ===== */
    .footer {
        font-size: 0.595rem !important;
        padding: 15px 10px !important;
    }

    /* ===== SCROLL TO TOP ===== */
    .scroll-to-top {
        width: 40px !important;
        height: 40px !important;
        font-size: 18px !important;
        bottom: 20px !important;
        right: 20px !important;
    }

    /* ===== SPACING UTILITIES ===== */
    .mt-1,
    .my-1 {
        margin-top: 0.25rem !important;
    }

    .mt-2,
    .my-2 {
        margin-top: 0.5rem !important;
    }

    .mt-3,
    .my-3 {
        margin-top: 0.75rem !important;
    }

    .mt-4,
    .my-4 {
        margin-top: 1rem !important;
    }

    .p-1 {
        padding: 0.25rem !important;
    }

    .p-2 {
        padding: 0.5rem !important;
    }

    .p-3 {
        padding: 0.75rem !important;
    }

    .p-4 {
        padding: 1rem !important;
    }
}

/* Extra Small Mobile (< 480px) */
@media (max-width: 480px) {
    html {
        font-size: 13px;
    }

    .comment-avatar {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.8rem !important;
    }

    .user-badge {
        display: block !important;
        margin: 4px 0 !important;
    }

    .chapter-title {
        font-size: 1.1rem !important;
    }

    /* Ultra compact for tiny screens */
    .container {
        padding: 0 8px !important;
    }

    .btn,
    .button {
        padding: 8px 12px !important;
    }
}

/* Performance: Smooth scrolling on iOS */
* {
    -webkit-overflow-scrolling: touch;
}

/* Performance: Hardware acceleration */
.comment-wrapper,
.card,
.story-card {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}