/* --- CSS Variables --- */
:root {
    --bg-color: #1a202c;
    --sidebar-bg: #2d3748;
    --card-bg: #2d3748;
    --text-color: #e2e8f0;
    --primary-color: #4fd1c5; /* Teal */
    --primary-hover: #38b2ac;
    --border-color: #4a5568;
    --placeholder-text: #718096;
    --header-bg: #222b3c;
}

/* --- Basic Reset --- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    direction: ltr;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    position: relative;
    width: 100vw;
    min-height: calc(100vh - 40px);
    transition: transform 0.3s ease-in-out;
}

/* --- Sidebar --- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0; /* Changed from right to left */
    width: 280px;
    height: 100%;
    background-color: var(--sidebar-bg);
    padding: 1.5rem 1rem;
    transform: translateX(-100%); /* Changed from 100% to -100% */
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.app-container.sidebar-visible .sidebar {
    transform: translateX(0);
}

.sidebar h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    margin-top: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.sidebar-nav .nav-item {
    display: flex; align-items: center; padding: 0.8rem 1rem; color: var(--text-color);
    text-decoration: none; border-radius: 8px; margin-bottom: 0.5rem; transition: background-color 0.3s;
}
.sidebar-nav .nav-item:hover { background-color: rgba(79, 209, 197, 0.1); }
.sidebar-nav .nav-item.active { background-color: var(--primary-color); color: var(--bg-color); font-weight: bold; }
.sidebar-nav .nav-item .icon { margin-right: 10px; font-size: 1.2rem; } /* Changed from margin-left */

/* --- History List --- */
.history-section { flex-grow: 1; overflow-y: auto; }
.history-list .history-item {
    padding: 0.7rem; font-size: 0.9rem; cursor: pointer; border-radius: 6px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.history-list .history-item:hover { background-color: var(--card-bg); }

/* --- Overlay --- */
.overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s; z-index: 999;
}
.app-container.sidebar-visible .overlay { opacity: 1; visibility: visible; }

/* --- Main Content --- */
.main-content {
    flex: 1;
    padding: 1rem;
    width: 100%;
}

.main-header {
    display: flex; align-items: center; gap: 1rem;
    background-color: var(--header-bg); padding: 0.8rem 1rem; border-radius: 8px; margin-bottom: 1.5rem;
}
.menu-toggle-btn {
    background: none; border: none; color: var(--text-color); font-size: 1.5rem; cursor: pointer;
}
.main-header h1 { font-size: 1.5rem; color: var(--primary-color); }

.bot-interface { display: none; }
/* This rule is now in the JS, but we can keep a fallback */
#english-bot { display: block; }

.bot-description { font-size: 1.1rem; color: var(--placeholder-text); margin-bottom: 2rem; }

/* --- Input Form --- */
.input-form { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; }
.topic-input {
    width: 100%; padding: 0.75rem; background-color: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: 8px; color: var(--text-color); font-size: 1rem;
}
.file-input-label {
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.75rem; background-color: var(--card-bg); border: 1px dashed var(--border-color);
    border-radius: 8px; cursor: pointer; text-align: center;
}
.file-input-label:hover { border-color: var(--primary-color); }
.file-input-label i { color: var(--primary-color); }
.file-input { display: none; }
.input-form button {
    padding: 0.75rem 1.5rem; background-color: var(--primary-color); color: var(--bg-color);
    border: none; border-radius: 8px; cursor: pointer; font-size: 1rem; font-weight: bold;
}

/* --- Preview Area --- */
.preview-container { background-color: var(--card-bg); border-radius: 8px; padding: 1.5rem; min-height: 250px; }
.lesson-plan-preview {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.lesson-plan-preview .placeholder { display: flex; align-items: center; justify-content: center; min-height: 200px; color: var(--placeholder-text); }
.export-buttons { margin-top: 1.5rem; display: flex; gap: 1rem; justify-content: flex-end; }
.export-btn { padding: 0.6rem 1.2rem; background-color: transparent; border: 1px solid var(--primary-color); color: var(--primary-color); border-radius: 8px; cursor: pointer; }
.template-selector {
    background-color: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.6rem;
    font-family: inherit;
}

/* Plan cards style */
.plan-card {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
}
.plan-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.plan-card-content {
    max-height: 200px;
    overflow-y: auto;
    padding-left: 0.5rem; /* Space for scrollbar on LTR */
}

/* --- Footer --- */
footer { text-align: center; padding: 0.5rem; background-color: var(--sidebar-bg); color: var(--placeholder-text); font-size: 0.9rem; }

/* --- Desktop Styles --- */
@media (min-width: 768px) {
    .app-container {
        transform: none !important; 
    }
    .sidebar {
        position: static;
        transform: translateX(0);
        height: auto;
        min-height: calc(100vh - 40px);
    }
    .main-content {
        padding: 2rem;
    }
    .main-header h1 { font-size: 2.2rem; }
    .menu-toggle-btn, .overlay {
        display: none;
    }
    .input-form {
        flex-direction: row;
    }
}