/**
 * Blog Mobile Extra Styles
 * Share menu, image viewer, progress bar
 */

/* Reading Progress Bar */
.blog-reading-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    width: 0;
    transition: width 0.2s ease;
    z-index: 101;
}

/* Share Menu */
.blog-share-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.blog-share-menu.active {
    opacity: 1;
    visibility: visible;
}

.blog-share-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.blog-share-content {
    position: relative;
    background: white;
    width: 100%;
    max-width: 500px;
    border-radius: 20px 20px 0 0;
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.blog-share-menu.active .blog-share-content {
    transform: translateY(0);
}

.blog-share-content h3 {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 20px;
}

.blog-share-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.blog-share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 10px;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
}

.blog-share-option:active {
    transform: scale(0.95);
}

.blog-share-option i {
    font-size: 24px;
}

.blog-share-option span {
    font-size: 12px;
    color: #6b7280;
}

.blog-share-option.whatsapp {
    background: #25d366;
    color: white;
    border-color: #25d366;
}

.blog-share-option.whatsapp span {
    color: white;
}

.blog-share-option.facebook {
    background: #1877f2;
    color: white;
    border-color: #1877f2;
}

.blog-share-option.facebook span {
    color: white;
}

.blog-share-option.twitter {
    background: #1da1f2;
    color: white;
    border-color: #1da1f2;
}

.blog-share-option.twitter span {
    color: white;
}

.blog-share-option.copy {
    background: white;
    color: #6b7280;
}

.blog-share-close {
    width: 100%;
    padding: 15px;
    background: #f3f4f6;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.blog-share-close:active {
    background: #e5e7eb;
}

/* Image Viewer */
.blog-image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.blog-image-viewer.active {
    opacity: 1;
    visibility: visible;
}

.blog-image-viewer img {
    max-width: 95%;
    max-height: 90%;
    object-fit: contain;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.blog-image-viewer.active img {
    transform: scale(1);
}

.blog-viewer-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.blog-viewer-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Scroll Hint */
.scroll-hint {
    text-align: center;
    padding: 10px;
    font-size: 12px;
    color: #9ca3af;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Pull to Refresh (optional) */
.pull-to-refresh {
    position: fixed;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: top 0.3s ease;
    z-index: 102;
}

.pull-to-refresh.active {
    top: 70px;
}

.pull-to-refresh i {
    font-size: 20px;
    color: #10b981;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Smooth scroll behavior */
@media (max-width: 768px) {
    html {
        scroll-behavior: smooth;
    }
    
    body.single-post {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Safe area for notched phones */
@supports (padding-top: env(safe-area-inset-top)) {
    .blog-single-header {
        padding-top: calc(12px + env(safe-area-inset-top));
    }
    
    .blog-fab-container {
        padding-bottom: env(safe-area-inset-bottom);
    }
}