/* Mobile Enhancements Styles */

/* Pull to Refresh */
.pull-to-refresh-indicator {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    background: #ffffff;
    padding: 1rem 2rem;
    border-radius: 0 0 1rem 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    opacity: 0;
    transition: all 0.3s ease;
}

.pull-to-refresh-indicator.ready {
    background: #3b82f6;
    color: white;
}

.pull-to-refresh-indicator.refreshing .refresh-spinner {
    animation: spin 0.8s linear infinite;
}

.refresh-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
}

.pull-to-refresh-indicator.ready .refresh-spinner {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: white;
}

.pull-to-refresh-indicator span {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
    z-index: 1000;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: #64748b;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
}

.bottom-nav-item:active {
    transform: scale(0.95);
}

.bottom-nav-item.active,
.bottom-nav-item:hover {
    color: #1e3a8a;
}

.bottom-nav-item svg {
    transition: transform 0.2s ease;
}

.bottom-nav-item:active svg {
    transform: scale(1.2);
}

.bottom-nav-item span {
    font-size: 0.7rem;
    font-weight: 600;
}

/* Bookmarks Modal */
.bookmarks-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bookmarks-modal.show {
    opacity: 1;
}

.bookmarks-dialog {
    background: #ffffff;
    width: 100%;
    max-height: 80vh;
    border-radius: 1rem 1rem 0 0;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.bookmarks-modal.show .bookmarks-dialog {
    transform: translateY(0);
}

.bookmarks-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.bookmarks-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
}

.bookmarks-close {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: #64748b;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.bookmarks-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.bookmarks-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.bookmarks-empty {
    text-align: center;
    color: #64748b;
    padding: 3rem 1rem;
}

.bookmark-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 0.75rem;
    text-decoration: none;
    color: inherit;
    margin-bottom: 0.5rem;
    transition: background 0.2s ease;
}

.bookmark-item:hover {
    background: #f8fafc;
}

.bookmark-item img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 0.5rem;
    flex-shrink: 0;
}

.bookmark-info {
    flex: 1;
    min-width: 0;
}

.bookmark-info h4 {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.bookmark-category {
    background: #e0e7ff;
    color: #3730a3;
    padding: 0.2rem 0.5rem;
    border-radius: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

/* Dark mode */
.dark-mode .pull-to-refresh-indicator {
    background: #1e293b;
    color: #f1f5f9;
}

.dark-mode .pull-to-refresh-indicator.ready {
    background: #60a5fa;
    color: #0f172a;
}

.dark-mode .refresh-spinner {
    border-color: #334155;
    border-top-color: #60a5fa;
}

.dark-mode .pull-to-refresh-indicator.ready .refresh-spinner {
    border-color: rgba(15, 23, 42, 0.3);
    border-top-color: #0f172a;
}

.dark-mode .bottom-nav {
    background: #1e293b;
    border-top-color: #334155;
}

.dark-mode .bottom-nav-item {
    color: #94a3b8;
}

.dark-mode .bottom-nav-item.active,
.dark-mode .bottom-nav-item:hover {
    color: #60a5fa;
}

.dark-mode .bookmarks-modal {
    background: rgba(0, 0, 0, 0.8);
}

.dark-mode .bookmarks-dialog {
    background: #1e293b;
}

.dark-mode .bookmarks-header {
    border-bottom-color: #334155;
}

.dark-mode .bookmarks-header h2 {
    color: #f1f5f9;
}

.dark-mode .bookmarks-close {
    color: #94a3b8;
}

.dark-mode .bookmarks-close:hover {
    background: #334155;
    color: #f1f5f9;
}

.dark-mode .bookmarks-empty {
    color: #94a3b8;
}

.dark-mode .bookmark-item:hover {
    background: #334155;
}

.dark-mode .bookmark-info h4 {
    color: #f1f5f9;
}

.dark-mode .bookmark-category {
    background: #3b82f6;
    color: #eff6ff;
}

/* Adjust main content for bottom nav on mobile */
@media (max-width: 768px) {
    body {
        padding-bottom: 70px;
    }
    
    footer {
        margin-bottom: 70px;
    }
}

/* Hide bottom nav on desktop */
@media (min-width: 769px) {
    .bottom-nav {
        display: none;
    }
    
    body {
        padding-bottom: 0;
    }
    
    footer {
        margin-bottom: 0;
    }
}
