/* --- ЦВЕТОВА ПАЛИТРА И ОСНОВНИ СТИЛОВЕ --- */
:root {
    --bg-color: #f4f6fa;       /* Светло сиво-синьо за фон */
    --card-bg: #ffffff;        /* Бяло за картите */
    --primary-color: #acace6;  /* Основен пастелен син цвят */
    --text-color: #1e293b;     /* Тъмен текст */
    --accent-hover: #9494d6;   /* По-тъмно синьо при посочване */
    --border-color: #cbd5e1;
    --purple-color: #9494d6;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
}

/* --- ГОРНА ЛЕНТА (ИМЕ И АКАУНТ) --- */
.top-bar {
    background-color: var(--card-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
    position: relative;
}

.site-title {
    font-size: 26px;
    font-weight: bold;
    color: var(--text-color);
    margin: 0 auto; /* Центрира заглавието в средата */
}

/* ДОБАВЕТЕ ТОЗИ НОВ БЛОК: */
.site-title span {
    color: var(--purple-color);
}

.account-btn {
    text-decoration: none;
    color: var(--text-color);
    font-weight: bold;
    border: 2px solid var(--text-color);
    padding: 8px 20px;
    border-radius: 4px;
    transition: all 0.3s;
    position: absolute;
    right: 40px;
}

.account-btn:hover {
    background-color: var(--text-color);
    color: white;
}

/* --- ВТОРИ РЕД: НАВИГАЦИЯ --- */
.main-nav {
    background-color: var(--card-bg);
    border-top: 1px solid #e2e8f0;
    border-bottom: 2px solid var(--primary-color);
    padding: 10px 0;
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center; /* Центрира линковете */
    gap: 30px;
}

.main-nav ul li a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 16px;
    transition: color 0.3s;
}

.main-nav ul li a:hover, .main-nav ul li a.active {
    color: var(--primary-color);
}

/* 1. Връщаме този блок в нормално състояние (без фон) */
.main-container, .container-single {
    max-width: 900px;
    margin: 0 auto; /* Махаме горния отстъп, защото wrapper-ът ще го поеме */
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* 2. ДОБАВЕТЕ ТОЗИ НОВ БЛОК НАЙ-ОТДОЛУ В CSS ФАЙЛА: */
.page-content-wrapper {
    background-image: url('snimki/background.png'); /* Вашата картинка */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed; /* Прави така, че фонът да стои неподвижен при скролване (изглежда много яко) */
    min-height: calc(100vh - 120px); /* Изчислява височината на екрана минус хедъра, за да стига фонът до най-долу */
    width: 100%;
}

/* --- БЛОК ДОБРЕ ДОШЛИ СЪС СНИМКА --- */
.welcome-section {
    display: flex;
    align-items: stretch;
    gap: 20px;
    margin-bottom: 10px;
}

.welcome-card {
    background-color: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    flex: 1; /* Заема колкото се може повече място */
}

.welcome-card h1 {
    margin-top: 0;
    font-size: 24px;
}

.welcome-image {
    background-color: var(--card-bg);
    border: 2px dashed var(--primary-color);
    border-radius: 12px;
    width: 180px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: var(--primary-color);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.welcome-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Този ред прави така, че снимката да се изреже и запълни кутийката красиво, без да се деформира */
}

/* --- КАРТИ ЗА ИНСТРУМЕНТИТЕ --- */
.instrument-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border-left: 6px solid var(--primary-color); /* Акцент отляво */
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.instrument-info {
    flex: 1;
}

.instrument-info h2 {
    margin-top: 0;
    font-size: 20px;
    color: var(--text-color);
}

.instrument-info p {
    margin: 5px 0 0 0;
    color: #64748b;
    font-size: 15px;
    line-height: 1.5;
}

/* --- БУТОНИ --- */
.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: bold;
    white-space: nowrap; /* Предпазва текста от счупване на два реда */
    transition: background 0.3s;
}

.btn:hover {
    background-color: var(--accent-hover);
}

/* Адаптивност за малки екрани */
@media (max-width: 600px) {
    .welcome-section {
        flex-direction: column;
    }
    .welcome-image {
        width: 100%;
        height: 120px;
    }
    .instrument-card {
        flex-direction: column;
        align-items: flex-start;
    }
    .btn {
        width: 100%;
        text-align: center;
    }
}

/* По-широк контейнер, за да е таблицата по-голяма и удобна */
.container-program {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Карта с плътен бял фон и лилава рамка */
.card-program {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 3px solid var(--purple-color); /* Дебела лилава рамка */
}

.program-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
    background-color: #ffffff; /* Задължителен бял фон на таблицата */
}

/* Граници на таблицата в лилав цвят */
.program-table th, .program-table td {
    border: 2px solid #d8b4fe; /* Светло лилави очертания на клетките */
    padding: 8px; /* Вътрешно разстояние */
}

/* Полетата за дните от седмицата (Най-горния ред) - По-светло лилаво */
.program-table th {
    background-color: #f3e8ff; 
    color: #5b21b6; /* Тъмно лилав цвят на текста за четимост */
    font-weight: 700;
    font-size: 16px;
    padding: 15px 10px;
}

/* Номерата на часовете (Лява колона) - Леко по-тъмно лилаво, но светло */
.hour-col {
    background-color: #e9d5ff; 
    color: #5b21b6;
    font-weight: bold;
    width: 70px;
    font-size: 15px;
}

/* Стилизиране на полетата за въвеждане на текст (за да изглеждат чисти в таблицата) */
.program-table td input {
    width: 100%;
    border: none;
    outline: none;
    padding: 10px;
    font-size: 15px;
    text-align: center;
    font-family: inherit;
    background-color: transparent;
}

/* Ефект, когато потребителят кликне да пише в дадено поле */
.program-table td input:focus {
    background-color: #faf5ff; /* Много деликатен лилав оттенък при писане */
}

/* Контроли и бутони (изчистен дизайн без червени елементи) */
.table-actions {
    margin-top: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.row-controls {
    display: flex;
    gap: 10px;
}

/* Цвят за бутона за запазване в тона на лилавото */
.btn-save {
    background-color: var(--purple-color) !important;
}
.btn-save:hover {
    background-color: #9333ea !important;
}

/* ==========================================================================
   7. СТИЛОВЕ ЗА СТРАНИЦА "КАЛЕНДАР" (Оптимизиран Дизайн)
   ========================================================================== */

.container-calendar-center {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px;
}

.card-calendar-main {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 3px solid var(--purple-color);
}

.calendar-month-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.calendar-month-bar h2 {
    border: none;
    padding: 0;
    margin: 0;
    color: #5b21b6;
    font-size: 24px;
}

.weekdays-bar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: bold;
    background-color: #f3e8ff; 
    color: #5b21b6;
    padding: 12px 0;
    border-radius: 6px;
    border: 2px solid #d8b4fe;
    margin-bottom: 10px;
}

.calendar-grid-main {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.day-cell {
    background-color: #ffffff;
    border: 2px solid #d8b4fe;
    border-radius: 8px;
    min-height: 100px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    transition: all 0.2s;
}

.day-cell:hover:not(.empty) {
    background-color: #faf5ff;
    border-color: var(--purple-color);
    cursor: pointer;
}

.day-cell.empty {
    background-color: transparent;
    border: none;
    cursor: default;
}

.day-number {
    font-weight: bold;
    color: #1e293b;
    font-size: 16px;
}

.event-label {
    background-color: rgba(91, 33, 182, 0.85);
    color: #ffffff;
    font-size: 11px;
    padding: 4px 6px;
    border-radius: 4px;
    width: 100%;
    margin-top: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─── СТИЛОВЕ ЗА ИЗСКАЧАЩОТО ПРОЗОРЧЕ (MODAL) ─── */
.calendar-modal {
    display: none; /* Скрито по подразбиране */
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.4); /* Полупрозрачен черен фон */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: #ffffff;
    padding: 25px;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    border: 3px solid var(--purple-color);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    position: relative;
}

.close-modal {
    position: absolute;
    top: 10px; right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #94a3b8;
}
.close-modal:hover {
    color: #1e293b;
}

.modal-content h3 {
    margin-top: 0;
    color: #5b21b6;
    margin-bottom: 15px;
}

#modalForm {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#modalForm input, #modalForm select {
    padding: 10px;
    border: 2px solid #d8b4fe;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

#modalForm input:focus, #modalForm select:focus {
    border-color: var(--purple-color);
}

.color-picker-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: bold;
    color: #5b21b6;
}

/* ==========================================================================
   6. СТИЛОВЕ ЗА СТРАНИЦА "ФОРУМ" (Главно меню)
   ========================================================================== */

/* Центриран контейнер в тон с програмата и календара */
.container-forum-center {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Основна карта с лилава рамка */
.card-forum-main {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 40px 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 3px solid var(--purple-color);
    text-align: center;
}

.card-forum-main h2 {
    color: #5b21b6;
    margin-bottom: 10px;
    font-size: 28px;
}

.forum-subtitle {
    color: #64748b;
    margin-bottom: 40px;
    font-size: 16px;
}

/* Списъкът с бутони */
.forum-navigation-channels {
    display: flex;
    flex-direction: column;
    gap: 25px;
    align-items: center;
}

/* Стилизиране на големите заоблени бутони от скицата */
.forum-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
    max-width: 650px;
    background-color: #ffffff;
    color: #1e293b;
    text-decoration: none;
    font-size: 18px;
    font-weight: bold;
    padding: 20px 30px;
    border: 3px solid var(--purple-color);
    border-radius: 30px; /* Силно заоблени краища точно като на макета */
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.1);
}

/* Ефект при посочване (Ховър) - Бутонът се запълва с нежно лилаво */
.forum-nav-btn:hover {
    background-color: #f3e8ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.2);
    color: #5b21b6;
}

.btn-icon {
    font-size: 22px;
}

/* ==========================================================================
   6.1 СТИЛОВЕ ЗА ПОДСТРАНИЦА "РЕСУРСИ И ФОРМУЛИ"
   ========================================================================== */

.container-resources {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

.card-resources-main {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 35px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 3px solid var(--purple-color);
}

.resources-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 15px;
}

.resources-header-bar h2 {
    color: #5b21b6;
    margin: 0;
    font-size: 26px;
}

.btn-back {
    text-decoration: none;
    color: var(--purple-color);
    font-weight: bold;
    font-size: 15px;
    transition: color 0.2s;
}
.btn-back:hover {
    color: #5b21b6;
}

.resources-subtitle {
    color: #64748b;
    margin-bottom: 35px;
    font-size: 15px;
}

/* Решетката за трите предмета на един ред */
.subjects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

/* Стил на трите кутии от макета */
.subject-card {
    background-color: #ffffff;
    border: 3px solid var(--purple-color);
    border-radius: 20px; /* Заоблянето от скицата */
    padding: 30px 20px;
    text-align: center;
    text-decoration: none;
    color: #1e293b;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.05);
}

.subject-card h3 {
    margin: 0;
    font-size: 18px;
}

/* Ефект при посочване на малките карти */
.subject-card:hover {
    background-color: #f3e8ff; /* Нежно лилаво запълване */
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(168, 85, 247, 0.15);
    color: #5b21b6;
}

.subject-icon {
    font-size: 30px;
}

/* Долният голям широк бутон */
.external-links-wrapper {
    width: 100%;
}

.wide-resources-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
    background-color: #ffffff;
    border: 3px solid var(--purple-color);
    border-radius: 25px; /* Заобляне */
    padding: 20px;
    text-decoration: none;
    color: #1e293b;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.05);
}

.wide-resources-btn h3 {
    margin: 0;
    font-size: 18px;
}

/* Ефект при посочване на широкия бутон */
.wide-resources-btn:hover {
    background-color: #f3e8ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.15);
    color: #5b21b6;
}

/* Адаптивност за телефони - кутиите застават една под друга */
@media (max-width: 768px) {
    .subjects-grid {
        grid-template-columns: 1fr;
    }
}

/* Допълнителни стилове за отварящите се панели с формули */
.resource-expanded-panel {
    display: none; /* Скрити по подразбиране, JavaScript ги показва */
    background-color: #faf5ff; /* Деликатен лилав фон */
    border: 2px dashed #d8b4fe;
    border-radius: 12px;
    padding: 25px;
    margin: 25px 0;
    text-align: left;
    animation: fadeIn 0.3s ease;
}

.resource-expanded-panel h3 {
    color: #5b21b6;
    margin-top: 0;
    margin-bottom: 15px;
}

.formula-box {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    color: #334155;
    line-height: 1.6;
}

.formula-box ul {
    padding-left: 20px;
    margin-top: 8px;
}

.formula-box li {
    margin-bottom: 6px;
}

/* Козметичен стил за бутона за сваляне на документи */
.btn-download {
    background-color: var(--purple-color);
    color: #ffffff;
    display: inline-block;
    padding: 10px 20px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.btn-download:hover {
    background-color: #7c3aed;
}

/* Решетка и дизайн на линковете за външни сайтове */
.sites-links-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.site-link-card {
    background-color: #ffffff;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    color: #1e293b;
    text-decoration: none;
    transition: all 0.2s;
}

.site-link-card:hover {
    border-color: var(--purple-color);
    background-color: #f5f3ff;
    color: #5b21b6;
}

/* Анимация за плавно появяване на панела */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   6.2 СТИЛОВЕ ЗА ПОДСТРАНИЦА "ПОМОЩ С ДОМАШНОТО"
   ========================================================================== */

.container-homework {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.homework-header {
    margin-bottom: 25px;
}

.homework-header h2 {
    color: #5b21b6;
    margin: 10px 0 5px 0;
}

.homework-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 30px;
    align-items: start;
}

@media (max-width: 900px) {
    .homework-layout {
        grid-template-columns: 1fr;
    }
}

.card-homework-main {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 3px solid var(--purple-color);
}

.card-homework-main h3 {
    margin-top: 0;
    color: #5b21b6;
    margin-bottom: 20px;
}

/* Форма въвеждане */
.form-group-hw {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 15px;
}

.form-group-hw label {
    font-weight: bold;
    color: #475569;
}

.form-group-hw input, .form-group-hw select, .form-group-hw textarea {
    padding: 10px;
    border: 2px solid #d8b4fe;
    border-radius: 6px;
    outline: none;
    font-family: inherit;
    font-size: 14px;
}

.form-group-hw input:focus, .form-group-hw select:focus, .form-group-hw textarea:focus {
    border-color: var(--purple-color);
}

.btn-hw-submit {
    background-color: var(--purple-color);
    color: white;
    width: 100%;
    padding: 12px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
}
.btn-hw-submit:hover {
    background-color: #7c3aed;
}

/* ФИЙД ПОТОК С ПОСТОВЕ */
.homework-feed {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card-homework-post {
    background-color: #ffffff;
    border-radius: 12px;
    border: 3px solid var(--purple-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    padding: 25px;
    position: relative;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px dashed #e2e8f0;
    padding-bottom: 12px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.post-badge {
    background-color: #f3e8ff;
    color: #5b21b6;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    border: 1px solid #d8b4fe;
}

.post-author {
    color: #334155;
    font-size: 14px;
}

.post-date {
    color: #94a3b8;
    font-size: 13px;
    margin-left: auto;
}

.btn-delete-hw {
    background-color: #fee2e2;
    border: 1px solid #fca5a5;
    color: #ef4444;
    font-size: 12px;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-delete-hw:hover {
    background-color: #ef4444;
    color: white;
}

.post-body p {
    font-size: 16px;
    color: #1e293b;
    line-height: 1.5;
    margin-bottom: 15px;
}

.post-img {
    max-width: 100%;
    max-height: 350px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    display: block;
    margin-bottom: 15px;
}

/* КОМЕНТАРИ */
.post-footer {
    background-color: #faf5ff;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.post-footer h4 {
    margin-top: 0;
    color: #5b21b6;
    margin-bottom: 10px;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.hw-comment-item {
    background-color: #ffffff;
    padding: 10px 15px;
    border-radius: 6px;
    border-left: 4px solid var(--purple-color);
    font-size: 14px;
}

.hw-comment-item p {
    margin: 4px 0 0 0;
    color: #334155;
}

.comment-date {
    font-size: 11px;
    color: #94a3b8;
    display: block;
    text-align: right;
}

/* Форма за нов коментар */
.add-comment-box {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.add-comment-box input[type="text"]:nth-child(1) {
    width: 150px;
}

.add-comment-box input[type="text"]:nth-child(2) {
    flex: 1;
}

.add-comment-box input {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}

.add-comment-box input:focus {
    border-color: var(--purple-color);
}

.btn-comment-submit {
    background-color: #5b21b6;
    color: white;
    padding: 8px 15px;
    font-size: 13px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
}

/* ==========================================================================
   6.3 СТИЛОВЕ ЗА ПОДСТРАНИЦА "ВЪПРОСИ И ДИСКУСИИ"
   ========================================================================== */

.container-discussions {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.discussions-header h2 {
    color: #5b21b6;
    margin: 10px 0 5px 0;
}

/* Лентата с бутони-чипове за филтриране */
.discussion-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.filter-chip {
    background-color: #ffffff;
    border: 2px solid #d8b4fe;
    color: #5b21b6;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}

.filter-chip:hover {
    background-color: #f3e8ff;
}

.filter-chip.active {
    background-color: var(--purple-color);
    color: white;
    border-color: var(--purple-color);
}

/* Структура от две колони */
.discussions-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 30px;
    align-items: start;
}

@media (max-width: 900px) {
    .discussions-layout {
        grid-template-columns: 1fr;
    }
}

.card-discussion-main {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 3px solid var(--purple-color);
}

.card-discussion-main h3 {
    margin-top: 0;
    color: #5b21b6;
    margin-bottom: 20px;
}

.form-group-disc {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 15px;
}

.form-group-disc label {
    font-weight: bold;
    color: #475569;
}

.form-group-disc input, .form-group-disc select, .form-group-disc textarea {
    padding: 10px;
    border: 2px solid #d8b4fe;
    border-radius: 6px;
    outline: none;
    font-family: inherit;
    font-size: 14px;
}

.form-group-disc input:focus, .form-group-disc select:focus, .form-group-disc textarea:focus {
    border-color: var(--purple-color);
}

.btn-disc-submit {
    background-color: var(--purple-color);
    color: white;
    width: 100%;
    padding: 12px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
}

/* Дизайн на картите с дискусии */
.discussions-feed {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card-discussion-post {
    background-color: #ffffff;
    border-radius: 12px;
    border: 3px solid var(--purple-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    padding: 25px;
}

.disc-post-header {
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px dashed #e2e8f0;
    padding-bottom: 12px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.disc-badge {
    background-color: #faf5ff;
    color: #7c3aed;
    border: 1px solid #d8b4fe;
    font-weight: bold;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 11px;
}

.disc-author { color: #334155; font-size: 14px; }
.disc-date { color: #94a3b8; font-size: 13px; margin-left: auto; }

.btn-delete-disc {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}

.disc-post-body h4 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #5b21b6;
}

.disc-post-body p {
    font-size: 15px;
    color: #334155;
    line-height: 1.6;
    margin: 0 0 20px 0;
}

/* Коментари в дискусиите */
.disc-post-footer {
    background-color: #fcfaff;
    border-radius: 8px;
    padding: 15px;
    border-top: 1px solid #f3e8ff;
}

.disc-post-footer h5 { margin-top: 0; color: #475569; margin-bottom: 12px; }

.replies-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 15px; }

.disc-reply-item {
    background-color: #ffffff;
    padding: 10px 15px;
    border-radius: 6px;
    border-left: 3px solid #c084fc;
    font-size: 14px;
}

.reply-author { font-weight: bold; color: #1e293b; }
.disc-reply-item p { margin: 4px 0; color: #475569; }
.reply-date { font-size: 11px; color: #94a3b8; display: block; text-align: right; }

.add-reply-box { display: flex; gap: 10px; }
.add-reply-box input {
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}
.add-reply-box input:focus { border-color: var(--purple-color); }

.btn-reply-submit {
    background-color: #7c3aed;
    color: white;
    padding: 10px 15px;
    font-size: 13px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
}

/* Контейнерът за линковете */
.social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

/* Стил за самите бутони */
.social-btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #5b21b6; /* Лилавият цвят на StudyFlow */
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: background 0.3s ease, transform 0.2s ease;
}

/* Ефект при посочване с мишката (Hover) */
.social-btn:hover {
    background-color: #7c3aed; /* По-светло лилаво */
    transform: translateY(-2px); /* Леко повдигане */
}

/* ==========================================
   МОБИЛНА ВЕРСИЯ (За екрани под 768px)
   ========================================== */
@media screen and (max-width: 768px) {
    
    /* 1. Горната лента (Header) */
    .top-bar {
        flex-direction: column; /* Името на сайта и Вход/Изход застават един под друг */
        gap: 10px;
        text-align: center;
        padding: 15px 10px;
    }

    /* 2. Менюто с линковете (Nav) */
    .main-nav ul {
        flex-direction: column; /* Менюто става вертикално, за да е лесно за цъкане */
        align-items: center;
        gap: 8px;
        padding: 10px 0;
    }

    .main-nav li {
        width: 100%;
        text-align: center;
    }

    .main-nav a {
        display: block;
        padding: 10px;
    }

    /* 3. Бутоните във Форума */
    .forum-navigation-channels {
        flex-direction: column; /* Големите бутони за категориите се подреждат един под друг */
        gap: 12px;
    }

    .forum-nav-btn {
        width: 100%; /* Разпъват се на целия екран на телефона */
        box-sizing: border-box;
    }

    /* 4. Новите бутони за социалните мрежи и имейла */
    .social-links {
        flex-direction: column; /* Стават един под друг, за да не се застъпват */
        align-items: center;
        gap: 10px;
        width: 100%;
    }

    .social-btn {
        width: 80%; /* Заемат 80% от ширината на телефона, за да са удобни за натискане с палец */
        text-align: center;
    }
}

/* ==========================================
   СТИЛ ЗА FOOTER (НАЙ-ДОЛУ НА САЙТА)
   ========================================== */
.site-footer {
    background-color: #1e1b4b; /* Много тъмно лилаво, почти черно - придава стил */
    color: #e2e8f0; /* Светло сив текст за лесно четене */
    text-align: center;
    padding: 30px 20px;
    margin-top: 50px; /* Отдалечава футъра от горното съдържание */
    border-top: 3px solid #7c3aed; /* Тънка лилава линия най-отгоре за акцент */
}

.footer-content p {
    margin: 5px 0;
    font-size: 14px;
    opacity: 0.9;
}

/* Нашите бутони вътре във футъра */
.site-footer .social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.site-footer .social-btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: #5b21b6;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    transition: background 0.3s ease, transform 0.2s ease;
}

.site-footer .social-btn:hover {
    background-color: #7c3aed;
    transform: translateY(-2px);
}

/* Адаптивност за мобилни телефони */
@media screen and (max-width: 768px) {
    .site-footer .social-links {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .site-footer .social-btn {
        width: 80%; /* На телефон бутоните стават големи и удобни */
    }
}

.grade-btn {
    background-color: #f3e8ff !important; /* Мек лилав фон */
    color: #5b21b6 !important; /* Тъмно лилав текст */
    border: 2px solid #c084fc !important;
    text-align: left;
    padding: 12px 20px;
    font-weight: bold;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.grade-btn:hover {
    background-color: #7c3aed !important; /* При посочване става изцяло лилав */
    color: white !important;
    transform: translateX(5px); /* Леко мръдване надясно за ефект */
}