/* profile.css */

/* Core variables */
:root {
    --success-color: #126e4dgrupo de trabajo
    --inactive-color: #6c757d;
}

/* Profile Container */
.profile-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 0px 20px 5px;
}

/* Unified Card Styling */
.subscription-card,
.placeholder-card {
    background: var(--color-1);
    border: 1px solid var(--color-11);
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 12px;
    width: 100%;
    height: 75px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
}

/* Common Section Styling */
.subscription-section,
.task-creation-section,
.task-response-section,
.stripe-section {
    display: flex;
    flex-direction: row;
    align-items: center;
    height: 100%;
    gap: 8px;
    justify-content: space-between;
}

/* Unified Header Styling */
.subscription-header,
.task-creation-header,
.task-response-header,
.stripe-header {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
}

.card-logo {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--color-2);
}

.card-actions {
    margin-top: 4px;
}

.card-actions .btn.btn-primary.btn-sm {
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 500;
    border-radius: 4px;
    background: var(--color-2);
    color: var(--color-1);
    border: none;
    text-transform: uppercase;
    transition: background-color 0.2s ease;
}

.card-actions .btn.btn-primary.btn-sm:hover {
    background: var(--color-2);
}

.task-creation-header .status-active,
.task-response-header .status-active {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-6);
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Unified Status Box Styling */
.subscription-details,
.task-creation-status,
.task-response-status,
.stripe-balance,
.stripe-not-connected {
    flex: 0 0 60px;
    height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
    text-align: center;
}

.subscription-details {
    background: #ffde00;
    color: #212121;
}

.task-creation-status.status-active,
.task-response-status.status-active {
    background: var(--color-6);
}

.task-creation-status.status-active:hover,
.task-response-status.status-active:hover {
    background: var(--color-7);
}

.task-creation-status.status-inactive,
.task-response-status.status-inactive,
.stripe-not-connected {
    background: #dc3545;
}

.stripe-balance .balance-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stripe-balance .balance-value {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stripe-balance .currency {
    font-size: 10px;
    color: rgba(0, 0, 0, 0.6);
}

.subscription-letters,
.task-creation-icon,
.task-response-icon,
.stripe-exclamation {
    font-size: 22px;
    font-weight: 900;
    color: #ffffff;
}

.subscription-letters {
    color: #212121;
}

.subscription-expiry {
    font-size: 9px;
    color: #212121;
}

/* Profile Card */
.profile-card {
    background: var(--color-1);
    border: 1px solid var(--color-11);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

.profile-header {
    display: flex;
    align-items: center;
}

.userpic-container {
    position: relative;
}

.profile-header .userpic {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 50%;
}

.user-info {
    margin-left: 16px;
    display: flex;
    flex-direction: column;
}

.user-contact-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.user-email,
.user-username,
.user-name,
.user-location {
    display: flex;
    align-items: center;
    margin-right: 16px;
    margin-bottom: 8px;
}

.user-email:last-child,
.user-username:last-child,
.user-name:last-child,
.user-location:last-child {
    margin-right: 0;
}

.email-text,
.username-text {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.email-verify-icon,
.username-edit-icon,
.edit-icon {
    font-size: 12px;
    color: var(--color-2);
    text-decoration: none;
    transition: color 0.2s ease;
    margin-left: 8px;
}

.email-verify-icon:hover,
.username-edit-icon:hover,
.edit-icon:hover {
    color: var(--color-2);
}

.email-verify-icon i,
.username-edit-icon i,
.edit-icon i {
    cursor: pointer;
}

.user-name {
    font-size: 28px;
    font-weight: 600;
    color: var(--color-2);
    margin-bottom: 8px;
}

.user-location {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.6);
}

.user-location i {
    color: rgba(0, 0, 0, 0.4);
    margin-right: 4px;
}

.energy-status {
    position: absolute;
    top: -6px;
    left: -6px;
    width: 40px;
    height: 40px;
    background: var(--highlight-color);
    color: #212121;
    border: 4px solid var(--color-1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    z-index: 1;
}

.online-status {
    position: absolute;
    bottom: 2px;
    right: 7px;
    width: 20px;
    height: 20px;
    border: 4px solid var(--color-1);
    border-radius: 50%;
}

.online-status.online {
    background: var(--color-6);
}

.online-status.offline {
    background: rgba(0, 0, 0, 0.4);
}

/* Profile Info Card */
.profile-info-card {
    background: var(--color-1);
    border: 1px solid var(--color-11);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.profession {
    font-size: 22px;
    font-weight: 500;
}

.hourly-rate {
    font-size: 18px;
    font-weight: 500;
}

.bio {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.8);
    line-height: 1.5;
}

/* Profile Rating */
.profile-rating {
    padding: 24px;
}

.rating-container {
    display: flex;
    align-items: center;
}

.rating-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--color-2);
    color: var(--color-1);
    border-radius: 8px;
    width: 100px;
    height: 100px;
    max-width: 100px;
    max-height: 100px;
}

.rating-value {
    font-size: 30px;
    font-weight: 900;
    color: #ffdf00;
    line-height: 1;
    margin-bottom: 8px;
}

.rating-label {
    font-size: 12px;
    color: #ccc;
}

.tasks-stats {
    display: flex;
    flex-direction: column;
}

.task-type {
    display: flex;
    align-items: center;
    line-height: 1.8;
}

.task-label {
    margin-right: 5px;
    color: #7f8c8d;
    font-size: 14px;
}

.task-count {
    font-weight: 600;
    color: #2c3e50;
}

/* Modal */
.modal-content {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--color-1);
    position: relative;
}

.modal-header,
.modal-footer {
    border-color: var(--border-color);
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.modal-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    justify-content: flex-end;
    position: sticky;
    bottom: 0;
    background: var(--color-1);
    z-index: 1;
}

.code-input {
    width: 50px;
    height: 50px;
    text-align: center;
    font-size: 18px;
    border: 1px solid var(--color-5);
    border-radius: 4px;
    transition: border-color 0.2s ease;
}

.code-input:focus {
    border-color: var(--color-2);
    outline: none;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 12px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    flex: 0 0 auto;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 10px;
}

.btn-primary {
    background: var(--color-2);
    color: var(--color-1);
}

.btn-primary:hover {
    background: var(--color-2);
}

.btn-secondary {
    background: transparent;
    color: var(--color-2);
    border-color: var(--color-2);
}

.btn-secondary:hover {
    background: var(--border-color);
}

/* Alerts */
.alert {
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 16px;
}

.alert-success,
.alert-danger {
    background: var(--color-1);
    border: 1px solid var(--color-11);
    color: var(--color-2);
}

/* Animation */
@keyframes fadeInOut {
    0% { opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { opacity: 0; }
}

#modal-success-message:not(.d-none) {
    animation: fadeInOut 2s forwards;
}

/* Equal Height Row */
.equal-height-row .col-md-3 > div {
    height: 75px;
    padding: 15px;
    box-sizing: border-box;
    margin-bottom: 12px;
}

/* Reviews Section */
.reviews-section {
    padding: 0;
}

.reviews-section .section-title {
    font-family: 'Arial', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #000000;
    margin-bottom: 15px;
    text-align: left;
}

.reviews-container {
    display: block;
    min-height: 100px;
}

#reviews-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.review-card-container {
    flex: 0 0 calc(33.333% - 10px);
    max-width: calc(33.333% - 10px);
    margin-bottom: 10px;
}

.review-card {
    background-color: #ffffff;
    border: 1px solid var(--color-11);
    border-radius: 8px;
    font-family: 'Arial', sans-serif;
    padding: 20px;
    height: 100%;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-11);
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.review-header .rating {
    font-size: 14px;
    color: #000000;
}

.review-header .rating i {
    font-size: 14px;
    color: #333333;
}

.review-header .task-info {
    text-align: right;
}

.review-header .user-role {
    font-size: 12px;
    color: #666666;
    margin: 0;
}

.review-header .task-link {
    font-size: 12px;
    color: #333333;
    margin: 0;
}

.review-header .task-link a {
    color: #333333;
    text-decoration: none;
}

.review-header .task-link a:hover {
    text-decoration: underline;
}

.review-text {
    font-size: 14px;
    color: #000000;
    line-height: 1.4;
    margin: 15px 0;
}

.reviewer-info {
    align-items: center;
    gap: 10px;
    border-top: 1px solid var(--color-11);
    padding-top: 8px;
    font-size: 11px;
}

.reviewer-info .reviewer-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    margin-left: 3px;
}

.reviewer-info .reviewer-name {
    font-size: 14px;
    font-weight: 600;
    color: #000000;
}

.reviewer-info .reviewer-profile {
    font-size: 12px;
    color: #333333;
    text-decoration: none;
}

.reviewer-info .reviewer-profile:hover {
    text-decoration: underline;
}

.reviews-pagination {
    margin-top: 15px;
}

.reviews-pagination .pagination {
    gap: 5px;
}

.reviews-pagination .page-item .page-link {
    background-color: #ffffff;
    border: 1px solid #e5e5e5;
    color: #000000;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 0;
}

.reviews-pagination .page-item.active .page-link {
    background-color: #000000;
    border-color: #000000;
    color: #ffffff;
}

.reviews-pagination .page-item.disabled .page-link {
    background-color: #f5f5f5;
    border-color: #e5e5e5;
    color: #666666;
}

.reviews-pagination .page-item .page-link:hover {
    background-color: #e5e5e5;
    border-color: #e5e5e5;
    color: #000000;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .profile-container {
    }

    .profile-card,
    .profile-info-card {
        padding: 10px;
    }

    .profile-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .userpic-container {
        margin-bottom: 16px;
    }

    .user-info {
        margin-left: 0;
    }

    .user-contact-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .user-email,
    .user-username,
    .user-name,
    .user-location {
        margin-right: 0;
        margin-bottom: 8px;
    }

    .email-text,
    .username-text {
        font-size: 12px;
        max-width: 100%;
    }

    .email-verify-icon,
    .username-edit-icon,
    .edit-icon {
        font-size: 10px;
        margin-left: 6px;
    }

    .user-name {
        font-size: 24px;
        justify-content: center;
    }

    .user-location {
        font-size: 12px;
    }

    #reviews-grid {
        flex-direction: column;
    }

    .review-card-container {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 15px;
    }

    .email-verify-icon i, .username-edit-icon i, .edit-icon i {
        font-size: 16px;
    }
}

/* Унифицированные стили для модальных окон */
.modal.slide-left {
    padding-right: 0 !important;
    z-index: 1050; /* Выше контента, ниже сайдбара (z-index: 100) */
}

.modal-fullheight {
    height: 100%;
    margin: 0;
}

.modal-fullheight .modal-content {
    min-height: 100vh;
    max-height: 100%;
    border-radius: 0;
    border: none;
    display: flex;
    flex-direction: column;
}

.modal-left .modal-dialog {
    width: 400px; /* Фиксированная ширина на мониторах */
    max-width: 80%; /* Ограничение максимальной ширины */
    margin: 0;
    position: fixed;
    left: 88px; /* Смещение на ширину закрытого сайдбара */
    height: 100%;
    transform: translate(-100%, 0); /* Начальная позиция для анимации */
    transition: transform 0.3s ease-out;
}

.modal-left.show .modal-dialog {
    transform: translate(0, 0); /* Показ при открытии */
}

/* Специфичные стили для #universalModal */
#universalModal.modal.slide-left.modal-fullheight.modal-left .modal-dialog {
    width: 400px;
    max-width: 80%;
    left: 88px;
    transform: translate(-100%, 0);
}

#universalModal.modal.slide-left.modal-fullheight.modal-left.show .modal-dialog {
    transform: translate(0, 0);
    width: calc(100% - 88px);
}

#universalModal .modal-content {
    max-width: 400px;
    background-color: #ffffff;
    border-right: 1px solid #ccc;
}

#universalModal .modal-body {
    overflow-y: auto; /* Прокрутка контента при необходимости */
    flex: 1; /* Занимает оставшееся пространство */
    padding-bottom: env(safe-area-inset-bottom); /* Учет нижнего отступа */
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .modal-left .modal-dialog {
        width: calc(100% - 88px); /* 100% ширины минус сайдбар */
        max-width: 100%;
        left: 88px; /* Учитываем сайдбар */
    }

    #universalModal.modal.slide-left.modal-fullheight.modal-left .modal-dialog {
        width: calc(100% - 88px);
        max-width: 100%;
    }

    #universalModal .modal-content {
        max-width: 100%;
    }

    .modal-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        padding: 10px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom)); /* Учет нижнего отступа */
    }

    .modal-footer .btn {
        width: 100%;
        padding: 6px;
        font-size: 11px;
        text-align: center;
    }

    .modal-body {
        padding: 10px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom)); /* Учет нижнего отступа */
    }

    #verify-documents-form .form-control,
    #update-user-data-form .form-control,
    #update-profession-rate-form .form-control {
        font-size: 12px;
        padding: 6px;
    }

    #verify-documents-form .form-label,
    #update-user-data-form .form-label,
    #update-profession-rate-form .form-label {
        font-size: 12px;
    }
}

/* Стили для .info-row */
.profile-info-card .info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}

/* Стили для дочерних элементов в десктопной версии */
.profile-info-card .info-row .profession {
    flex: 1;
    text-align: left;
}

.profile-info-card .info-row .hourly-rate {
    flex: 1;
    text-align: right; /* Прижатие к правому краю */
}

/* Адаптивные стили для мобильных устройств */
@media (max-width: 768px) {
    .profile-info-card .info-row {
        flex-direction: column; /* Вертикальное расположение */
        align-items: flex-start; /* Прижатие к левому краю */
        width: 100%;
    }

    .profile-info-card .info-row .profession,
    .profile-info-card .info-row .hourly-rate {
        width: 100%; /* Полная ширина для каждого элемента */
        text-align: left; /* Прижатие текста к левому краю */
        padding: 5px 0; /* Вертикальные отступы между элементами */
        font-size: 16px; /* Уменьшение шрифта для компактности */
    }
}

/* Стили для profession-container */
.profession-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.profession {
    font-size: 26px;
}

/* Стили для bio-container */
.bio-container {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    margin-top: 10px;
}

.bio {
    font-size: 0.9em;
    line-height: 1.5;
}

/* Общие стили для translate-icon и translated-text */
.translated-text {
    font-size: 0.9em;
    color: #6c757d;
    margin-top: 5px;
    width: 100%;
    display: none;
    text-align: left;
    line-height: 1.5;
}

/* Мобильные стили */
@media (max-width: 767px) {
    .profession-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .profession {
        font-size: 0.9em;
    }

    .bio-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .bio {
        font-size: 0.85em;
    }

    .translated-text {
        font-size: 0.85em;
        margin-top: 3px;
    }
}

/* Стили для элементов перевода */
.translate-icon {
    cursor: pointer;
}

.translated-text {
    font-size: 14px;
    color: #6c757d;
    width: 100%;
    display: none;
    text-align: left;
    line-height: 14.5px;
    background: #fcfcfc !important;
    padding: 5px 5px 5px 15px !important;
    margin-left: -5px;
    border: 1px dotted #ccc;
    border-radius: 10px;
}

/* Адаптивные стили для элементов перевода */
@media (max-width: 767px) {
    .translated-text {
        font-size: 12px;
        line-height: 12.5px;
        padding: 3px 3px 3px 10px;
    }

    .translate-icon {
        font-size: 0.9em;
    }
}

/* Стили для profession-wrapper и bio-wrapper */
.profession-wrapper {
    position: relative;
    flex: 1;
    width: 100%;
}

.profession-translate-wrapper {
    display: flex;
    align-items: center;
    margin-top: 5px;
}

.bio-wrapper {
    display: flex;
    flex-direction: column;
    position: relative;
    margin-top: 15px;
}

.bio-content {
    line-height: 1.5;
}

.bio-translate-wrapper {
    display: flex;
    align-items: center;
    margin-top: 5px;
}

/* Стили для отзывов (reviews) */
.review-text-wrapper {
    position: relative;
    margin-bottom: 10px;
}

.review-translate-wrapper {
    display: flex;
    align-items: center;
    margin-top: 5px;
}

/* Стили для секции верификации */
#verification-status {
    border-top: 1px solid var(--color-11);
    padding-top: 15px;
}

#verification-status h6 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--color-2);
}

#verification-status p {
    font-size: 14px;
    margin-bottom: 5px;
    color: var(--color-2);
}

#verification-status .img-fluid {
    border: 1px solid var(--color-11);
    border-radius: 4px;
    object-fit: cover;
}

#resolution-status {
    font-size: 14px;
    color: var(--inactive-color);
    background: #f8f9fa;
    padding: 8px;
    border-radius: 4px;
}

/* Адаптивность */
@media (max-width: 768px) {
    #verification-status h6 {
        font-size: 14px;
    }

    #verification-status p {
        font-size: 12px;
    }

    #verification-status .img-fluid {
        max-height: 120px;
    }

    #resolution-status {
        font-size: 12px;
        padding: 6px;
    }
}