/* task_detail.css */

/* ========================================================================= */
/* 0. Font Import                                                           */
/* ========================================================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ========================================================================= */
/* 1. Main Page Container                                                   */
/* ========================================================================= */
.task-detail-container {
    padding: 16px 16px 32px 16px !important;
    margin: 0 auto;
    font-family: 'Inter', sans-serif;
}

.task-detail-container .row.mt-4 {
    margin-right: -8px;
    margin-left: -8px;
}

.task-detail-container .row.mt-4 > [class*='col-'] {
    padding-right: 8px;
    padding-left: 8px;
}

.task-detail-container h1 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--color-2);
    text-align: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-5);
}

/* ========================================================================= */
/* 2. User Role Cards (Author and Executor)                                 */
/* ========================================================================= */
.user-role-card {
    background: var(--color-1);
    border: 1px solid var(--color-5);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.user-role-card .card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.user-role-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-2);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-5);
}

.user-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.user-avatar, .placeholder-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.user-avatar {
    object-fit: cover;
}

.placeholder-avatar {
    background-color: var(--color-5);
}

.user-name {
    color: var(--color-2);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color var(--tran-03);
}

.user-name:hover {
    color: var(--color-3);
}

.no-user {
    color: var(--color-2);
    font-size: 0.875rem;
    margin: 0;
    opacity: 0.7;
}

/* ========================================================================= */
/* 3. Reviews and Ratings Section                                           */
/* ========================================================================= */
.review-section {
    margin-top: 1rem;
    padding: 0;
    background: var(--color-1);
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.review-section h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-2);
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.review-ratings {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.overall-rating {
    text-align: center;
    padding: 24px;
    background: var(--color-3);
    border-radius: 12px;
}

.rating-number {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--color-2);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.rating-stars {
    font-size: 1rem;
    color: var(--color-2);
    letter-spacing: 0.1em;
}

.detailed-ratings {
    flex: 1;
    padding-left: 1rem;
}

.detailed-ratings p {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--color-2);
    margin: 0.25rem 0;
    border-bottom: 1px solid var(--color-5);
    padding-bottom: 0.25rem;
}

.detailed-ratings p:last-child {
    border-bottom: none;
}

.detailed-ratings p span:first-child { font-weight: 500; }
.detailed-ratings p span:last-child { font-weight: 600; }

.review-text {
    font-size: 0.875rem;
    color: var(--color-2);
    font-style: italic;
    line-height: 1.6;
    margin: 0;
}

/* ========================================================================= */
/* 4. Buttons (Primary, Danger, Secondary)                                  */
/* ========================================================================= */
.btn-primary, .btn-danger, .btn-outline-danger, .btn-secondary, .btn-outline-secondary {
    border: none;
    font-weight: 500;
    border-radius: 6px;
    padding: 0.625rem 1.25rem;
    transition: background-color var(--tran-03), transform 0.2s ease;
    min-height: 44px;
    font-size: 0.875rem;
}

.btn-primary {
    background-color: var(--color-3);
    color: var(--color-2);
}

.btn-primary:hover {
    background-color: var(--color-8);
    color: var(--color-2);
}

.btn-danger, .btn-outline-danger {
    background-color: var(--color-9);
    color: var(--color-1);
}

.btn-danger:hover, .btn-outline-danger:hover {
    background-color: var(--color-10);
    color: var(--color-1);
}

.btn-secondary, .btn-outline-secondary {
    background-color: var(--color-4);
    color: var(--color-2);
}

.btn-secondary:hover, .btn-outline-secondary:hover {
    background-color: var(--color-5);
    color: var(--color-2);
}

/* ========================================================================= */
/* 5. Task Price Card                                                       */
/* ========================================================================= */
.task-price-card {
    background-color: var(--color-3);
    color: var(--color-2);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
    transition: transform var(--tran-03);
    position: relative;
}

.task-status-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: var(--color-1);
    color: var(--color-2);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    border: 1px solid var(--color-5);
}

.task-price-big {
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.task-price-currency {
    font-size: 1rem;
    opacity: 0.8;
    text-transform: uppercase;
}

/* ========================================================================= */
/* 6. Task Details Card                                                     */
/* ========================================================================= */
.task-detail-card {
    background: var(--color-1);
    border: 1px solid var(--color-5);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.task-detail-card .card-body {
    padding: 1.25rem;
}

.task-detail-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-2);
}

.task-detail-card p {
    margin-bottom: 0.5rem;
    color: var(--color-2);
    font-size: 0.875rem;
}

.task-detail-card strong {
    color: var(--color-2);
}

/* ========================================================================= */
/* 7. Map (Leaflet)                                                         */
/* ========================================================================= */
#task-map {
    width: 100%;
    height: 300px;
    z-index: 1;
    position: relative;
    background-color: var(--color-4);
    border-radius: 6px;
}

#task-map .alert {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 12px;
    border-radius: 6px;
    background-color: var(--color-1);
    border: 1px solid var(--color-5);
    color: var(--color-2);
    width: 90%;
    text-align: center;
    z-index: 1000;
    font-size: 0.875rem;
}

.leaflet-container {
    box-shadow: none !important;
}

.leaflet-routing-container,
.leaflet-routing-container-hide,
.leaflet-bar.leaflet-routing-container-hide,
.leaflet-routing-alt,
.leaflet-routing-geocoders,
.leaflet-routing-error,
.leaflet-routing-icon,
.leaflet-routing-add-waypoint,
[class*="leaflet-routing"] {
    display: none !important;
}

/* ========================================================================= */
/* 8. Task Responses List                                                   */
/* ========================================================================= */
.task-responded-users {
    padding: 0 16px;
}

.response-list {
    padding: 0;
    margin: 0;
}

.response-item {
    background: var(--color-1);
    position: relative;
    padding: 12px 0;
    margin-bottom: 8px;
}

.response-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: repeating-linear-gradient(to right, var(--color-5) 0px, var(--color-5) 2px, transparent 2px, transparent 4px);
    -webkit-mask-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 20%, rgba(0, 0, 0, 1) 80%, rgba(0, 0, 0, 0));
    mask-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 20%, rgba(0, 0, 0, 1) 80%, rgba(0, 0, 0, 0));
}

.response-content-wrapper {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.response-user-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    text-align: center;
}

.response-user-pic img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid var(--color-5);
}

.response-user-name {
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 4px;
}

.response-user-name a {
    color: var(--color-2);
    text-decoration: none;
    transition: color var(--tran-03);
}

.response-user-name a:hover {
    color: var(--color-3);
}

.response-content {
    flex: 1;
    min-width: 160px;
}

.response-price {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-9);
    margin-bottom: 4px;
}

.response-text {
    font-size: 0.875rem;
    color: var(--color-2);
    line-height: 1.5;
}

.response-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.toggle-chat-btn, .response-details-btn, .choose-executor-btn {
    font-size: 0.75rem;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all var(--tran-03);
    min-height: 36px;
}

.toggle-chat-btn {
    border: 1px solid var(--color-9);
    color: var(--color-4);
}

.toggle-chat-btn:hover {
    background-color: var(--color-10);
    color: var(--color-4);
}

.response-details-btn {
    border: 1px solid var(--color-2);
    color: var(--color-2);
}

.response-details-btn:hover {
    background-color: var(--color-2);
    color: var(--color-1);
}

.choose-executor-btn {
    background-color: var(--color-6);
    color: var(--color-1);
}

.choose-executor-btn:hover {
    background-color: var(--color-7);
}

/* ========================================================================= */
/* 9. Response Chat                                                         */
/* ========================================================================= */
.response-chat-container {
    display: flex;
    flex-direction: column;
    height: 400px;
    border: 1px solid var(--color-5);
    border-radius: 8px;
    margin-top: 8px;
    overflow: hidden;
    position: relative;
    background-color: var(--color-1);
}

.chat-messages {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    background-color: var(--color-4);
    height: calc(100% - 56px);
}

.chat-input {
    display: flex;
    align-items: center;
    padding: 8px;
    background-color: var(--color-1);
    border-top: 1px solid var(--color-5);
    height: 56px;
    gap: 8px;
}

.chat-input input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--color-5);
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color var(--tran-03), box-shadow var(--tran-03);
    min-width: 0;
}

.chat-input input:focus {
    outline: none;
    border-color: var(--color-3);
    box-shadow: 0 0 0 2px rgba(255, 223, 0, 0.2);
}

.chat-input button {
    background-color: var(--color-3);
    border: none;
    color: var(--color-2);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color var(--tran-03), transform 0.2s ease;
    min-width: 80px;
    white-space: nowrap;
}

.chat-input button:hover { background-color: var(--color-8); }
.chat-input button:active { transform: translateY(0); }
.chat-input button:disabled { background-color: var(--color-5); cursor: not-allowed; }

.response-chat-container .message {
    max-width: 80%;
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 10px;
    position: relative;
}

.response-chat-container .message.sent {
    background-color: var(--color-3);
    color: var(--color-2);
    margin-left: auto;
    text-align: right;
}

.response-chat-container .message.received {
    background-color: var(--color-4);
    color: var(--color-2);
    margin-right: auto;
    text-align: left;
}

.response-chat-container .message-content {
    font-size: 0.875rem;
    line-height: 1.5;
}

.response-chat-container .message-time {
    font-size: 0.75rem;
    text-align: right;
    margin-top: 2px;
    opacity: 0.7;
}

.response-chat-container .new-message-indicator {
    position: absolute;
    bottom: 64px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--color-3);
    color: var(--color-2);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    cursor: pointer;
    z-index: 10;
}

/* ========================================================================= */
/* 10. Modal Windows                                                        */
/* ========================================================================= */
.modal-content {
    background-color: var(--color-1);
    border: 1px solid var(--color-5);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.modal-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--color-5);
    background-color: var(--color-1);
    color: var(--color-2);
    flex-shrink: 0;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-2);
}

.modal-body {
    padding: 1.25rem;
    background-color: var(--color-1);
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.modal-footer {
    border-top: 1px solid var(--color-5);
    padding: 0.75rem;
    background-color: var(--color-1);
    flex-shrink: 0;
}

/* Улучшенные стили для кнопки закрытия модальных окон */
.modal-header .btn-close {
    position: relative;
    padding: 12px 16px !important;
    margin: -12px -16px 0 0 !important;
    background: transparent;
    border: none;
    border-radius: 8px;
    opacity: 0.6;
    transition: all var(--tran-03);
    font-size: 1.2rem;
    min-width: 28px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1070 !important;
    cursor: pointer;
    outline: none;
    align-self: flex-end;
}

.modal-header .btn-close:hover {
}

.modal-header .btn-close:focus {
    outline: 2px solid var(--color-3);
    outline-offset: 2px;
    opacity: 1;
}

.modal-header .btn-close:active {
    transform: scale(0.95);
    background-color: var(--color-4);
}

.modal-header .btn-close::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border-radius: 12px;
    background: transparent;
    pointer-events: auto;
}

.modal-header .btn-close::after {
    content: '×';
    font-size: 1.5rem;
    line-height: 1;
    font-weight: bold;
    color: var(--color-2);
    opacity: inherit;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-2);
    margin-bottom: 0.5rem;
}

.form-control, .form-select {
    border: 1px solid var(--color-5);
    border-radius: 6px;
    padding: 0.625rem;
    font-size: 0.875rem;
    color: var(--color-2);
    background-color: var(--color-1);
    transition: border-color var(--tran-03), box-shadow var(--tran-03);
}

.form-control:focus, .form-select:focus {
    border-color: var(--color-3);
    box-shadow: 0 0 0 2px rgba(255, 223, 0, 0.2);
    outline: none;
}

.rating-group {
    display: flex;
    flex-direction: row-reverse;
    gap: 4px;
    justify-content: flex-start;
}

.rating-group input { display: none; }

.rating-group .star {
    font-size: 1.25rem;
    color: var(--color-5);
    cursor: pointer;
    transition: color var(--tran-03);
}

.rating-group input:checked ~ .star,
.rating-group .star:hover,
.rating-group .star:hover ~ .star {
    color: var(--color-3);
}

.modal.slide-left {
    padding-right: 0 !important;
    z-index: 1050;
}

.modal-fullheight {
    height: 100vh !important;
    margin: 0 !important;
    display: flex !important;
    align-items: stretch !important;
}

.modal-fullheight .modal-content {
    height: 100vh !important;
    border-radius: 0;
    border: none;
    max-height: 100vh !important;
}

.modal-left .modal-dialog {
    margin: 0;
    position: fixed;
    left: 88px !important;
    top: 0;
    height: 100vh !important;
    max-height: 100vh !important;
    width: 400px;
    max-width: calc(100% - 88px);
    transform: translate(-100%, 0);
    transition: transform var(--tran-03);
}

.modal-left.show .modal-dialog {
    transform: translate(0, 0);
}

/* ========================================================================= */
/* 11. Task Name and Translation                                            */
/* ========================================================================= */
.task-name-wrapper {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
}

.icon-container {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 6px;
    padding: 12px;
}

.icon-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.text-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-grow: 1;
    gap: 4px;
}

.category-name {
    font-size: 0.75rem;
    color: var(--color-2);
}

.task-name-wrapper-inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.task-name-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-grow: 1;
}

.task-name {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-2);
}

.translate-icon {
    cursor: pointer;
    color: var(--color-2);
    font-size: 1rem;
}

.translated-text {
    font-size: 0.875rem;
    color: var(--color-2);
    width: 100%;
    display: none;
    text-align: left;
    line-height: 1.5;
    background: var(--color-4) !important;
    padding: 4px 4px 4px 12px !important;
    margin-left: -4px;
    border: 1px dotted var(--color-5);
    border-radius: 6px;
}

/* ========================================================================= */
/* 12. User Rating Circle                                                   */
/* ========================================================================= */
.user-rating-circle {
    position: absolute;
    top: -6px;
    right: 24px;
    background-color: var(--color-3);
    color: var(--color-2);
    font-size: 10px;
    font-weight: 600;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--color-1);
    z-index: 10;
}

.task-responded-users .responded-user-avatar, .response-user-pic {
    position: relative;
}

/* ========================================================================= */
/* 13. Gallery (Swiper)                                                     */
/* ========================================================================= */
.gallery-container {
    margin-bottom: 1rem;
}

.gallery.swiper {
    width: 100%;
    height: 200px;
}

.swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.swiper-button-next, .swiper-button-prev {
    color: var(--color-2);
    background-color: var(--color-1);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--tran-03);
}

.swiper-button-next:hover, .swiper-button-prev:hover {
    background-color: var(--color-3);
}

.lightbox {
    background-color: rgba(0, 0, 0, 0.8);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    width: 90%;
    max-width: 800px;
    height: 80%;
}

.lightbox-swiper {
    width: 100%;
    height: 100%;
}

.lightbox-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    color: var(--color-1);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1001;
}

/* ========================================================================= */
/* 14. Media Queries for Responsive Design                                  */
/* ========================================================================= */
@media (max-width: 992px) {
    .task-detail-container { padding: 12px 12px 24px 12px !important; }
    .task-price-card { padding: 1rem; }
    .task-price-big { font-size: 2.5rem; }
    .task-price-currency { font-size: 0.875rem; }
    .user-role-card .card-body, .task-detail-card .card-body { padding: 1rem; }
    .review-ratings { flex-direction: column; align-items: flex-start; }
    .overall-rating { margin-bottom: 0.75rem; padding: 16px; }
    .rating-number { font-size: 2rem; }
    .detailed-ratings { padding-left: 0; width: 100%; }
    .response-content-wrapper { flex-direction: column; gap: 8px; }
    .response-user-info, .response-content { min-width: 100%; }
    .response-actions { justify-content: flex-start; }
    .gallery.swiper { height: 180px; }
}

@media (max-width: 768px) {
    .container { padding: 12px; }
    .task-detail-container { padding: 12px 12px 24px 12px !important; }
    .task-detail-container .row.mt-4 { margin-right: -6px; margin-left: -6px; }
    .task-detail-container .row.mt-4 > [class*='col-'] {
        padding-right: 6px;
        padding-left: 6px;
        padding-bottom: 12px;
    }
    .task-detail-container h1 { font-size: 1.75rem; }
    .task-price-card, .user-role-card, .task-detail-card { padding: 0.75rem; }
    .task-price-big { font-size: 2rem; padding: 0.75rem; }
    .task-price-currency { font-size: 0.875rem; }
    .task-status-badge { font-size: 0.625rem; padding: 0.2rem 0.4rem; }
    .user-role-card .card-body, .task-detail-card .card-body { padding: 0.75rem; }
    .user-role-card h3, .task-detail-card h3 { font-size: 1rem; }
    .user-avatar, .placeholder-avatar { width: 28px; height: 28px; }
    .user-name, .review-text, .response-user-name, .response-price, .response-text { font-size: 0.75rem; }
    .review-section h4 { font-size: 0.75rem; }
    .rating-stars { font-size: 0.875rem; }
    .detailed-ratings p { font-size: 0.625rem; }
    .btn-primary, .btn-danger, .btn-secondary { padding: 0.5rem 1rem; font-size: 0.75rem; min-height: 40px; }
    .task-detail-card p { font-size: 0.75rem; }
    #task-map { height: 250px; }
    #task-map .alert { font-size: 0.75rem; padding: 10px; width: 95%; }
    .response-user-pic img { width: 36px; height: 36px; }
    .toggle-chat-btn, .response-details-btn, .choose-executor-btn { font-size: 0.625rem; padding: 4px 8px; min-height: 32px; }
    .response-chat-container { height: 300px; }
    .chat-messages { height: calc(100% - 48px); }
    .chat-input { height: 48px; padding: 6px; }
    .chat-input input { font-size: 0.75rem; padding: 6px 10px; }
    .chat-input button { font-size: 0.75rem; padding: 6px 12px; min-width: 70px; }
    .response-chat-container .message-content { font-size: 0.75rem; }
    .response-chat-container .message-time { font-size: 0.625rem; }

    /* Модальные окна на планшетах */
    .modal-content {
        margin-left: 0 !important;
    }

    .modal-fullheight .modal-content {
        width: calc(100% - 88px) !important;
        height: 100vh !important;
        max-height: 100vh !important;
        margin-left: 0 !important;
    }

    .modal-left .modal-dialog {
        left: 88px !important;
        width: calc(100% - 88px) !important;
        max-width: calc(100% - 88px) !important;
        height: 100vh !important;
        max-height: 100vh !important;
    }

    .modal-header, .modal-footer {
        padding: 0.5rem;
        flex-shrink: 0;
    }

    .modal-body {
        padding: 1rem;
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .modal-title {
        margin-top: 0.25rem;
        align-self: flex-start;
        font-size: 1.125rem;
        font-weight: 600;
        color: var(--color-2);
    }

    /* Улучшенные стили для кнопки закрытия на планшетах */
    .modal-header .btn-close {

        min-width: 36px;
        min-height: 36px;

    }

    .modal-header .btn-close::before {
        top: -12px;
        left: -12px;
        right: -12px;
        bottom: -12px;
        border-radius: 16px;
    }

    .modal-header .btn-close::after {
        font-size: 1.8rem;
    }

    .form-label, .form-control, .form-select { font-size: 0.75rem; }
    .form-control, .form-select { padding: 0.5rem; }
    .rating-group .star { font-size: 1rem; }
    .task-name-wrapper { gap: 8px; }
    .icon-container { width: 48px; height: 48px; padding: 10px; }
    .task-name { font-size: 1.125rem; }
    .category-name, .translated-text { font-size: 0.75rem; }
    .user-rating-circle { width: 20px; height: 20px; font-size: 9px; top: -5px; right: 20px; border-width: 1.5px; }
    .gallery.swiper { height: 160px; }
    .swiper-button-next, .swiper-button-prev { width: 28px; height: 28px; }
    .lightbox-content { width: 95%; height: 70%; }
}

@media (max-width: 576px) {
    /* Модальные окна на мобильных */
    .modal-content {
        margin: 0 !important;
        width: calc(100% - 88px) !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        border: none !important;
    }

    .modal-left .modal-dialog {
        left: 88px !important;
        width: calc(100% - 88px) !important;
        max-width: calc(100% - 88px) !important;
        height: 100vh !important;
        max-height: 100vh !important;
        margin: 0 !important;
    }

    .modal-fullheight {
        height: 100vh !important;
        margin: 0 !important;
    }

    .modal-fullheight .modal-content {
        height: 100vh !important;
        max-height: 100vh !important;
        width: 100% !important;
    }

    .modal-header {
        padding: 0.75rem 1rem;
        flex-shrink: 0;
        border-bottom: 1px solid var(--color-5);
    }

    .modal-body {
        padding: 1rem;
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        height: auto;
        max-height: none;
    }

    .modal-footer {
        padding: 1rem;
        flex-shrink: 0;
        border-top: 1px solid var(--color-5);
        background-color: var(--color-1);
        position: sticky;
        bottom: 0;
        z-index: 10;
    }

    .modal-title {
        font-size: 1rem;
        margin-top: 0.5rem;
        align-self: flex-start;
        padding-right: 1.5rem;
    }

    /* Улучшенные стили для кнопки закрытия на мобильных */
    .modal-header .btn-close {

    }

    .modal-header .btn-close::before {
        top: -16px;
        left: -16px;
        right: -16px;
        bottom: -16px;
        border-radius: 20px;
    }

    .modal-header .btn-close::after {
        font-size: 2rem;
    }

    .container { padding: 8px;}
    .task-detail-container { padding: 8px 8px 16px 8px !important; }
    .task-detail-container .row.mt-4 { margin-right: -4px; margin-left: -4px; }
    .task-detail-container .row.mt-4 > [class*='col-'] {
        padding-right: 4px;
        padding-left: 4px;
        padding-bottom: 8px;
    }
    .task-detail-container h1 { font-size: 1.5rem; }
    .task-price-card, .user-role-card, .task-detail-card { padding: 15px 10px 15px 10px; }
    .task-price-big { font-size: 3rem; padding: 0.5rem; }
    .task-price-currency { font-size: 0.75rem; }
    .user-role-card .card-body, .task-detail-card .card-body { padding: 0.75rem; }
    .user-role-card h3, .task-detail-card h3 { font-size: 0.875rem; }
    .user-avatar, .placeholder-avatar { width: 24px; height: 24px; }
    .overall-rating { padding: 12px; }
    .rating-number { font-size: 1.75rem; }
    .task-detail-card p { font-size: 0.75rem; }
    #task-map { height: 200px; }
    .response-user-pic img { width: 32px; height: 32px; }
    .response-chat-container { height: 250px; }
    .chat-input { height: 44px; }
    .rating-group .star { font-size: 0.875rem; }
    .task-name { font-size: 1rem; }
    .gallery.swiper { height: 140px; }
    .swiper-button-next, .swiper-button-prev { width: 24px; height: 24px; }
    .lightbox-close { font-size: 1.25rem; top: 12px; right: 12px; }
}

/* Специальные стили для мобильных модальных окон */
@media (max-width: 576px) {
    .modal-left {
        z-index: 1060 !important;
    }
    .modal-backdrop {
        z-index: 1055 !important;
    }

    /* Убираем transform для мобильных - модал сразу на весь экран */
    .modal-left .modal-dialog {
        transform: none !important;
        transition: none !important;
    }

    .modal-left.show .modal-dialog {
        transform: none !important;
    }
}