/*
 Theme Name:   egypanese
 Template:     astra
 Version:      1.0
*/

:root {
    --background-color: #F3E5DA;
    --menu-background-color: #BF814B;
    --topics-color: #8C2D18;
    --primary-color: #4a6fdc;
    --primary-dark: #3a5fc6;
    --secondary-color: #5ac8fa;
    --text-color: #333;
    --text-light: #666;
    --border-color: #e0e0e0;
    --success-color: #4CAF50;
    --error-color: #F44336;
    --warning-color: #FF9800;
    --bg-light: #f9f9f9;
    --bg-white: #ffffff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    --radius: 8px;
    --transition: all 0.3s ease;
}


/* AOS Animation Enhancements */

[data-aos] {
    opacity: 0;
    transition-property: transform, opacity;
}

[data-aos].aos-animate {
    opacity: 1;
}


/* Ensure animations don't interfere with interactive elements */

.btn-japanese,
.read-more-button,
.topic-box {
    pointer-events: none;
}

.aos-animate.btn-japanese,
.aos-animate.read-more-button,
.aos-animate.topic-box {
    pointer-events: auto;
}


/* Global animation styles for common elements */

.section-header,
.gitbook-content h1,
.profile-dashboard,
.custom-footer {
    transition: opacity 0.5s ease, transform 0.5s ease;
}


/* Fix for mobile devices */

@media (max-width: 768px) {
    [data-aos] {
        opacity: 1;
        /* Prevent animations from hiding content on small screens */
    }
}


/* Custom Body Background Color */

body {
    background-color: var(--background-color) !important;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

html,
body {
    overflow-x: hidden;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-main {
    flex: 1;
}

#ast-scroll-top {
    display: flex !important;
    justify-content: center;
    align-items: center;
}


/* Custom Menu Styling */

.custom-menu-wrapper {
    background-color: var(--jp-menu-bg, #BF814B);
    padding: 1rem 2rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--jp-shadow);
    z-index: 1000;
}


/* Logo Styling */

.custom-menu-logo .custom-logo {
    max-height: 70px;
    width: auto;
}

.custom-menu-logo .custom-logo-fallback {
    font-family: "Noto Serif JP", serif;
    font-size: 1.5rem;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
}


/* Hamburger Menu for Mobile */

.custom-menu-hamburger {
    display: none;
    width: 30px;
    height: 22px;
    position: relative;
    cursor: pointer;
    z-index: 1002;
}

.custom-menu-hamburger .menu-icon,
.custom-menu-hamburger .menu-icon::before,
.custom-menu-hamburger .menu-icon::after {
    background-color: #fff;
    height: 3px;
    width: 100%;
    border-radius: 2px;
    position: absolute;
    left: 0;
    transition: all 0.3s ease;
}

.custom-menu-hamburger .menu-icon {
    top: 9px;
}

.custom-menu-hamburger .menu-icon::before {
    content: '';
    top: -9px;
}

.custom-menu-hamburger .menu-icon::after {
    content: '';
    top: 9px;
}

.custom-menu-hamburger.open .menu-icon {
    background-color: transparent;
}

.custom-menu-hamburger.open .menu-icon::before {
    transform: rotate(45deg);
    top: 0;
}

.custom-menu-hamburger.open .menu-icon::after {
    transform: rotate(-45deg);
    top: 0;
}


/* Desktop Menu */

.custom-menu-nav {
    display: flex;
    align-items: center;
}

.custom-menu-nav ul.menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.custom-menu-nav li {
    position: relative;
    margin: 0 1rem;
}

.custom-menu-nav li a {
    color: #fff;
    text-decoration: none;
    font-family: "Noto Sans JP", sans-serif;
    font-weight: 500;
    font-size: 1rem;
    transition: color 0.3s ease;
    margin-top: -10px;
}

.custom-menu-nav li a:hover {
    color: var(--jp-accent, #8C2D18);
}


/* profile dropdown */

.profile-dropdown ul {
    list-style-type: none;
    margin: 0;
}

.profile-dropdown {
    position: relative;
}

.profile-dropdown>a {
    display: flex !important;
    align-items: center;
    gap: 8px;
}

.profile-menu-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.profile-menu-name {
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-menu-arrow {
    font-size: 12px;
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.profile-dropdown:hover .profile-menu-arrow {
    transform: rotate(180deg);
}


/* Dropdown Submenu Styling */

.profile-dropdown .sub-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: white;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    z-index: 1000;
    padding: 10px 0;
}

.profile-dropdown:hover .sub-menu {
    display: block;
    animation: fadeIn 0.3s ease;
}

.profile-dropdown .sub-menu li {
    margin: 0;
}

.profile-dropdown .sub-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    color: var(--text-color) !important;
    text-decoration: none;
    transition: all 0.2s ease;
}

.profile-dropdown .sub-menu a:hover {
    background-color: var(--bg-light);
    color: var(--primary-color) !important;
}

.profile-dropdown .sub-menu i {
    width: 16px;
    text-align: center;
}

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


/* Mobile Menu Overlay */

.custom-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-menu-overlay.active {
    display: block;
    opacity: 1;
}


/* Mobile Menu Panel */

.hidden-mobile {
    display: block;
}


/* Mobile Responsiveness */

@media (max-width: 768px) {
    .profile-dropdown>a {
        padding: 10px 15px !important;
    }
    .profile-dropdown .sub-menu {
        position: static;
        box-shadow: none;
        border-radius: 0;
        padding: 0;
    }
    .profile-dropdown .sub-menu a {
        padding: 10px 25px;
    }
}

@media (max-width: 768px) {
    .custom-menu-hamburger {
        display: block !important;
        /* Ensure it stays visible */
        position: absolute;
        right: 20px;
        top: 40px;
        z-index: 1002;
        /* Ensure it stays above the menu */
        cursor: pointer;
        padding: 10px;
        background: none;
        border: none;
        font-size: 24px;
        color: #fff;
    }
    .custom-menu-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: var(--menu-background-color, #BF814B);
        padding: 80px 20px 20px;
        z-index: 1001;
        transform: translateX(-100%);
        display: block !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
    }
    .custom-menu-nav.active {
        transform: translateX(0);
    }
    .custom-menu-nav ul.menu {
        flex-direction: column;
        gap: 15px;
    }
    .custom-menu-nav li {
        margin: 0;
        padding: 0;
        width: 100%;
    }
    .custom-menu-nav li a {
        display: block;
        padding: 12px 15px;
        border-radius: 4px;
        transition: background-color 0.2s ease;
        color: #fff;
        font-size: 16px;
    }
    .custom-menu-nav li a:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
    /* Profile menu specific mobile styles */
    .profile-menu-item {
        margin-top: 20px;
        border-top: 1px solid rgba(255, 255, 255, 0.3);
        padding-top: 15px;
    }
    .profile-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 15px;
    }
    .profile-menu-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        object-fit: cover;
        border: 2px solid rgba(255, 255, 255, 0.4);
    }
    .profile-menu-name {
        font-size: 16px;
        font-weight: 500;
        color: #fff;
        margin-left: 10px;
        flex-grow: 1;
    }
    .profile-menu-arrow {
        font-size: 14px;
        color: #fff;
        transition: transform 0.3s ease;
    }
    .profile-menu-arrow.fa-chevron-up {
        transform: rotate(180deg);
    }
    .profile-dropdown {
        position: static;
        background-color: rgba(0, 0, 0, 0.1);
        /* Subtle background for dropdown */
        margin-top: 10px;
        padding: 10px 0;
        border-radius: 4px;
    }
    .profile-menu-item.active .profile-dropdown {
        display: block;
    }
    .profile-dropdown li a {
        padding: 10px 15px 10px 40px;
        /* Increased indent for better hierarchy */
        color: rgba(255, 255, 255, 0.9);
        font-size: 15px;
        font-weight: 500;
        display: flex;
        align-items: center;
        gap: 10px;
    }
    .profile-dropdown li a:hover {
        background-color: var(--topics-color, #8C2D18);
        /* Use theme accent color */
        color: #fff;
    }
    /* Add icons to dropdown items */
    .profile-dropdown li a i {
        font-size: 16px;
        color: rgba(255, 255, 255, 0.9);
    }
    .profile-dropdown li a:hover i {
        color: #fff;
    }
    .profile-dropdown ul {
        list-style-type: none;
        margin: 0;
    }
    .profile-dropdown>a {
        padding: 10px 15px !important;
        background-color: #8f6540;
    }
    .custom-menu-logo .custom-logo {
        max-height: 90px;
        width: auto;
        margin-left: -40px;
    }
}


/* topic section */


/* Container */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}


/* Section */

.section {
    width: 100%;
}


/* Section Header */

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: #1f2937;
}

.section-description {
    font-size: 1.125rem;
    color: #4b5563;
    margin-top: 0.5rem;
}


/* Search Bar */

.search-bar {
    position: relative;
    max-width: 32rem;
    margin: 0 auto 2rem;
}

.search-bar-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1rem;
}

#search-bar {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    background-color: #fff;
}

#search-bar:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

#search-bar::placeholder {
    color: #9ca3af;
}


/* Sorting Tabs Responsive Styles */

.section .tabs#category-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    overflow-x: auto;
    padding: 10px 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-behavior: smooth;
    width: 100%;
    cursor: grab;
    scroll-snap-type: x mandatory;
}

.section .tabs#category-tabs:active {
    cursor: grabbing;
    /* Change cursor when dragging */
}

.section .tabs#category-tabs::-webkit-scrollbar {
    display: none;
}

.section .tabs#category-tabs .tab {
    padding: 0.5rem 1rem;
    background-color: #e5e7eb;
    color: #4b5563;
    font-weight: 500;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex: 0 0 auto;
    scroll-margin: 50%;
    user-select: none;
    scroll-snap-align: start;
}

.section .tabs#category-tabs .tab:hover {
    background-color: #d1d5db;
}

.section .tabs#category-tabs .tab.active {
    background-color: #8C2D18;
    color: #fff;
    transform: scale(1.05);
}


/* Responsive Adjustments */

@media (max-width: 768px) {
    .section .tabs#category-tabs {
        margin-bottom: 1.5rem;
    }
    .section .tabs#category-tabs .tab {
        padding: 0.4rem 0.8rem;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .section .tabs#category-tabs {
        margin-bottom: 1rem;
    }
    .section .tabs#category-tabs .tab {
        padding: 0.3rem 0.7rem;
        font-size: 13px;
    }
}


/* Bookmark Icon */

.bookmark-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #ccc;
    font-size: 20px;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 2;
}

.bookmark-icon:hover {
    color: #8C2D18;
}

.bookmark-icon.bookmarked {
    color: #3b82f6;
}


/* Topics Grid */

.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    /* Keep this for multiple boxes */
    gap: 1.5rem;
}


/* Topic Box Styling */

.topic-box {
    background-color: #fff;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    min-height: 400px;
    /* Use min-height instead of height */
    position: relative;
    max-width: 350px;
    width: 100%;
    margin: 0 auto;
    padding-bottom: 1rem;
    /* Add padding to ensure button has space */
}


/* Rest of your CSS remains the same */

.topic-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}


/* Topic Image */

.topic-image img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}


/* Topic Content */

.topic-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin: 1rem 1rem 0.5rem;
    font-family: 'Noto Sans JP', sans-serif;
    flex-grow: 0;
    direction: rtl;
}

.topic-introduction {
    display: block !important;
    visibility: visible !important;
    color: #555;
    font-size: 16px !important;
    margin: 0 1rem 2rem;
    /* Increase bottom margin for spacing */
    line-height: 1.5;
    word-wrap: break-word;
    flex-grow: 1;
    direction: ltr;
}


/* Read More Button */


/* Read More Button */

.read-more-button {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background-color: #3b82f6;
    color: #fff;
    text-decoration: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    text-align: center;
}

.read-more-button:hover {
    background-color: #2563eb;
    color: #fff !important;
}


/* Responsive Design */

@media (max-width: 640px) {
    .topics-grid {
        grid-template-columns: 1fr;
    }
    .topic-box {
        height: 380px;
        max-width: 100%;
        /* Allow full width on small screens */
    }
    .topic-image img {
        height: 160px;
    }
}

@media (min-width: 768px) {
    .topics-grid {
        grid-template-columns: repeat(3, 1fr);
        /* Fix 3 columns from 768px onwards */
    }
    .container {
        padding: 2rem 1.5rem;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 2rem 2rem;
    }
}

.read-more-button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}


/* topic content */

.gitbook-layout {
    display: flex;
    justify-content: center;
    gap: 50px;
    padding: 40px 15px;
    position: relative;
    width: 100%;
    min-height: calc(100vh - 120px);
    /* Adjust for header height */
    box-sizing: border-box;
    margin-top: 120px;
    /* Push the layout below the header */
}

.gitbook-content {
    max-width: 900px;
    flex: 1;
    background-color: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease-in-out;
}

.gitbook-content:hover {
    box-shadow: 0 15px 60px rgba(0, 0, 0, 0.1);
}


/* Progress bar styling */

.progress-bar-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background-color: #f0f0f0;
    border-radius: 0;
    /* Remove rounding for full-width top bar */
    overflow: hidden;
    z-index: 1000;
    /* Ensure it stays above other elements */
}

#reading-progress {
    height: 100%;
    width: 0;
    background: linear-gradient(to right, var(--secondary-color), var(--primary-color));
    border-radius: 0;
    /* Match container */
    transition: width 0.3s ease;
}


/* Progress bar styling */

.progress-bar-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background-color: #f0f0f0;
    border-radius: 0;
    overflow: hidden;
    z-index: 1000;
}

#reading-progress {
    height: 100%;
    width: 0;
    background: linear-gradient(to right, var(--secondary-color), var(--primary-color));
    border-radius: 0;
    transition: width 0.3s ease;
}


/* TOC Styling */

.gitbook-layout {
    display: flex;
    justify-content: center;
    gap: 50px;
    padding: 40px 15px;
    position: relative;
    width: 100%;
    min-height: calc(100vh - 120px);
    box-sizing: border-box;
    margin-top: 120px;
}

.gitbook-toc {
    width: 280px;
    position: fixed;
    top: 295px;
    /* Matches the JavaScript offset */
    right: 15px;
    background: #f9f9f9;
    padding: 25px;
    border-radius: 10px;
    font-size: 15px;
    color: #666;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: calc(100vh - 120px);
    /* Avoid overflow */
    /* Initial height */
    transition: max-height 0.3s ease;
    align-self: flex-start;
    /* Important for sticky behavior */
}

.gitbook-toc h2 {
    font-size: 22px;
    color: #444;
    font-weight: 600;
    margin-bottom: 15px;
}

#table-of-contents a {
    display: block;
    margin-bottom: 10px;
    text-decoration: none;
    color: #666;
    font-weight: 500;
    margin-left: 0px;
    transition: all 0.3s ease;
}

#table-of-contents a.active {
    color: #bf814b;
    font-weight: 600;
    background-color: rgba(191, 129, 75, 0.1);
    padding-left: 20px;
    border-left: 4px solid #bf814b;
}

#table-of-contents a:hover {
    color: #bf814b;
    padding-left: 20px;
}

.toc-level-1 {
    font-size: 18px;
    font-weight: bold;
}

.toc-level-2 {
    margin-left: 20px;
    font-size: 16px;
}

.toc-level-3 {
    margin-left: 40px;
    font-size: 14px;
}


/* Responsive Design */

@media (max-width: 768px) {
    .gitbook-layout {
        flex-direction: column-reverse !important;
        gap: 30px;
        margin-top: 0;
        padding: 20px 15px;
    }
    .gitbook-toc {
        width: 100%;
        position: relative;
        top: auto !important;
        right: auto;
        padding: 15px;
        max-height: none !important;
    }
    .progress-bar-container {
        position: fixed;
        top: 0;
        width: 100%;
    }
}


/* Page Title Style */

.gitbook-content h1 {
    font-size: 48px;
    font-weight: 700;
    color: #2c2c2c;
    margin-bottom: 20px;
    line-height: 1.3;
    letter-spacing: 1px;
    border-bottom: 3px solid #bf814b;
    padding-bottom: 15px;
    transition: color 0.3s ease;
    direction: rtl;
    text-align: center;
}


/* Paragraph Styling */

.gitbook-content p {
    font-size: 18px;
    color: #555;
    line-height: 1.8;
    text-align: justify;
    margin-bottom: 20px;
    /* text-indent: 25px; */
}


/* Blockquote Styling */

.gitbook-content blockquote {
    font-style: italic;
    color: #777;
    border-left: 5px solid #bf814b;
    padding-left: 20px;
    margin: 30px 0;
    font-size: 1.1em;
}

/* Multilingual learning block inside topic content */
.gitbook-content blockquote.ml-blockquote {
    background-color: rgba(191, 129, 75, 0.06);
    border-radius: 8px;
    border-left-width: 5px;
    border-left-color: #bf814b;
    padding: 18px 20px;
    font-style: normal;
    color: #27272a;
}

.gitbook-content .ml-section {
    margin: 10px 0;
}

.gitbook-content .ml-section > *:first-child {
    margin-top: 0;
}

.gitbook-content .ml-section > *:last-child {
    margin-bottom: 0;
}

.gitbook-content .ml-line {
    margin: 6px 0;
    font-size: 17px;
    line-height: 1.7;
}

/* Arabic line: right aligned, RTL */
.gitbook-content .ml-ar {
    direction: rtl !important;
    text-align: right !important;
    font-weight: 500;
}

/* Japanese line: left aligned, LTR */
.gitbook-content .ml-ja {
    direction: ltr !important;
    text-align: left !important;
    font-weight: 400;
}

/* English (or transliteration) line: left aligned, LTR */
.gitbook-content .ml-en {
    direction: ltr !important;
    text-align: left !important;
    font-style: italic;
    opacity: 0.9;
}

/* Combined title (transliteration + Arabic) */
.gitbook-content .ml-title {
    text-align: center !important;
    color: #800000;
    margin: 24px 0 12px;
}

.gitbook-content .ml-title-en,
.gitbook-content .ml-title-ar {
    color: #800000;
}

/* Right‑aligned phrase line */
.gitbook-content .ml-phrase {
    direction: rtl !important;
    text-align: right !important;
    font-size: 18px;
    margin: 10px 0;
}

/* Apply direction/alignment to inner elements for big blocks */
.gitbook-content .ml-ar p,
.gitbook-content .ml-ar h1,
.gitbook-content .ml-ar h2,
.gitbook-content .ml-ar h3,
.gitbook-content .ml-ar ul,
.gitbook-content .ml-ar ol {
    direction: rtl !important;
    text-align: right !important;
}

.gitbook-content .ml-ja p,
.gitbook-content .ml-ja h1,
.gitbook-content .ml-ja h2,
.gitbook-content .ml-ja h3,
.gitbook-content .ml-ja ul,
.gitbook-content .ml-ja ol,
.gitbook-content .ml-en p,
.gitbook-content .ml-en h1,
.gitbook-content .ml-en h2,
.gitbook-content .ml-en h3,
.gitbook-content .ml-en ul,
.gitbook-content .ml-en ol {
    direction: ltr !important;
    text-align: left !important;
}


/* Hover Effects on TOC */

.gitbook-toc a {
    transition: color 0.2s ease, padding-left 0.2s ease;
}

.gitbook-toc a:hover {
    color: #bf814b;
    padding-left: 20px;
}


/* Responsive Design */

@media (max-width: 768px) {
    .gitbook-layout {
        flex-direction: column;
        gap: 30px;
        min-height: auto;
        /* Remove min-height on mobile */
        margin-top: 0;
        /* Reset margin-top on mobile */
    }
    .gitbook-content {
        max-width: 100%;
        padding: 20px;
    }
    .gitbook-toc {
        width: 100%;
        position: static;
        /* TOC flows naturally on mobile */
        padding: 15px;
        height: auto !important;
        /* Reset dynamic height on mobile */
        min-height: auto;
        /* Remove min-height on mobile */
        overflow-y: visible;
        /* No scrolling needed on mobile */
    }
}


/* Motivation Notification Styling */

.motivation-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 300px;
    background-color: #ffffff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
    display: none;
    /* Hidden by default */
    z-index: 9999;
    animation: slide-in 0.5s ease-out;
}

.motivation-notification-content {
    display: flex;
    align-items: center;
}

.motivation-notification-close {
    margin-left: 10px;
    font-size: 20px;
    color: #aaa;
    cursor: pointer;
}

.motivation-notification-close:hover {
    color: #000;
}

.motivation-icon {
    font-size: 24px;
    color: #9e2a2f;
    /* Motivational red */
    margin-right: 10px;
}

#motivation-text {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}


/* profile page */

.profile-dashboard {
    display: flex;
    min-height: 800px;
    width: 100%;
    margin: 30px auto;
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    overflow: hidden;
    background-color: var(--bg-white);
}


/* Sidebar */

.profile-sidebar {
    width: 260px;
    background: linear-gradient(to bottom, var(--menu-background-color), var(--background-color));
    color: white;
    padding: 30px 0;
    position: relative;
    transition: var(--transition);
}

.avatar-wrapper {
    text-align: center;
    padding: 20px 15px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.avatar-wrapper img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg-white);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transition: var(--transition);
}

.avatar-wrapper img:hover {
    transform: scale(1.05);
}

.avatar-wrapper h3 {
    margin-top: 15px;
    font-size: 20px;
    color: white;
    font-weight: 600;
}

.profile-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.profile-sidebar ul li {
    margin-bottom: 5px;
}

.profile-sidebar ul li a {
    display: block;
    padding: 12px 25px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: var(--transition);
    font-size: 16px;
    position: relative;
}

.profile-sidebar ul li a:hover,
.profile-sidebar ul li a.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding-left: 30px;
}

.profile-sidebar ul li a.active:before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background-color: var(--secondary-color);
}

.logout-link {
    color: rgba(255, 255, 255, 0.8);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 15px;
}

.logout-link:hover {
    color: #ff6b6b;
}


/* Main Content Area */

.profile-main {
    flex: 1;
    padding: 0;
    background-color: var(--bg-white);
    position: relative;
}

.tab-content {
    display: none;
    padding: 30px;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

.tab-content h2 {
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 28px;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    position: relative;
}

.tab-content h2:after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background-color: var(--primary-color);
}

.tab-content h3 {
    margin-top: 30px;
    margin-bottom: 15px;
    color: var(--text-color);
    font-size: 22px;
}


/* Profile Overview */

.cover-photo {
    height: 200px;
    border-radius: var(--radius);
    background-color: #e9edf5;
    background-size: cover;
    background-position: center;
    margin-bottom: 20px;
    position: relative;
}

#profile-overview p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: var(--text-color);
}

#profile-overview strong {
    font-weight: 600;
    color: var(--primary-dark);
}

#profile-overview a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

#profile-overview a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.remove-avatar-btn {
    display: block;
    margin-top: 10px;
    padding: 6px 12px;
    background-color: var(--error-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
    margin-bottom: 10px;
}

.remove-avatar-btn:hover {
    background-color: #d32f2f;
}

.upload-preview {
    position: relative;
    margin-bottom: 15px;
}

.current-avatar {
    display: block;
    max-width: 150px;
    margin-bottom: 10px;
}


/* Recent Topics Section */

.recent-topics {
    margin-top: 20px;
}

.topic-item {
    display: flex;
    margin-bottom: 25px;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    background-color: var(--bg-white);
    transition: var(--transition);
    position: relative;
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.topic-item:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transform: translateY(-3px);
}

.topic-item img {
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
    object-fit: cover;
    margin-right: 20px;
}

.topic-info {
    flex: 1;
    min-width: 200px;
}

.topic-info h4 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 18px;
}

.topic-info h4 a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.topic-info h4 a:hover {
    color: var(--primary-color);
}

.topic-info p {
    color: var(--text-light);
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.topic-info ul {
    padding-left: 20px;
    margin-bottom: 15px;
    color: var(--text-light);
    font-size: 14px;
}

.topic-info ul li {
    margin-bottom: 5px;
}


/* .progress-bar {
    height: 8px;
    background-color: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(to right, var(--secondary-color), var(--primary-color));
    border-radius: 4px;
    transition: width 0.6s ease;
} */

.topic-meta {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 15px;
    flex-basis: 100%;
    text-align: right;
}

.topic-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-basis: 100%;
    justify-content: flex-end;
}

.topic-actions button {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 8px 15px;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-color);
}

.topic-actions button:hover {
    background-color: var(--bg-light);
}

.topic-actions button.bookmarked {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    height: 35px;
}

.topic-actions button.completed {
    background-color: var(--success-color);
    color: white;
    border-color: var(--success-color);
    cursor: default;
}


/* Your Discussions Tab */

#recent-discussions {
    padding: 30px;
}

.recent-discussions {
    margin-top: 20px;
}

.discussion-item {
    display: flex;
    margin-bottom: 25px;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    background-color: var(--bg-white);
    transition: var(--transition);
    position: relative;
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.discussion-item:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transform: translateY(-3px);
}

.discussion-info {
    flex: 1;
    min-width: 200px;
}

.discussion-info h4 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 18px;
}

.discussion-info h4 a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.discussion-info h4 a:hover {
    color: var(--primary-color);
}

.discussion-info p {
    color: var(--text-light);
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.discussion-info strong {
    color: var(--primary-dark);
}

.discussion-meta {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 15px;
    flex-basis: 100%;
    text-align: right;
}


/* Responsive Design for Discussions */

@media only screen and (max-width: 768px) {
    .discussion-item {
        flex-direction: column;
    }
    .discussion-item img {
        margin-right: 0;
        margin-bottom: 15px;
        width: 100%;
        height: 180px;
    }
}

@media only screen and (max-width: 480px) {
    .discussion-info {
        min-width: 100%;
    }
    .discussion-meta {
        text-align: left;
    }
}


/* Settings Tab */

.profile-form {
    max-width: 600px;
    margin-bottom: 30px;
}

.profile-form p {
    margin-bottom: 20px;
}

.profile-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.profile-form input[type="text"],
.profile-form input[type="url"],
.profile-form input[type="password"],
.profile-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 16px;
    transition: var(--transition);
}

.profile-form input[type="text"]:focus,
.profile-form input[type="url"]:focus,
.profile-form input[type="password"]:focus,
.profile-form textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 111, 220, 0.1);
    outline: none;
}

.profile-form textarea {
    height: 120px;
    resize: vertical;
}


/* File Upload Fields */

.profile-form input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    background-color: var(--bg-light);
    transition: var(--transition);
}

.profile-form input[type="file"]:hover {
    border-color: var(--menu-background-color);
    background-color: rgba(191, 129, 75, 0.05);
}

.profile-form input[type="file"]::file-selector-button {
    padding: 8px 16px;
    background-color: var(--menu-background-color);
    color: white;
    border: none;
    border-radius: 4px;
    margin-right: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.profile-form input[type="file"]::file-selector-button:hover {
    background-color: var(--topics-color);
}

.profile-form input[type="checkbox"] {
    margin-right: 10px;
}

.profile-form input[type="submit"] {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: var(--transition);
    margin-top: 10px;
}

.profile-form input[type="submit"]:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}


/* Success/Error Messages */

p[style*="color:green"] {
    background-color: rgba(76, 175, 80, 0.1);
    border-left: 4px solid var(--success-color);
    padding: 12px 15px;
    margin: 20px 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--success-color) !important;
    font-weight: 500;
}

p[style*="color:red"] {
    background-color: rgba(244, 67, 54, 0.1);
    border-left: 4px solid var(--error-color);
    padding: 12px 15px;
    margin: 20px 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--error-color) !important;
    font-weight: 500;
}


/* Responsive Design */

@media only screen and (max-width: 992px) {
    .profile-dashboard {
        flex-direction: column;
    }
    .profile-sidebar {
        width: 100%;
        padding: 20px 0;
    }
    .avatar-wrapper {
        padding: 15px 15px 20px;
    }
    .avatar-wrapper img {
        width: 100px;
        height: 100px;
    }
    .profile-sidebar ul {
        display: flex;
        flex-wrap: wrap;
        margin: 10px 0;
        justify-content: center;
        align-items: center;
    }
    .profile-sidebar ul li {
        margin: 5px;
        width: auto;
    }
    .profile-sidebar ul li a {
        padding: 10px 20px;
        border-radius: var(--radius);
    }
    .profile-sidebar ul li a.active:before {
        display: none;
    }
    .profile-sidebar ul li a:hover,
    .profile-sidebar ul li a.active {
        padding-left: 20px;
        background: rgba(255, 255, 255, 0.2);
    }
    .tab-content {
        padding: 20px;
    }
    .tab-content h2 {
        font-size: 24px;
    }
    .cover-photo {
        height: 150px;
    }
    .logout-link {
        margin-top: 0;
        /* Remove the top margin that was pushing it down */
        border-top: none;
        /* Remove the border that was separating it */
        order: 5;
        /* Explicitly place it at the end */
        width: 100%;
        /* Make it full width if you want it centered */
        text-align: center;
        /* Center the text */
        padding: 10px 20px !important;
        /* Ensure consistent padding */
    }
}

@media only screen and (max-width: 768px) {
    .topic-item {
        flex-direction: column;
    }
    .topic-item img {
        margin-right: 0;
        margin-bottom: 15px;
        width: 100%;
        height: 180px;
    }
    .topic-actions {
        justify-content: flex-start;
    }
    .profile-form {
        max-width: 100%;
    }
}

@media only screen and (max-width: 480px) {
    .profile-sidebar ul li a {
        font-size: 14px;
        padding: 8px 15px;
    }
    .tab-content {
        padding: 15px;
    }
    .tab-content h2 {
        font-size: 22px;
        margin-bottom: 20px;
    }
    .tab-content h3 {
        font-size: 18px;
    }
    .profile-form input[type="submit"] {
        width: 100%;
    }
    .topic-actions {
        flex-direction: column;
        gap: 5px;
    }
    .topic-actions button {
        width: 100%;
    }
}


/* login and register page */

.login-form {
    max-width: 300px;
    margin: 0 auto;
    padding: 20px;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 8px;
    margin: 5px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.login-form button {
    width: 100%;
    padding: 10px;
    background: #b45f2e;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.login-form .forgot-password {
    text-align: center;
    margin-top: 10px;
}

.login-form .forgot-password a {
    color: #007bff;
    text-decoration: none;
}

.error-message {
    color: red;
    margin-bottom: 10px;
    padding: 10px;
    background: #ffe6e6;
    border-radius: 4px;
}

.error-message {
    color: red;
    margin-bottom: 10px;
    padding: 10px;
    background: #ffe6e6;
    border-radius: 4px;
}

.success-message {
    color: green;
    margin-bottom: 10px;
    padding: 10px;
    background: #e6ffe6;
    border-radius: 4px;
}

.register-form {
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
}

.register-form input[type="text"],
.register-form input[type="email"],
.register-form input[type="password"] {
    width: 100%;
    padding: 8px;
    margin: 5px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.register-form input[type="submit"] {
    width: 100%;
    padding: 10px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.error-message {
    color: red;
    margin-bottom: 10px;
    padding: 10px;
    background: #ffe6e6;
    border-radius: 4px;
}

.input-error {
    border-color: red !important;
}

.password-strength {
    height: 5px;
    background: #ddd;
    margin-top: 5px;
    border-radius: 3px;
}

.password-strength-bar {
    height: 100%;
    width: 0;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.strength-weak {
    background: red;
}

.strength-medium {
    background: orange;
}

.strength-strong {
    background: green;
}

.password-strength-text {
    font-size: 12px;
    margin-top: 5px;
}

.forgot-password-container {
    max-width: 400px;
    margin: 40px auto;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.forgot-password-container h2 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 600;
}

@media (max-width: 600px) {
    .forgot-password-container {
        margin: 20px;
        padding: 15px;
    }
    .forgot-password-container h2 {
        font-size: 20px;
    }
}


/* Custom Footer Styling */


/* Hide the default Astra footer */

.site-footer {
    display: none !important;
}

.custom-footer {
    background: var(--menu-background-color, #1a1a1a);
    /* Dark background with fallback */
    color: #c49a6c;
    /* Elegant gold text */
    padding: 30px 20px;
    text-align: center;
    font-size: 14px;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 900px;
    margin: auto;
    padding-bottom: 20px;
    flex-wrap: wrap;
    /* Allow items to wrap on smaller screens */
}

.footer-left,
.footer-right,
.footer-center {
    flex: 1;
    text-align: center;
    min-width: 200px;
    /* Ensure minimum width for readability */
    margin-bottom: 20px;
    /* Space between stacked elements */
}

.footer-left a,
.footer-left p {
    color: #334155;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-left a:hover {
    text-decoration: underline;
}

.footer-center {
    text-align: center;
}

.brand-name {
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 2px;
    color: #334155;
}

.footer-right {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.social-icon {
    font-size: 18px;
    color: #334155;
    text-decoration: none;
    margin: 0 10px;
    transition: transform 0.3s, color 0.3s;
}

.social-icon:hover {
    transform: scale(1.1);
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid #334155;
    padding-top: 10px;
    margin-top: 10px;
}

p.cred,
.footer-bottom p.copy {
    color: #334155;
}

.footer-links a {
    color: #334155;
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.3s;
}

.footer-links a:hover {
    text-decoration: underline;
}


/* Responsive Design */

@media (max-width: 768px) {
    .footer-container {
        flex-direction: column;
        /* Stack elements vertically */
        align-items: center;
    }
    .footer-left,
    .footer-right,
    .footer-center {
        flex: none;
        /* Remove flex grow/shrink */
        width: 100%;
        /* Full width for each section */
        margin-bottom: 15px;
        /* Consistent spacing */
    }
    .brand-name {
        font-size: 20px;
        /* Slightly smaller for mobile */
    }
    .social-icon {
        font-size: 16px;
        /* Smaller icons for mobile */
    }
    .footer-links a {
        margin: 0 5px;
        /* Reduce spacing for links */
    }
}

@media (max-width: 480px) {
    .custom-footer {
        padding: 20px 10px;
        /* Reduce padding for small screens */
        font-size: 12px;
        /* Smaller font size */
    }
    .brand-name {
        font-size: 18px;
        /* Further reduce brand name size */
    }
    .social-icon {
        font-size: 14px;
        /* Even smaller icons */
        margin: 0 8px;
        /* Adjust spacing */
    }
    .footer-links a {
        display: inline-block;
        /* Stack links vertically if needed */
        margin: 5px 0;
        /* Vertical spacing for links */
    }
    .footer-right {
        gap: 10px;
        /* Reduce gap between social icons */
    }
}