﻿.main-page {
    margin-left: 240px;
    padding: 20px 40px;
    box-sizing: border-box;
}

/* ---------- ГЛАВЕН КОНТЕЙНЕР ---------- */
.profile-all-containers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    grid-template-areas:
        "info reviews"
        "sections reviews";
    gap: 24px;
    align-items: start;
    position: relative;
/*    margin: 0 40px;*/
    margin: 0;
    gap: 24px;
}

.edit-subject-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.edit-section {
    display: block;
    background-color: #F9F7F6;
    border-radius: 16px;
    padding: 12px 14px 4px 14px;
    gap: 6px;
    margin-bottom: 16px !important;
    box-shadow: inset 2px 0 5px rgba(0, 0, 0, 0.03), inset 0 2px 5px rgba(0, 0, 0, 0.03);
    border: none;
}


/* ---------- ГОРНА ЧАСТ: ПРОФИЛНА + ИМЕ ---------- */
.profile-main-info-container {
    grid-area: info;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 2;
    bottom: -44px;
    left: -12px;
}

.my-profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    position: absolute;
    bottom: -40px;
    left: 32px;
    z-index: 3;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    position: absolute;
    inset: 0;
    z-index: 3;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.avatar-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    bottom: -40px;
    left: 32px;
    top: -10px;
    margin-right: -118px;
    margin-bottom: -54px;
}

.online-dot {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 6px solid white;
    z-index: 4;
}

    .online-dot.online {
        background-color: #22c55e;
    }

    .online-dot.offline {
        background-color: #9ca3af;
    }


.profile-username-grade-container {
    margin-left: 170px;
}

.text-username {
    font-size: 32px;
    font-weight: 500;
    color: #453D44;
    margin-bottom: 4px;
}

.text-grade {
    font-size: 16px;
    font-weight: 400;
    color: rgba(69, 61, 68, 0.7);
}

.profile-text-help-with {
    font-size: 18px;
    margin-top: 6px;
}

/* ---------- ЛЕВИ КОНТЕЙНЕРИ: СТАТИСТИКА + ИНФОРМАЦИЯ ---------- */
.profile-sections {
    grid-area: sections;
    display: grid;
    grid-template-rows: auto auto;
    gap: 24px;
    margin-top: 32px;
}

/* ---------- СТАТИСТИКА ---------- */
.profile-container-stats {
    flex: 0 0 calc(50% - 0.5rem);
    background-color: #F9F7F6;
    border-radius: 16px;
    padding: 48px 32px 32px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 8px;
    box-sizing: border-box;
    box-shadow: inset 2px 0 5px rgba(0, 0, 0, 0.03), inset 0 2px 5px rgba(0, 0, 0, 0.03);
    position: relative;
    z-index: 1;
}

.stat-all {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 80px;
}

.stat-value {
    font-size: 26px;
    font-weight: 500;
    color: #453D44;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 16px;
    font-weight: 400;
    color: rgba(69, 61, 68, 0.7);
}

/* ---------- ЛИЧНА ИНФОРМАЦИЯ ---------- */
.profile-container-persinfo {
    background-color: #F9F7F6;
    border-radius: 16px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-sizing: border-box;
        box-shadow: inset 2px 0 5px rgba(0, 0, 0, 0.03), inset 0 2px 5px rgba(0, 0, 0, 0.03);
}

/* ---------- ОТЗИВИ (ОТДЯСНО) ---------- */
.profile-reviews-container {
    grid-area: reviews;
    background-color: #F9F7F6;
    border-radius: 16px;
    padding: 32px;
    min-height: 400px;
        box-shadow: inset 2px 0 5px rgba(0, 0, 0, 0.03), inset 0 2px 5px rgba(0, 0, 0, 0.03);
    margin-top: 118px;
}

/* ---------- БЕЙДЖИ ---------- */
.badge-match {
    padding: 3px 8px;
    border-radius: 8px;
    background-color: #B8AEB6;
    color: #FFFDFB;
    font-weight: 400;
}

/* ---------- БУТОНИ ---------- */
.btn-profile-secondary,
.btn-profile-secondary-warn {
    width: 180px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 470;
    font-size: 18px;
    margin-top: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.btn-profile-secondary {
    background-color: #F0EDE9;
    color: #453D44;
}

.btn-profile-secondary-warn {
    background-color: #FFFDFB;
    color: darkred;
}

/* ---------- ОТЗЫВИ: СПИСЪК ---------- */

.profile-reviews-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ---------- ЕДИН ОТЗИВ ---------- */

.review-card {
    display: flex;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    background-color: #FFFDFB;
    box-shadow: 2px 0 4px rgba(0,0,0,0.03), 0 2px 4px rgba(0,0,0,0.03);
    transition: background-color 0.2s ease;
}

    .review-card:hover {
        background-color: #F6F3F1;
    }

/* ---------- АВАТАР ---------- */

.review-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* ---------- СЪДЪРЖАНИЕ ---------- */

.review-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

/* ---------- ГОРЕН РЕД ---------- */

.review-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.review-name {
    font-size: 15px;
    font-weight: 500;
    color: #453D44;
}

/* ---------- ПРЕДМЕТ ---------- */

.review-subject {
    font-size: 13px;
    padding: 3px 8px;
    border-radius: 8px;
    background-color: #E6E1E4;
    color: #453D44;
    white-space: nowrap;
}

/* ---------- ЗВЕЗДИ ---------- */

.review-stars {
    font-size: 13px;
    letter-spacing: 1px;
    color: #B8AEB6;
}

/* ---------- КОМЕНТАР ---------- */

.review-comment {
    font-size: 14px;
    line-height: 1.45;
    color: rgba(69, 61, 68, 0.85);
    margin-top: 2px;
}

/* ---------- ПРАЗНО СЪСТОЯНИЕ ---------- */

.no-reviews-text {
    font-size: 15px;
    color: rgba(69, 61, 68, 0.7);
    font-style: italic;
    line-height: 1.5;
}

/* ---------- СЕКЦИЯ ОТЗЫВОВ ---------- */

.profile-reviews-section {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 24px;
}

/* ---------- ЗАГОЛОВОК ---------- */

.profile-reviews-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

    /* Используем ТВОИ классы, без переопределения дизайна */

    .profile-reviews-header .profile-maintext {
        margin: 0;
    }

    .profile-reviews-header .profile-sectext {
        margin: 0;
        opacity: 0.75;
    }


/* ---------- ЗАГОЛОВОК СЕКЦИИ ОТЗЫВОВ ---------- */

.profile-maintext {
    font-size: 22px;
    font-weight: 450;
    color: #453D44;
    margin: 0;
    line-height: 1.2;
}

.profile-maintext-avatar {
    font-size: 22px;
    font-weight: 450;
    color: #453D44;
    margin: 0;
    margin-top: 8px;
    margin-bottom: -6px;
    line-height: 1.2;
}

.profile-sectext {
    font-size: 16px;
    font-weight: 400;
    color: rgba(69, 61, 68, 0.75);
    margin: -12px 0 14px 0;
    line-height: 1.4;
}

.review-subject {
    font-size: 13px;
    padding: 3px 7px;
    border-radius: 7px;
    background-color: rgba(184, 174, 182, 0.35);
    color: #453D44;
    font-weight: 400;
}


/* ---------- EDIT MODE ---------- */

.edit-mode {
    margin-top: 24px;
}

.edit-input-title {
    font-size: 28px;
    font-weight: 500;
    border: none;
    background: transparent;
    color: #453D44;
}

.edit-input-subtitle {
    font-size: 16px;
    border: none;
    background: transparent;
    color: rgba(69, 61, 68, 0.7);
}

.edit-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.edit-section-subjects {
    display: block;
    background-color: #F9F7F6;
    border-radius: 16px;
    padding: 12px 14px 4px 14px;
    gap: 6px;
    margin-bottom: 16px !important;
    border: none;
}

.checkbox-group3 {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-left: 8px;
}

.edit-input1 {
    width: 100%;
    height: 41px;
    border-radius: 12px;
    border: none;
    background-color: #FFFDFB;
    color: #000000;
    font-size: 1rem;
    padding-left: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 12px;
    margin-top: -8px;
}

    .edit-input1:focus {
        outline: none;
    }

.edit-avatar-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.hidden-file-input {
    display: none;
}

.avatar-upload-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 16px;
    border-radius: 12px;
    background-color: #FFFDFB;
    color: #453D44;
    font-size: 17px;
    font-weight: 450;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.btn-danger-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 16px;
    background-color: #F0DADA;
    color: #6A3A3A;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 450;
    font-size: 17px;
    margin-top: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.edit-subjects-container {
    grid-area: reviews;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.edit-buttons-container {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    justify-content: flex-start;
}

.edit-buttons-container button {
    flex: 1;
}

.btn-secondary-edit {
    width: 200px;
    height: 40px;
    background-color: #F9F7F6;
    color: #453D44;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 470;
    font-size: 18px;
    margin-top: -8px;
    box-shadow: inset 2px 0 5px rgba(0, 0, 0, 0.03), inset 0 2px 5px rgba(0, 0, 0, 0.03);
}

.btn-primary-home1 {
    width: 292px;
    height: 40px;
    background-color: #70646E;
    color: #FFFDFB;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 470;
    font-size: 16px;
    margin-top: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.btn-secondary-home1 {
    width: 292px;
    height: 40px;
    background-color: #FFF;
    color: #70646E; /*#453D44;*/
    border-radius: 10px;
    border: 2px solid #70646E;
    cursor: pointer;
    font-weight: 470;
    font-size: 18px;
    margin-top: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}



/* =========================================================
   ТАБЛЕТИ (≤ 1200px)
   ========================================================= */
@media (max-width: 1200px) {

    .main-page {
        margin-left: 0;
        padding: 20px;
    }

    .profile-all-containers {
        grid-template-columns: 1fr;
        grid-template-areas:
            "info"
            "sections"
            "reviews";
    }

    .profile-main-info-container {
        position: static;
        margin-bottom: 60px;
    }

    .my-profile-avatar {
        position: static;
        margin-right: 20px;
    }

    .profile-username-grade-container {
        margin-left: 0;
    }

    .profile-reviews-container {
        margin-top: 0;
    }
}

/* =========================================================
   МАЛКИ ТАБЛЕТИ (≤ 900px)
   ========================================================= */
@media (max-width: 900px) {

    .profile-container-stats {
        padding: 24px;
        justify-content: space-between;
    }

    .stat-all {
        flex: 1 1 40%;
        max-width: none;
    }

    .text-username {
        font-size: 26px;
    }

    .profile-maintext {
        font-size: 20px;
    }
}

/* =========================================================
   ТЕЛЕФОНИ (≤ 640px)
   ========================================================= */
@media (max-width: 640px) {

    .main-content {
        margin-left: 0;
    }

    .main-page {
        margin-left: 0;
        padding: 16px;
    }

    .profile-main-info-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
    }

    .my-profile-avatar {
        width: 96px;
        height: 96px;
        margin: 0;
    }

    .text-username {
        font-size: 22px;
    }

    .text-grade {
        font-size: 14px;
    }

    .profile-sections {
        gap: 16px;
        margin-top: 0;
    }

    .profile-container-persinfo {
        padding: 20px;
    }

    .profile-container-stats {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .stat-all {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        max-width: none;
    }

    .stat-value {
        font-size: 20px;
    }

    .stat-label {
        font-size: 14px;
    }

    .review-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .review-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* =========================================================
   МН МАЛКИ ЕКРАНИ (≤ 400px)
   ========================================================= */
@media (max-width: 400px) {

    .main-content {
        margin-left: 0;
    }

    .main-page {
        margin-left: 0;
        padding: 16px;
    }

    .profile-container-persinfo {
        padding: 16px;
    }

    .profile-reviews-container {
        padding: 16px;
    }

    .profile-maintext {
        font-size: 18px;
    }

    .profile-sectext {
        font-size: 14px;
    }

    .edit-avatar-container {
        flex-direction: column;
        align-items: stretch;
    }

    .edit-buttons-container {
        flex-direction: column;
    }

    .btn-primary-home1,
    .btn-secondary-home1 {
        width: 100%;
    }
}
