/* --- GENERAL & LAYOUT FIXES --- */
html, body, #root {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden; 
}
body {
    font-family: 'Montserrat', sans-serif;
    background-color: black;
}
.containerem {
    display: flex;
    height: 100%;
    width: 100vw; 
    position: relative; 
}

/* --- STREAK ANIMATION --- */
@keyframes streak-progress {
    from { width: 0%; }
    to { width: 50%; }
}
.animate-streak-progress {
    animation: streak-progress 1.5s ease-out 0.5s forwards;
}

/* --- LEFT SECTION STYLES --- */
.left-section {
    width: 45vw;
    max-width: 700px;
    flex-shrink: 0; 
    background-color: black;
    height: 100%;
    padding: 5vh 5vh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    position: relative; 
}
.left-section::-webkit-scrollbar {
    display: none;
}
.logo-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    min-height: 0vh;
}
.logo {
    color: white;
    font-weight: 800;
    margin: 0;
    font-size: 4vw;
    flex-shrink: 0;
    line-height: 1;
}
.logo-com {
    color: #333;
    font-size: 2vw;
}
.logo-faces {
    display: flex;
    padding-left: 1vw;
    align-items: center;
}
.logo-face-icon {
    height: 4vw;
    width: 4vw;
    max-height: 45px;
    max-width: 45px;
    object-fit: cover;
}
.logo-face-icon:first-child {
    margin-left: 0;
}

.highlight-item, .premium-item, .menu-item, .menu-toggle, .share-button, .tab-button, .setting-button, .mobile-back-button {
    touch-action: manipulation; /* Fix for iOS click delay */
}

.highlight-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: white;
    font-size: 0.9vw;
    font-weight: 800;
    background: linear-gradient(to right, #DD221F, #cca300);
    padding: 5px 12px;
    border-radius: 20px;
    border: solid white 2px;
    cursor: pointer;
}
.premium-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: white;
    font-size: 0.9vw;
    font-weight: 800;
    border: 2px solid white;
    padding: 3px 10px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.premium-item:hover {
    background-color: white;
    color: black;
}
.menu-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 4vh;
    flex-shrink: 0;
}
.menu-row {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 4vh;
    flex-shrink: 0;
    transition: margin-bottom 0.3s ease-in-out;
}
.collapsible-menu .menu-row {
    justify-content: center;
    gap: 4vw;
}
.menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    margin: 0;
    position: relative;
}
.circle {
    width: 11vh;
    height: 11vh;
    background-color: black;
    border-radius: 20%;
    margin-bottom: 1vh;
    border: 2px solid white;
    transition: all 0.3s ease-in-out;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    position: relative;
}
.circle.active {
    transform: scale(1.1) translateY(3px);
    z-index: 10;
}
.inner-circle {
    width: 9vh;
    height: 9vh;
    background-color: #333;
    border-radius: 20%;
    transition: all 0.3s ease-in-out;
    display: flex;
    justify-content: center;
    align-items: center;
}
.menu-icon {
    width: 4.5vh;
    height: 4.5vh;
    fill: white;
    transition: fill 0.3s ease-in-out;
}
.menu-item:hover .circle:not(.active):not(.locked-circle) .inner-circle {
    background-color: #222;
}
.circle.active .inner-circle {
    background-color: white;
}
.circle.active .inner-circle .menu-icon {
    fill: black;
}
.menu-text {
    color: white;
    font-weight: 800;
    font-size: 1vw;
    transition: font-size 0.3s ease-in-out;
}
.collapsible-menu {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.7s ease-in-out, opacity 0.5s ease-in-out;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.collapsible-menu.open {
    max-height: 50vh;
    opacity: 1;
}
.menu-controls {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: 100%;
    gap: 20px;
}
.menu-toggle {
    display: none; /* Hidden by default per request */
    grid-column: 2;
    justify-self: center;
    cursor: pointer;
    width: 5vh;
    height: 5vh;
    border: 2px solid white;
    border-radius: 50%;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    transition: all 0.3s ease-in-out;
}
.premium-item-container {
    grid-column: 1;
    justify-self: center;
}
.highlight-item-container {
    grid-column: 3;
    justify-self: center;
}
.arrow-icon {
    width: 2vh;
    height: 2vh;
    fill: white;
    transition: transform 0.5s ease;
}
.arrow-icon.open {
    transform: rotate(180deg);
}
.post-container {
    margin-top: 5vh;
    background-color: #1a1a1a;
    border-radius: 15px;
    padding: 4vh 2vh;
    color: white;
    flex-shrink: 0;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.post-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(255, 255, 255, 0.1);
    cursor: pointer;
}
.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 2vh;
}
.post-profile-pic {
    width: 7.5vh;
    height: 7.5vh;
    border-radius: 50%;
    border: 2px solid white;
    background-color: black;
    margin-right: 1.5vh;
    background-image: url('https://placehold.co/100x100/000000/FFFFFF?text=M');
    background-size: cover;
    background-position: center;
}
.post-author-info {
    display: flex;
    flex-direction: column;
}
.post-author-name {
    font-weight: 800;
    font-size: 1.2vw;
}
.post-timestamp {
    font-size: 0.8vw;
    color: #888;
}
.post-text {
    font-size: 0.9vw;
    line-height: 1.5;
    margin-bottom: 2vh;
}
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 10px;
}
.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.share-button {
    background-color: #333;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.share-button:hover {
    background-color: #555;
}
.share-icon {
    fill: white;
    width: 18px;
    height: 18px;
}

.right-section {
    flex-grow: 1;
    min-width: 0; 
    background: white;
    padding: 5vh;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
}
.content-title {
    font-size: 4vw;
    font-weight: 800;
    color: black;
    margin: 0;
    padding-top: 0;
    flex-shrink: 0;
    font-family: 'Montserrat', sans-serif;
    line-height: 1;
}
.content-area {
    font-family: 'Inter', sans-serif;
}
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: black;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: white;
    font-family: 'Montserrat', sans-serif;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-in-out;
    padding: 5vh;
    box-sizing: border-box;
}
.fullscreen-overlay.visible {
    opacity: 1;
    pointer-events: all;
}
.progress-bar-container {
    width: 300px;
    height: 20px;
    background-color: transparent;
    border: 2px solid white;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 20px;
}
.progress-bar {
    height: 100%;
    width: 0%;
    background-color: white;
    border: 1px solid black;
    box-sizing: border-box;
    border-radius: 8px;
    transition: width 1s ease-out;
}
.menu-item.locked {
    cursor: not-allowed;
}
.menu-item.locked .circle, .menu-item.locked .menu-text {
    opacity: 0.5;
}
.lock-icon {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 3vh;
    height: 3vh;
    fill: white;
    background-color: rgba(0,0,0,0.7);
    border-radius: 50%;
    padding: 2px;
}
.tooltip-text {
    visibility: hidden;
    width: 160px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 0;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -80px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.8vw;
    font-weight: normal;
}
.menu-item.locked:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}
.tab-container {
    display: flex;
    border: 2px solid black;
    border-radius: 9999px;
    overflow: hidden;
    flex-shrink: 0;
}
.tab-button {
    padding: 6px 20px;
    background-color: white;
    color: black;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}
.tab-button:not(:last-child) {
    border-right: 2px solid black;
}
.tab-button.active {
    background-color: black;
    color: white;
}
.setting-section {
    margin-bottom: 2vh;
}
.setting-label {
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    margin-bottom: 0.8vh;
}
.settings-row {
    display: flex;
    align-items: center;
    gap: 0.8vw;
    flex-wrap: wrap;
}
.setting-button {
    border: 2px solid black;
    background-color: white;
    color: black;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 0.8rem;
    padding: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 45px;
    height: 45px;
    border-radius: 8px;
}
.setting-button.interval-button {
    height: auto;
    min-height: 45px;
    padding: 6px 10px;
}
.setting-button:hover {
    background-color: #f0f0f0;
}
.setting-button.active {
    background-color: black;
    color: white;
}
.clef-button {
    width: 45px;
}
.clef-icon {
    width: 22px;
    height: 22px;
    fill: currentColor;
}
.time-input {
    border: 2px solid black;
    background-color: white;
    color: black;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 0.8rem;
    width: 70px;
    text-align: center;
    padding: 6px;
    height: 45px;
    border-radius: 8px;
}
.stat-box {
    border: 2px solid black;
    border-radius: 12px;
    padding: 1.2rem;
    background-color: white;
    transition: background-color 0.2s ease;
    position: relative;
}
.stat-box:hover {
    background-color: #f0f0f0;
}
.new-record-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    color: white;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: bold;
    transition: all 0.5s ease;
}
.note-stats-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0,0,0,0.9);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    color: white;
    overflow-y: auto;
    padding: 5vh;
    box-sizing: border-box;
}
.note-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 2rem;
    width: 100%;
    max-width: 1200px;
}
.note-stat-item {
    background-color: white;
    color: black;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}
.stat-category-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
    background-color: #f3f4f6;
    border-radius: 12px;
}
.stat-category-button {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background-color: white;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.stat-category-button:hover {
    background-color: #e5e7eb;
}
.stat-category-button.active {
    background-color: black;
    color: white;
    border-color: black;
}
.mobile-back-button {
    display: none;
}
.confirmation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    padding: 1rem;
    box-sizing: border-box;
}
.confirmation-modal-content {
    background-color: white;
    color: black;
    padding: 2rem;
    border-radius: 12px;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
.preface-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5vh;
    background: linear-gradient(to bottom, white, transparent);
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    font-size: 0.8rem;
    color: #4a5568;
    z-index: 100;
}

.menu-row-3, .menu-row-2 {
    margin-left: auto;
    margin-right: auto;
}
.menu-row-3 {
    width: 75%; 
}
.menu-row-2 {
    width: 50%; 
}
.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 2px solid black;
    border-radius: 50%;
    font-weight: bold;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    cursor: help;
    color: black;
}

/* --- RESPONSIVE / MOBILE STYLES --- */
@media (max-width: 1024px) {
    .containerem {
        overflow-x: hidden;
    }
    .left-section, .right-section {
        width: 100vw;
        height: 100%;
        position: absolute;
        top: 0;
        transition: transform 0.4s ease-in-out;
        will-change: transform;
        padding: 5vw;
        overflow-x: hidden;
    }
    .left-section {
        left: 0;
        z-index: 10;
        max-width: none;
    }
    .right-section {
        left: 0;
        transform: translateX(100%);
        z-index: 20;
    }
    .right-section.visible-mobile {
        transform: translateX(0);
    }
    .logo, .content-title { font-size: 10vw; }
    .logo-com { font-size: 6vw; }
    .logo-face-icon {
        height: 8vw;
        width: 8vw;
        margin-left: -3vw;
    }
    .premium-item, .highlight-item { font-size: 2.0vw; padding: 1vh 2vw; }
    .post-author-name { font-size: 3.8vw; }
    .post-timestamp { font-size: 2.5vw; }
    .post-text { font-size: 3.8vw; }
    .tooltip-text { font-size: 2.5vw; }
    .post-container {
        margin-top: 1em;
        padding: 2vh 2vh;
    }
    .post-profile-pic { width: 6vh; height: 6vh; }
    .circle { width: 10vh; height: 10vh; }
    .inner-circle { width: 8vh; height: 8vh; }
    .menu-text { font-size: 2.2vw; }
    .menu-toggle { width: 7vh; height: 7vh; }
    .menu-icon { width: 4vh; height: 4vh; }
    .mobile-back-button {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 5vw;
        right: 5vw;
        background: rgba(0,0,0,0.08);
        border: 1px solid #bbb;
        color: #333;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        z-index: 30;
        font-size: 24px;
        line-height: 1;
        text-align: center;
    }
    .stat-box { text-align: center; }
    .settings-row { gap: 1.5vw; }
    .setting-button { padding: 4px; min-width: 40px; height: 40px; font-size: 0.7rem; }
    .setting-button.interval-button { height: auto; min-height: 40px; padding: 4px 8px; }
    .time-input { height: 40px; width: 60px; }
    .menu-wrapper {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-top: 0vh;
        flex-shrink: 0;
    }
    .menu-row {
        margin-bottom: 2.5vh;
    }
}

@media (max-width: 480px) {
    .left-section, .right-section {
        padding: 2.5vw 2.5vw;
    }
    .menu-wrapper {
        padding-top: 2.5vw;
    }
    .circle { width: 15vw; height: 15vw; max-width: 65px; max-height: 80px; }
    .inner-circle { width: 12vw; height: 12vw; max-width: 65px; max-height: 64px; }
    .menu-item { margin: 0; }
    .menu-text { font-size: 2.8vw; }
    .menu-icon { width: 3.5vh; height: 3.5vh; }
}

/* --- MOBILE LANDSCAPE STYLES --- */
@media (max-height: 500px) and (orientation: landscape) {
    .left-section { padding: 2vh 5vw; }
    .circle { width: 15vh; height: 15vh; }
    .inner-circle { width: 12vh; height: 12vh; }
    .menu-icon { width: 6vh; height: 6vh; }
    .menu-row { margin-bottom: 2vh; }
    .menu-wrapper { margin-top: 2.5vh; }
    .post-container { margin-top: 2vh; }
    .right-section { padding: 2vh 5vw; }
    .tutorial-content { padding-top: 0; padding-bottom: 0; }
    .setting-section { margin-bottom: 1.5vh; }
    .settings-row { gap: 1vw; }
    .setting-button { height: 35px; min-width: 35px; font-size: 0.7rem; }
    .time-input { height: 35px; width: 55px; }
}