/* contacts.css */

/* Стили для секции контактов */
.contacts-section {
    background: var(--color-surface-dark);
    margin-top: var(--spacing-xl);
    border-top: 3px solid;
    border-image: var(--gradient-gold) 1;
    border-image-slice: 1;
    position: relative;
    padding: var(--spacing-xl) 0;
}

.contact-info {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: var(--spacing-sm);
}

.contact-item {
    display: flex;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    min-height: 80px;
    cursor: pointer;
    flex: 1;
    background: var(--color-surface-light);
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
    padding: var(--spacing-md);
}

.contact-item:hover {
    background: var(--color-surface-medium) !important;
    transform: translateX(10px);
    border-color: var(--color-accent-light) !important;
    box-shadow: var(--shadow-hover);
}

.contact-item:active {
    transform: translateX(10px) scale(0.98);
}

.contact-icon {
    font-size: 24px;
    min-width: 30px;
    background: var(--gradient-silver);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: var(--spacing-sm);
}

.contact-details p {
    color: var(--color-text);
    font-size: 1.1rem;
    margin: 0;
    font-weight: 300;
    letter-spacing: 0.5px;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Стили для кликабельных контактов */
.contact-item.clickable .contact-details p {
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 4px;
    margin: -4px -8px;
}

.contact-item.clickable .contact-details p:hover {
    color: var(--color-text);
}

.contact-item.clickable .contact-details p.copied {
    color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

.map-container {
    backdrop-filter: blur(10px);
    height: 400px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    min-height: 300px;
    background: var(--color-surface-light);
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
    padding: 3px;
}

#map {
    height: 100%;
    width: 100%;
    border-radius: calc(var(--border-radius) - 2px);
    overflow: hidden;
    border: 2px solid var(--color-border);
    box-sizing: border-box;
}

/* Индикатор загрузки карты */
.map-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--color-text);
    text-align: center;
    padding: var(--spacing-md);
    background: var(--color-surface-light);
    border-radius: var(--border-radius);
}

.map-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--color-border);
    border-top: 4px solid var(--color-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--spacing-sm);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Уведомление о копировании */
.copy-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #4CAF50;
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    z-index: 10000;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: var(--shadow-hover);
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.copy-notification.show {
    transform: translateX(-50%) translateY(0);
}

.copy-notification-icon {
    font-size: 16px;
}

/* Стили для красных SVG-иконок */
.contact-icon svg {
    fill: var(--color-secondary);
    flex-shrink: 0;
}

.view-text svg {
    fill: var(--color-secondary);
    flex-shrink: 0;
}

.btn-outline-warning svg {
    fill: var(--color-secondary);
}

/* При наведении на контактные элементы */
.contact-item:hover .contact-icon svg {
    fill: var(--color-secondary);
    transform: scale(1.1);
    transition: all 0.3s ease;
}

/* Стили для адреса с иконкой локации */
.contact-item.address .contact-icon svg {
    fill: var(--color-secondary);
}

/* Стили для телефона с иконкой телефона */
.contact-item.phone .contact-icon svg {
    fill: #34C759; /* Зеленый для телефона */
}

/* Стили для email с иконкой письма */
.contact-item.email .contact-icon svg {
    fill: #007AFF; /* Синий для email */
}

/* Стили для времени работы с иконкой часов */
.contact-item.hours .contact-icon svg {
    fill: #FF9500; /* Оранжевый для часов */
}

/* Адаптивность */

/* Планшеты */
@media (max-width: 992px) {
    .contacts-section {
        margin-top: var(--spacing-lg);
        padding: var(--spacing-lg) 0;
    }
    
    .contact-item {
        min-height: 75px;
        padding: var(--spacing-sm);
    }
    
    .map-container {
        height: 350px;
        min-height: 280px;
    }
}

@media (max-width: 768px) {
    .contacts-section {
        margin-top: var(--spacing-md);
    }
    
    .section-title {
        font-size: 1.8rem !important;
        margin-bottom: var(--spacing-lg);
    }
    
    .contact-item {
        min-height: 70px;
        padding: var(--spacing-sm) !important;
    }
    
    .contact-item:hover {
        transform: translateY(-2px);
    }
    
    .contact-icon {
        font-size: 20px;
        width: 36px;
        height: 36px;
        margin-right: var(--spacing-sm);
    }
    
    .contact-details p {
        font-size: 1rem;
    }
    
    .map-container {
        height: 300px;
        min-height: 250px;
        margin-top: var(--spacing-md);
    }
}

/* Мобильные устройства */
@media (max-width: 576px) {
    .contacts-section {
        margin-top: var(--spacing-md);
        padding: var(--spacing-md) 0;
    }
    
    .section-title {
        font-size: 1.6rem !important;
        margin-bottom: var(--spacing-md);
    }
    
    .contact-item {
        min-height: 65px;
        padding: 15px !important;
        flex-direction: row;
        text-align: left;
        gap: var(--spacing-sm);
    }
    
    .contact-icon {
        font-size: 18px;
        width: 32px;
        height: 32px;
        margin-right: 0 !important;
        margin-bottom: 0;
    }
    
    .contact-details p {
        font-size: 0.95rem;
    }
    
    .map-container {
        height: 250px;
        min-height: 200px;
        margin-top: var(--spacing-sm);
    }
    
    .copy-notification {
        width: 90%;
        text-align: center;
        padding: 10px 15px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .contact-item {
        padding: 12px !important;
    }
    
    .contact-details p {
        font-size: 0.9rem;
    }
    
    .map-container {
        height: 220px;
    }
    
    .map-loading {
        padding: var(--spacing-sm);
    }
    
    .map-loading-spinner {
        width: 30px;
        height: 30px;
        border-width: 3px;
    }
}

/* Поддержка touch-устройств */
@media (hover: none) and (pointer: coarse) {
    .contact-item:hover {
        transform: none;
        background: var(--color-surface-light);
    }
    
    .contact-item:active {
        background: var(--color-surface-medium);
        transform: scale(0.98);
    }
    
    .contact-item.clickable .contact-details p:hover {
        background: transparent;
    }
    
    .contact-item.clickable .contact-details p:active {
        background: var(--color-accent-light);
    }
}

/* Анимация появления элементов контактов */
.contact-item {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

.contact-item:nth-child(1) { animation-delay: 0.1s; }
.contact-item:nth-child(2) { animation-delay: 0.2s; }
.contact-item:nth-child(3) { animation-delay: 0.3s; }
.contact-item:nth-child(4) { animation-delay: 0.4s; }

/* Плавное появление карты */
.map-container {
    animation: fadeIn 0.8s ease forwards;
    opacity: 0;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Стили для иконок внутри контактов */
.contact-icon i {
    font-size: 1.5rem;
}

/* Темная тема для карты */
.map-dark-theme {
    filter: invert(90%) hue-rotate(180deg) contrast(85%) brightness(110%);
}

/* Улучшенные стили для кликабельных элементов */
.contact-item.clickable {
    position: relative;
    overflow: hidden;
}

.contact-item.clickable::after {
    position: absolute;
    right: var(--spacing-md);
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.contact-item.clickable:hover::after {
    opacity: 0.7;
    transform: translateX(0);
}

.contact-item.clickable.copied::after {
    content: '✓';
    color: #4CAF50;
    opacity: 1;
}

/* Фиксируем размер карты и предотвращаем растягивание */
.map-container {
    position: relative;
    height: 400px !important; /* Фиксированная высота */
    max-height: 400px !important;
    min-height: 300px !important;
    width: 100%;
    overflow: hidden;
    resize: none !important;
}

.map-container:fullscreen,
.map-container:-webkit-full-screen,
.map-container:-moz-full-screen,
.map-container:-ms-fullscreen {
    height: 100vh !important;
    max-height: 100vh !important;
    min-height: 100vh !important;
}

#map {
    height: 100% !important;
    width: 100% !important;
    position: absolute !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* Стили для полноэкранного режима */
:fullscreen #map,
:-webkit-full-screen #map,
:-moz-full-screen #map,
:-ms-fullscreen #map {
    height: 100vh !important;
}

/* Предотвращаем растягивание после выхода из полноэкранного режима */
.map-container:not(:fullscreen):not(:-webkit-full-screen):not(:-moz-full-screen):not(:-ms-fullscreen) {
    animation: resetSize 0.3s ease forwards;
}

@keyframes resetSize {
    to {
        height: 400px !important;
        max-height: 400px !important;
        min-height: 300px !important;
    }
}

/* Улучшенные медиа-запросы для карты */
@media (max-width: 992px) {
    .map-container {
        height: 350px !important;
        max-height: 350px !important;
        min-height: 280px !important;
    }
    
    @keyframes resetSize {
        to {
            height: 350px !important;
            max-height: 350px !important;
            min-height: 280px !important;
        }
    }
}

@media (max-width: 768px) {
    .map-container {
        height: 300px !important;
        max-height: 300px !important;
        min-height: 250px !important;
    }
    
    @keyframes resetSize {
        to {
            height: 300px !important;
            max-height: 300px !important;
            min-height: 250px !important;
        }
    }
}

@media (max-width: 576px) {
    .map-container {
        height: 250px !important;
        max-height: 250px !important;
        min-height: 200px !important;
    }
    
    @keyframes resetSize {
        to {
            height: 250px !important;
            max-height: 250px !important;
            min-height: 200px !important;
        }
    }
}

@media (max-width: 480px) {
    .map-container {
        height: 220px !important;
        max-height: 220px !important;
        min-height: 180px !important;
    }
    
    @keyframes resetSize {
        to {
            height: 220px !important;
            max-height: 220px !important;
            min-height: 180px !important;
        }
    }
}

/* Обеспечиваем, что карта всегда будет видна */
.ymaps-2-1-79-map {
    width: 100% !important;
    height: 100% !important;
}

.ymaps-2-1-79-inner-panes {
    width: 100% !important;
    height: 100% !important;
}

/* Гарантируем, что родительский контейнер не растягивается */
.contact-info + .col-lg-6 {
    display: flex;
    flex-direction: column;
}

.contact-info + .col-lg-6 .map-container {
    flex-shrink: 0;
}