@import url("https://fonts.googleapis.com/css2?family=Tiro+Bangla:ital@0;1&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Science+Gothic:wght@100..900&display=swap");
:root {
    --primary-color: #ec4899;
    --secondary-color: #8b5cf6;
    --bg-light: linear-gradient(135deg, #fdf2f8 0%, #faf5ff 100%);
    --bg-dark: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --text-light: #1f2937;
    --text-dark: #f3f4f6;
    --card-light: #ffffff;
    --card-dark: #1f2937;
    --border-light: #e5e7eb;
    --border-dark: #374151;
}

.story-title {
    font-family: "Science Gothic", sans-serif;
}
body {
    font-family: "Tiro Bangla", sans-serif;
    transition:
        background 0.3s ease,
        color 0.3s ease;
}

/* Light Mode */
.light-mode {
    background: var(--bg-light);
    color: var(--text-light);
}

.light-mode .gradient-bg {
    background: var(--bg-light);
}

.light-mode .story-card,
.light-mode .views-card,
.light-mode nav,
.light-mode footer {
    background: var(--card-light);
    color: var(--text-light);
}

.light-mode .story-card h3,
.light-mode .views-card h3 {
    color: var(--text-light);
}

.light-mode .story-card p,
.light-mode .views-card p {
    color: #6b7280;
}

.light-mode .border-light {
    border-color: var(--border-light);
}

/* Dark Mode */
.dark-mode {
    background: var(--bg-dark);
    color: var(--text-dark);
}

.dark-mode .gradient-bg {
    background: var(--bg-dark);
}

.dark-mode .story-card,
.dark-mode .views-card,
.dark-mode nav,
.dark-mode footer {
    background: var(--card-dark);
    color: var(--text-dark);
}

.dark-mode .story-card h3,
.dark-mode .views-card h3 {
    color: var(--text-dark);
}

.dark-mode .story-card p,
.dark-mode .views-card p {
    color: #d1d5db;
}

.dark-mode .border-light {
    border-color: var(--border-dark);
}

.dark-mode .text-gray-600 {
    color: #9ca3af;
}
.dark-mode .text-gray-500 {
    color: #6b7280;
}
.dark-mode .text-gray-700 {
    color: #d1d5db;
}
.dark-mode .text-gray-900 {
    color: #f9fafb;
}
.dark-mode .bg-white {
    background: #1f2937;
}
.dark-mode .border {
    border-color: #374151;
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.8s ease-out;
}
.slide-up {
    animation: slideUp 0.6s ease-out;
}
.pulse {
    animation: pulse 2s infinite;
}
.float {
    animation: float 6s ease-in-out infinite;
}
.bounce {
    animation: bounce 2s infinite;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

@keyframes bounce {
    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.story-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(30px);
    animation: fadeIn 0.8s ease-out forwards;
}

.story-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.story-card:nth-child(1) {
    animation-delay: 0.1s;
}
.story-card:nth-child(2) {
    animation-delay: 0.2s;
}
.story-card:nth-child(3) {
    animation-delay: 0.3s;
}

.page-link {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.page-link:hover {
    background-color: rgba(236, 72, 153, 0.1);
    transform: translateY(-3px) scale(1.1);
}

.page-link.active {
    background-color: #ec4899;
    color: white;
    transform: scale(1.1);
}

/* Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #ec4899;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(100px);
    transition: all 0.3s ease;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(236, 72, 153, 0.3);
}

#back-to-top.show {
    opacity: 1;
    transform: translateY(0);
}
#back-to-top:hover {
    background: #db2777;
    transform: translateY(-5px) scale(1.1);
}

/* Heart animation */
.heart-btn.liked i {
    animation: heartBeat 0.6s ease;
}
@keyframes heartBeat {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.3);
    }
    50% {
        transform: scale(1);
    }
    75% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Nav animation */
nav {
    animation: slideDown 0.5s ease-out;
}
@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Image Loading */
.story-image {
    position: relative;
    overflow: hidden;
}
.story-image::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}
.story-image.loaded::after {
    display: none;
}
@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Mobile Menu Styles - Entry from LEFT */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 85%;
    /* Not full width to see backdrop */
    max-width: 320px;
    background: rgba(255, 255, 255, 0.98);
    z-index: 1001;
    /* Higher than overlay */
    display: block;
    transform: translateX(-100%);
    /* Start off-screen left */
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}
.dark-mode .mobile-menu {
    background: rgba(31, 41, 55, 0.98);
}
.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu-content {
    padding: 80px 30px 50px;
    height: 100%;
    overflow-y: auto;
}
.mobile-menu-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #ec4899;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}
.mobile-menu-close:hover {
    transform: rotate(90deg) scale(1.1);
}

/* Search Modal */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.dark-mode .search-modal {
    background-color: rgba(17, 24, 39, 0.95);
}
.search-modal.active {
    opacity: 1;
    visibility: visible;
}

.search-container {
    width: 100%;
    max-width: 800px;
    padding: 20px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}
.search-modal.active .search-container {
    transform: scale(1);
}

/* UI Elements */
.category-filter.active {
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.3);
}

.story-read-progress {
    height: 4px;
    background: #f3f4f6;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 10px;
    display: none;
}
.dark-mode .story-read-progress {
    background: #374151;
}
.story-read-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ec4899 0%, #8b5cf6 100%);
    width: 0%;
    transition: width 0.6s ease;
}

.reading-time {
    font-size: 12px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 5px;
}
.dark-mode .reading-time {
    color: #9ca3af;
}

.story-stats {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
}
.story-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #6b7280;
}
.dark-mode .story-stat {
    color: #9ca3af;
}
.stat-icon {
    color: #ec4899;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 100px;
    right: 30px;
    background: #10b981;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
    z-index: 1000;
    transform: translateX(150%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.toast.show {
    transform: translateX(0);
}
.toast.error {
    background: #ef4444;
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.3);
}
.toast.warning {
    background: #f59e0b;
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.3);
}

/* Dropdowns */
.dropdown-container {
    position: relative;
}
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 10px;
    min-width: 200px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    overflow: hidden;
}
.dark-mode .dropdown-menu {
    background: #1f2937;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}
.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 12px 20px;
    color: #4b5563;
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
}
.dark-mode .dropdown-item {
    color: #d1d5db;
    border-bottom: 1px solid #374151;
}
.dropdown-item:last-child {
    border-bottom: none;
}
.dropdown-item:hover {
    background: #fdf2f8;
    color: #ec4899;
    padding-left: 25px;
}
.dark-mode .dropdown-item:hover {
    background: rgba(236, 72, 153, 0.1);
}
.dropdown-item i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Theme Icon Button */
.theme-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #4b5563;
}
.theme-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #ec4899;
}
.dark-mode .theme-btn {
    color: #d1d5db;
}
.dark-mode .theme-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 1.5s infinite;
}

/* Pagination Styles */
.pagination-dots {
    display: inline-block;
    color: #9ca3af;
    margin: 0 8px;
    cursor: default;
}

/* Story Card Custom Styles */
.category-badge {
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.author-avatar {
    background-color: #fce7f3;
    color: #db2777;
}

.dark-mode .author-avatar {
    background-color: rgba(236, 72, 153, 0.2);
    color: #f472b6;
}

/* Reading Progress Bar */
#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, #ec4899, #8b5cf6);
    width: 0%;
    z-index: 100;
    transition: width 0.1s;
}
