/* Base Styles */
main {
    padding-top: var(--header-height);
}

/* Theme Manager - Common Styles */
/* Header styles from landing.css */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    transition: all 0.3s ease;
}

.header-left a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.brand-name {
    font-weight: 700;
    font-size: 1.25rem;
    color: #000;
}

.header-nav {
    display: flex;
    gap: 2rem;
}

.header-nav a {
    color: #4A5568;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    position: relative;
}

.header-right {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.header-right a {
    text-decoration: none;
}

.login-btn {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.login-btn:hover {
    background: rgba(107, 70, 193, 0.1);
}

.cta-btn {
    padding: 0.5rem 1.25rem;
    font-size: 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

/* Color Overrides */
.primary-btn,
.cta-btn,
.mobile-menu-btn,
.step-front,
.step-number,
.chat-progress-dot.active {
    background: var(--main-color) !important;
}

.features-combined .feature-card i {
    color: var(--main-color) !important;
}

.neuroscience-card i,
.secondary-btn,
.step-front i,
.how-it-works .step i,
.step .fa-question-circle {
    color: var(--main-color) !important;
}

.header-nav a:hover {
    color: var(--main-color);
}

.header-nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--main-color);
    transition: width 0.2s ease;
}

.header-nav a:hover::after {
    width: 100%;
}

.theme-card:hover {
    border-color: var(--main-color);
}

.theme-card h3::before {
    background: rgba(var(--main-color-rgb), 0.3);
}

.theme-card h3 {
    border-bottom: 1px solid rgba(var(--main-color-rgb), 0.15);
}

.teacher-portrait {
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.theme-card:hover .teacher-portrait {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Teacher names in black */
.teacher-name {
    color: #2D3748;
}

.teacher-name span:first-child {
    color: #2D3748;
    opacity: 0.8;
}

.teacher-name span:last-child {
    color: #2D3748;
}

.mobile-menu-content a:hover {
    background: rgba(var(--main-color-rgb), 0.1);
}

.highlight {
    background: rgba(var(--main-color-rgb), 0.15);
    color: var(--main-color);
}

.author-avatar img {
    border: 3px solid var(--main-color);
}

.typing-indicator span {
    background: var(--main-color);
}

.chat-bubble.user {
    background: var(--main-color);
}

/* Background patterns */
body {
    background: 
        radial-gradient(circle at 1px 1px, rgba(var(--main-color-rgb), 0.2) 2px, transparent 0) 0 0 / 40px 40px,
        radial-gradient(circle at 50% 50%, rgba(var(--main-color-rgb), 0.25) 0%, transparent 70%) center/250% 250%,
        linear-gradient(to bottom right, #f8f9ff, #ffffff);
}

body::before {
    color: rgba(var(--main-color-rgb), 0.9);
}

/* Animations */
@keyframes flashBg {
    0%, 85%, 100% { background-color: transparent; }
    86%, 89% { background-color: rgba(var(--main-color-rgb), 0.8); }
    87%, 88% { background-color: rgba(255, 255, 255, 0.95); }
    90% { background-color: rgba(var(--main-color-rgb), 0.4); }
    91% { background-color: transparent; }
}

@keyframes flashOverlay {
    0%, 85%, 100% { background: transparent; }
    86%, 89% { background: linear-gradient(45deg, rgba(var(--main-color-rgb), 0.9), rgba(var(--main-color-rgb), 0.5)); }
    87%, 88% { background: rgba(255, 255, 255, 0.8); }
    90% { background: linear-gradient(45deg, rgba(var(--main-color-rgb), 0.5), rgba(var(--main-color-rgb), 0.2)); }
    91% { background: transparent; }
}

/* AI Chat Section */
.ai-chat-section {
    background: linear-gradient(135deg, rgba(var(--main-color-rgb), 0.1) 0%, rgba(255, 255, 255, 0.1) 100%);
    position: relative;
    overflow: hidden;
    margin-top: 4rem;
    border-radius: 24px;
    min-height: auto;
    height: auto;
}

.ai-chat-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(var(--main-color-rgb), 0.15) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
    pointer-events: none;
}

.ai-chat-container {
    position: relative;
    z-index: 1;
    height: auto;
}

.ai-chat-content {
    text-align: center;
    padding: 2rem 2rem 2rem;
    height: auto;
}

.chat-demo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 2rem auto;
    gap: 2rem;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
    height: auto;
}

.chat-demo.hidden {
    opacity: 0;
}

#macleod-chat {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.ai-chat-section.visible #macleod-chat {
    opacity: 1;
}

.author-avatar {
    text-align: center;
    margin-bottom: 1rem;
}

.author-avatar img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid var(--main-color);
    box-shadow: 0 8px 24px rgba(var(--main-color-rgb), 0.2);
    margin-bottom: 0.5rem;
    object-fit: cover;
}

.author-name {
    color: #2D3748;
    font-weight: 600;
    font-size: 0.9rem;
}

.typing-status {
    color: #718096;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    opacity: 0;
}

.ai-chat-section.visible .typing-status {
    animation: bubbleAppear 0.5s ease-out forwards;
    animation-delay: 3s;
}

.chat-bubbles {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 10px;
}

.chat-bubble {
    padding: 1rem 1.5rem;
    border-radius: 16px;
    max-width: 80%;
    opacity: 0;
    transform: translateY(20px);
}

.ai-chat-section.visible .chat-bubble {
    animation: bubbleAppear 0.5s ease-out forwards;
}

.chat-bubble.user {
    background: var(--main-color);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
    text-align: right;
}

.ai-chat-section.visible .chat-bubble.user {
    animation-delay: 0s;
}

.chat-bubble.author {
    background: white;
    color: #2D3748;
    text-align: left;
    border-bottom-left-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ai-chat-section.visible .chat-bubble.author {
    animation-delay: 0.75s;
}

.chat-bubble.typing {
    max-width: 60px;
    padding: 0.5rem 1rem;
}

.ai-chat-section.visible .chat-bubble.typing {
    animation-delay: 3s;
}

.chat-bubble p {
    margin: 0;
    line-height: 1.5;
}

.typing-indicator {
    display: flex;
    gap: 0.5rem;
    padding: 0.25rem 0;
    height: 24px;
    align-items: center;
    justify-content: center;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--main-color);
    opacity: 0.6;
}

.ai-chat-section.visible .typing-indicator span {
    animation: typing 1s infinite;
}

.ai-chat-section.visible .typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-chat-section.visible .typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

.chat-cta {
    margin-top: 2rem;
}

.chat-progress {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin: 0.5rem 0 2rem;
}

.chat-progress-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(var(--main-color-rgb), 0.2);
    transition: all 0.5s ease;
}

.chat-progress-dot.active {
    width: 24px;
    border-radius: 12px;
    background: var(--main-color);
}

.chat-progress-dot.active::after {
    display: none;
}

@keyframes typing {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

@keyframes bubbleAppear {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Responsive adjustments for AI Chat */
@media (max-width: 768px) {
    .ai-chat-section {
        margin-top: 11rem;
        min-height: auto;
    }

    .ai-chat-content {
        padding: 1rem 1rem 1.5rem;
        height: auto;
    }

    .chat-demo {
        margin: 1.5rem auto;
        gap: 1rem;
        height: auto;
    }

    .author-avatar img {
        width: 80px;
        height: 80px;
    }

    .chat-bubbles {
        width: 100%;
        padding: 0;
    }

    .chat-bubble {
        max-width: 85%;
        margin: 0.5rem 0;
    }

    .chat-bubble.user {
        margin-left: auto;
        margin-right: 0;
        text-align: right;
        float: right;
        clear: both;
    }

    .chat-bubble.author {
        margin-left: 0;
        margin-right: auto;
        text-align: left;
        float: left;
        clear: both;
    }

    .chat-progress {
        margin: 0.5rem 0 1rem;
    }

    .ai-chat-section h2 {
        font-size: 1.75rem;
        margin-bottom: 0.5rem;
    }

    .section-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .ai-chat-content {
        padding: 1rem;
        max-height: none;
    }

    .chat-demo {
        flex-direction: column;
        align-items: center;
        margin: 1rem auto;
        gap: 1rem;
    }

    .author-avatar {
        margin-bottom: 1rem;
        width: 100%;
    }

    .author-avatar img {
        width: 60px;
        height: 60px;
    }

    .author-name {
        text-align: center;
        margin-bottom: 0.25rem;
    }

    .typing-status {
        text-align: center;
        margin: 0 auto;
    }

    .chat-bubbles {
        width: 100%;
    }

    .chat-bubble {
        max-width: 90%;
    }
}

/* Mobile Menu */
@media (max-width: 1300px) {
    .header-nav {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .mobile-menu {
        display: block;
    }
}

/* Responsive header */
@media (max-width: 768px) {
    header {
        padding: 1rem;
    }

    .brand-name {
        font-size: 1.2rem;
    }
}

.theme-card.coming-soon {
    opacity: 0.7;
    cursor: default;
}

.theme-card.coming-soon:hover {
    transform: none;
    border-color: rgba(var(--main-color-rgb), 0.2);
}

.soon-tag {
    font-size: 0.7em;
    background: rgba(var(--main-color-rgb), 0.1);
    color: var(--main-color);
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
    font-weight: normal;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0EA5E9, #7C3AED, #EC4899);
    border: none;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
    z-index: 1001;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 6px 16px rgba(107, 70, 193, 0.4);
}

.mobile-menu-btn .close-icon {
    display: none;
}

.mobile-menu-btn.active .menu-icon {
    display: none;
}

.mobile-menu-btn.active .close-icon {
    display: inline-block;
}

/* Full Screen Menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.mobile-menu-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 2rem;
    padding: 2rem;
}

.mobile-menu-content a {
    font-size: 1.25rem;
    color: #2D3748;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.mobile-menu-content a:hover {
    color: #0EA5E9;
    background: rgba(107, 70, 193, 0.1);
}

.mobile-menu-content .login-btn {
    color: #2D3748;
    background: rgba(107, 70, 193, 0.1);
}

.mobile-menu-content .cta-btn {
    color: white;
    background: linear-gradient(135deg, #0EA5E9, #7C3AED, #EC4899);
    padding: 0.75rem 1.5rem;
}

.mobile-menu-content .cta-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-menu {
        display: block;
    }
}

/* Theme Cards */
.theme-card {
    position: relative;
    padding: 1.25rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
    margin-bottom: 0.25rem;
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    height: auto;
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 
        0 8px 32px 0 rgba(31, 38, 135, 0.07),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.theme-card:hover {
    transform: translateY(-5px);
    border-color: var(--main-color);
}

.theme-icon-container {
    position: relative;
    margin-bottom: 1rem;
}

.theme-icon {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    border-radius: 8px;
    object-fit: cover;
}

.theme-teacher {
    position: absolute;
    bottom: -15px;
    z-index: 2;
}

/* Books Authors */
.books-authors {
    display: flex;
    justify-content: center;
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.books-authors .author-portrait {
    width: 41px;
    height: 41px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    object-fit: cover;
    background: white;
    margin-left: -12px;
    transition: transform 0.3s ease;
}

.books-authors .author-portrait:first-child {
    margin-left: 0;
}

.books-authors .author-portrait:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.books-authors-text {
    font-size: 0.7rem;
    color: #2D3748;
    font-weight: 500;
    text-align: center;
    margin-bottom: 1.5rem;
    margin-top: 0.25rem;
}

.books-authors-text span {
    display: block;
    margin-bottom: 0.05rem;
}

.books-authors-text span + span {
    font-size: calc(0.7rem * 1.15);
    font-weight: 700;
}

@media (max-width: 768px) {
    .books-authors .author-portrait {
        width: 34px;
        height: 34px;
        margin-left: -10px;
    }
}

@media (max-width: 480px) {
    .books-authors .author-portrait {
        width: 40px;
        height: 40px;
        margin-left: -8px;
    }
}

/* Themes Grid */
.themes-grid a.theme-card {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: block;
}

.themes-grid a.theme-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.themes-grid a.theme-card:active {
    transform: translateY(-2px);
} 