:root {
    --primary-color: #331a5c;
    --primary-light: #4a2a7f;
    --secondary-color: #f0f0f0;
    --text-color: #333;
    --light-text: #777;
    --message-bg: #f5f5f5;
    --message-user-bg: #e1d8f1;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f9f9f9;
    color: var(--text-color);
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    width: 100%;
    max-width: 1000px;
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 85vh;
    justify-self: center;
}

/* Header Styles */
header {
    background-color: var(--primary-color);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: bold;
}
.animation{
    width: 50px;
    height: 50px;
    background-position: center;
    
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.notification-icon, .menu-icon {
    font-size: 1.2rem;
    cursor: pointer;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-btn {
    background: var(--primary-light);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: var(--white);
    min-width: 160px;
    box-shadow: var(--shadow);
    border-radius: 5px;
    z-index: 1;
    margin-top: 5px;
}

.dropdown-content a {
    color: var(--text-color);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.dropdown-content a:hover {
    background-color: var(--secondary-color);
}

.dropdown:hover .dropdown-content {
    display: block;
}



.nav-container {
    background-color: #ffffff;
    height: 50px;
    padding: 5px 5px;
    overflow-x: none;
    position: relative;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.nav-container::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.nav-container {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}


.nav-tabs {
    display: flex;
    gap: 0;
    width: max-content;
}

.tab {
    white-space: nowrap;
    cursor: pointer;
    position: relative;
    padding: 0px 10px 0px 10px;
    margin: 0px 10px 0px 10px; ;
    background-color: #ffffff;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 500;
    color: #331a5c;
    transition: all 0.3s ease;
    font-weight: 700;
    border: 1px solid #6f5697;


}

.tab:hover {
    background-color: #182229;
    color: #d1d7db;
}

.tab.active {
    background-color: #cdd5db;
}

/* .badge {
    background-color: #00a884;
    color: #111b21;
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 6px;
} */


/* Messages Container */
.messages-container {
    padding: 10px;
    overflow-y: auto;
    background-color: #EFEFEF;
}

.message-row {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 25px;
    position: relative;
    width: 100%;
}

.message-row:hover .share-btn {
    opacity: 1;
}

.message-profile {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.message-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: calc(100% - 50px); /* Adjusted to prevent overflow */
}

.message-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    gap: 10px;
    flex-wrap: wrap;
}
.chitchat{
    display: flex;
    align-items: center;
    gap: 3px;
}
.message-sender {
    font-weight: bold;
    font-size: 0.55rem;
}

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

.message-content {
    background: var(--white);
    padding: 12px 15px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    position: relative;
    width: 100%;
    word-break: break-word;
}

.message-text {
    margin-bottom: 5px;
    line-height: 1.4;
    font-size: 0.95rem;
    color: #333;
}

.read-more {
    color: var(--primary-color);
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 5px;
    display: inline-block;
}

.hidden-text {
    display: none;
}

.comments-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #ddd;
}

.comment-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.8rem;
    white-space: nowrap;
    /* background-color: #e7dff3; */
    background-color: #EFEFEF;
    padding: 5px;
    border-radius: 10px;
}
.badge {
    background-color: var(--primary-color);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.6rem;
    font-weight: 600;
}

.share-btn {
    opacity: 0.7;
    background: var(--white);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: opacity 0.2s;
    align-self: center;
    flex-shrink: 0;
    color: #666;
}
.share-btn:hover {
    opacity: 1;
    background: #f5f5f5;
}

.reactions-wrapper {
    position: relative;
    width: 100%;
}

.reactions-container {
    display: flex;
    gap: 3px;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    position: relative;
    width: 100%;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.reactions-container::-webkit-scrollbar {
    display: none;
}

.reaction-item {
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 18px;
    padding: 5px 10px;
    font-size: 0.55rem;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.reaction-item:hover {
    background: #f5f5f5;
    transform: scale(1.05);
}

.reaction-item.active {
    background: #e1d8f1;
    border-color: #8a2be2;
}

/* Tunnel effect - fade gradient on the right side */
.tunnel-effect {
    position: absolute;
    top: 0;
    right: 0;
    width: 10px;
    height: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, #EFEFEF 100%);
    pointer-events: none;
    border-radius: 0 10px 10px 0;
    display: none;
}

/* Input Area */
form{
    position: fixed;
    bottom: 0;
    z-index: 1000;
    margin-top: 10px;
    /* height: 8vh; */
    width: 100%;
    max-width: 1000px;
    justify-self: center;
    
}

.input-container {
    padding: 15px 20px;
    background: var(--white);
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-actions {
    display: flex;
    gap: 15px;
}

.input-actions i {
    font-size: 1.2rem;
    color: var(--light-text);
    cursor: pointer;
}

.message-input-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.message-input {
    width: 100%;
    padding: 12px 15px;
    border: none;
    border-radius: 20px;
    font-size: 1rem;
    outline: none;
    background: var(--secondary-color);
    padding-right: 50px;
}

.send-btn, .voice-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 0;
    transition: all 0.3s;
}

.send-btn {
    opacity: 0;
    transform: scale(0);
}

.voice-btn {
    opacity: 1;
    transform: scale(1);
}

.message-input:focus + .send-btn,
.message-input:not(:placeholder-shown) + .send-btn {
    opacity: 1;
    transform: scale(1);
}

.message-input:focus + .send-btn + .voice-btn,
.message-input:not(:placeholder-shown) + .send-btn + .voice-btn {
    opacity: 0;
    transform: scale(0);
}

/* Responsive Design */
@media (max-width: 900px) {
    .message-content-wrapper {
        max-width: 85%;
    }
}

@media (max-width: 600px) {
    .nav-container{
        height: 50px;
    }
    
    .messages-container {
        padding: 15px;
    }
    
    .message-content-wrapper {
        max-width: calc(100% - 45px);
    }

    .tunnel-effect{
        display: block;
    }
    
    header {
        padding: 12px 15px;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .message-row {
        gap: 10px;
    }
    
    .share-btn {
        opacity: 1;
    }
    
    .input-container {
        padding: 10px 15px;
    }
    .message-header {
        align-items: flex-start;
        gap: 5px;
    }
    
    .message-content {
        padding: 10px 12px;
    }
    
    .reaction-item {
        padding: 4px 8px;
        font-size: 0.8rem;
    }
    
    .share-btn {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
}

@media (max-width: 400px) {
    .message-row {
        gap: 10px;
    }
    
    .message-content {
        padding: 8px 10px;
    }
    
    .message-text {
        font-size: 0.9rem;
    }
    
    .reactions-container {
        gap: 6px;
    }
    
    .reaction-item {
        padding: 3px 6px;
        font-size: 0.75rem;
    }
}







/* Comments Section */
.comments-section {
    margin: 0 20px 20px;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.comments-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.add-comment-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.add-comment-btn:hover {
    background: var(--primary-dark);
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comment-item {
    display: flex;
    gap: 12px;
    padding: 15px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    background-color: #ffffff;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.comment-content {
    flex: 1;
}

.comment-author {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 5px;
}

.comment-text {
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 0.95rem;
}

.comment-meta {
    display: flex;
    gap: 15px;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.comment-action {
    cursor: pointer;
    transition: var(--transition);
}

.comment-action:hover {
    color: var(--primary);
}















/* for the series read page*/
.buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    padding: 15px;
    border-top: 1px solid #eee;
}

.nav-btn {
    padding: 12px 25px;
    background: #6a11cb;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    font-weight: 600;
}

.nav-btn:hover:not(:disabled) {
    background: #5a0fb8;
    transform: translateY(-2px);
}

.nav-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Animation for chapter changes */
.message-row {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.message-row.hidden {
    opacity: 0;
    transform: translateX(30px);
    display: none;
}

.message-row.visible {
    opacity: 1;
    transform: translateX(0);
    display: flex;
}





















.modal {
    /* Start as hidden but still in the render flow for transitions */
    display: block; /* Changed from 'none' */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    
    /* This is what we will transition */
    opacity: 0;
    
    /* Hide it from interaction while invisible */
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.active {
    /* Make it visible and interactive */
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.modal-content {
    position: relative;
    background-color: white;
    margin: 10% auto;
    padding: 0;
    width: 90%;
    max-width: 500px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(-50px);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 20px 25px;
    background: #331a5c;
    color: white;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close:hover {
    color: #EFEFEF;
    transform: scale(1.1);
}

.modal-body {
    padding: 25px;
}

.share-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* padding: 5px 3px; */
    background: #f5f7fa;
    border-radius: 12px;
    text-decoration: none;
    color: #331a5c;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.share-option:hover {
    background: white;
    border-color: #331a5c;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.share-option i {
    font-size: 25px;
    margin-bottom: 10px;
}

.share-option span {
    font-weight: 600;
    font-size: 16px;
}

.download-option {
    grid-column: span 2;
    background: #4CAF50;
    color: white;
}

.download-option:hover {
    background: #3e8e41;
    border-color: #3e8e41;
    color: white;
}

@media (max-width: 600px) {
    .share-options {
        grid-template-columns: 1fr;
    }
    
    .download-option {
        grid-column: span 1;
    }
    
    .modal-content {
        margin: 20% auto;
        width: 95%;
    }
}

/* Hidden canvas for generating image */
.canvas-container {
    position: absolute;
    left: -9999px;
    top: -9999px;
}

.web-share-option {
    grid-column: span 2;
    background: #331a5c;
    color: white;
}

.web-share-option:hover {
    background: #4a2580;
    color: white;
}

/* Hide WhatsApp-specific option if Web Share is supported */
@media (min-width: 601px) {
    .web-share-supported .share-option[data-platform="whatsapp"] {
        display: none;
    }
}

