/* Mobile-specific styles for Edebiyar */

/* Base mobile adjustments */
body {
    font-size: 16px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

/* Header adjustments */
.navbar-brand {
    font-size: 1.5rem;
}

.navbar-toggler {
    padding: 0.25rem 0.5rem;
    font-size: 1rem;
}

/* Typography adjustments */
h1 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
}

h3 {
    font-size: 1.3rem;
    margin-bottom: 0.6rem;
}

/* Card adjustments */
.card {
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.2rem;
}

.card-text {
    font-size: 0.9rem;
}

/* Story cards */
.story-card {
    margin-bottom: 1.5rem;
}

.story-image {
    height: 180px;
}

.story-title {
    font-size: 1.2rem;
    margin: 0.5rem 0;
}

.story-excerpt {
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Category navigation */
.nav-categories {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem 0;
}

.nav-category {
    display: inline-block;
    padding: 0.5rem 0.8rem;
    margin-right: 0.5rem;
    font-size: 0.9rem;
}

/* Post detail page */
.post-detail h1 {
    font-size: 1.8rem;
    line-height: 1.3;
}

.post-content {
    font-size: 1rem;
    line-height: 1.6;
}

.post-content img {
    max-width: 100%;
    height: auto;
}

.post-meta {
    font-size: 0.8rem;
}

/* Comments section */
.comment-form .form-control {
    font-size: 0.9rem;
}

.comment-form label {
    font-size: 0.9rem;
}

.comment .card-title {
    font-size: 1rem;
}

.comment .card-subtitle {
    font-size: 0.8rem;
}

.comment .card-text {
    font-size: 0.9rem;
}

/* Rating buttons */
.post-actions .btn {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
}

/* Tables */
.table-responsive {
    margin-bottom: 1rem;
}

/* Forms */
.form-control {
    font-size: 1rem;
    padding: 0.375rem 0.75rem;
}

/* Buttons */
.btn {
    font-size: 0.9rem;
    padding: 0.375rem 0.75rem;
}

/* Footer */
.footer {
    padding: 1.5rem 0;
    font-size: 0.9rem;
}

/* Feedback messages */
#message {
    font-size: 0.9rem;
    padding: 0.5rem;
    top: 10px;
    right: 10px;
    max-width: 80%;
}

/* Improved touch targets */
a, button, .btn, input[type="button"], input[type="submit"] {
    min-height: 44px;
    min-width: 44px;
}

/* Fix for fixed elements */
.fixed-top, .fixed-bottom {
    -webkit-backface-visibility: hidden;
}

/* Improved scrolling */
.scrollable-area {
    -webkit-overflow-scrolling: touch;
}

/* Prevent zoom on inputs */
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
    font-size: 16px;
}

/* Adjust spacing */
.container {
    padding-left: 15px;
    padding-right: 15px;
}

.row {
    margin-left: -10px;
    margin-right: -10px;
}

.col, [class*="col-"] {
    padding-left: 10px;
    padding-right: 10px;
}

/* Adjust margins and paddings */
.mt-4 {
    margin-top: 1.5rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

.py-4 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
}

/* Improve readability */
p {
    margin-bottom: 1rem;
}

/* Fix for modals on mobile */
.modal-dialog {
    margin: 0.5rem;
}

.modal-content {
    border-radius: 0.3rem;
}

/* Improve form elements */
select.form-control {
    height: 38px;
}

/* Adjust pagination */
.pagination .page-link {
    padding: 0.375rem 0.75rem;
}

/* Mobile Navigation Bar */
.mobile-nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #1a2a42;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.mobile-nav-item {
    color: #fff;
    text-decoration: none;
    text-align: center;
    flex: 1;
    padding: 5px;
    transition: all 0.3s ease;
    font-size: 0.8rem;
}

.mobile-nav-item.active {
    color: #17a2b8;
}

.mobile-nav-item i {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 5px;
}

/* When user is authenticated, adjust items to make room for 4 items */
.mobile-nav-bar.with-admin .mobile-nav-item {
    font-size: 0.75rem;
}

.mobile-nav-bar.with-admin .mobile-nav-item i {
    font-size: 1rem;
    margin-bottom: 3px;
}

@media (max-width: 768px) {
    .category-nav {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        padding: 0.5rem;
        margin: -0.5rem -1rem;
        display: flex;
        gap: 0.5rem;
    }
    
    .nav-category {
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
        flex-shrink: 0;
    }
    
    .card-img-top {
        height: 150px;
    }
    
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 576px) {
    .card-img-top {
        height: 120px;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Additional mobile optimizations */

/* Optimize images for mobile loading */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

img.lazy.loaded {
    opacity: 1;
}

/* Prevent font boosting on mobile */
.card-title, 
.card-text, 
h1, h2, h3, h4, h5, h6, 
p {
    max-height: 999999px;
}

/* Fix admin settings page on mobile */
@media (max-width: 767px) {
    .admin-settings .card {
        margin-bottom: 1.5rem;
    }
    
    .table-responsive {
        border: 0;
        width: 100%;
        margin-bottom: 15px;
        overflow-y: hidden;
        -ms-overflow-style: -ms-autohiding-scrollbar;
    }
    
    /* Make buttons more tappable on mobile */
    .btn {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
    
    /* Better form elements on mobile */
    .form-control, .form-select {
        height: 46px;
        font-size: 16px; /* Prevent auto-zoom on iOS */
    }
    
    textarea.form-control {
        height: auto;
    }
    
    /* Improve card layouts */
    .card-footer {
        padding: 0.75rem 1rem;
    }
    
    /* Better spacing for action buttons */
    .action-buttons .btn {
        margin-bottom: 0.5rem;
    }
    
    /* Improve text contrast */
    .card-title {
        font-size: 1.3rem;
        font-weight: 600;
        line-height: 1.4;
        color: #222;
    }
    
    .card-text {
        font-size: 1rem;
        line-height: 1.6;
        color: #333;
    }
    
    /* Better spacing in cards */
    .card-body {
        padding: 1.25rem;
    }
    
    /* Ensure enough space between cards */
    .col-md-4.mb-4 {
        margin-bottom: 1.5rem !important;
    }
    
    /* Better post detail readability */
    .post-content {
        font-size: 1.1rem;
        line-height: 1.7;
        letter-spacing: 0.01rem;
    }
    
    .post-content p {
        margin-bottom: 1.25rem;
    }
    
    /* Improve paragraph readability with better spacing */
    .post-content p, 
    .post-content ul, 
    .post-content ol {
        margin-bottom: 1.2rem;
    }
    
    /* Better headings in post content */
    .post-content h2 {
        font-size: 1.6rem;
        margin-top: 2rem;
        margin-bottom: 1rem;
    }
    
    .post-content h3 {
        font-size: 1.4rem;
        margin-top: 1.75rem;
        margin-bottom: 0.8rem;
    }
    
    /* Improve image display in posts */
    .post-content img {
        max-width: 100%;
        height: auto;
        border-radius: 5px;
        margin: 1rem 0;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }
    
    /* Better spacing for lists */
    .post-content ul li,
    .post-content ol li {
        margin-bottom: 0.5rem;
    }
    
    /* Improve post meta data */
    .post-meta {
        font-size: 0.9rem;
        color: #555;
        margin-bottom: 1.5rem;
    }
    
    /* Make sure code blocks are mobile-friendly */
    .post-content pre {
        padding: 1rem;
        border-radius: 5px;
        overflow-x: auto;
        background-color: #f5f5f5;
        margin: 1rem 0;
        font-size: 0.9rem;
    }
    
    /* Better blockquotes */
    .post-content blockquote {
        border-left: 3px solid #1a2a42;
        padding-left: 1rem;
        margin-left: 0;
        margin-right: 0;
        font-style: italic;
        color: #555;
    }
    
    /* Better links */
    .post-content a {
        color: #0066cc;
        text-decoration: underline;
        text-underline-offset: 2px;
    }
}

/* Admin specific mobile improvements */
@media (max-width: 767px) {
    .admin-main {
        padding: 1rem;
        padding-top: 3.5rem;
    }
    
    .content-header {
        margin-bottom: 1rem;
    }
    
    .content-header h1 {
        font-size: 1.5rem;
    }
    
    /* Settings page improvements */
    .settings-row > div + div {
        margin-top: 1.5rem;
    }
    
    /* Improve tap targets in settings */
    .form-check-input {
        width: 1.25rem;
        height: 1.25rem;
    }
    
    .form-check-label {
        line-height: 1.5;
        padding-left: 0.25rem;
    }
    
    /* Full width buttons on mobile */
    .settings-row .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* Make alerts visible on mobile */
.alert {
    position: relative;
    z-index: 1;
}

/* Improve the mobile bottom navbar size */
@media (max-width: 374px) {
    .mobile-nav-bar {
        padding: 8px 0;
    }
    
    .mobile-nav-item {
        font-size: 0.7rem;
    }
    
    .mobile-nav-item i {
        font-size: 1rem;
        margin-bottom: 3px;
    }
} 