/* --- Стили для плавающей кнопки контактов --- */
.floating-contact-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    transition: all 0.3s ease;
}

.contact-fab {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--subtle-text-color) 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.contact-fab::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    border-radius: 50%;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.contact-fab:hover::before {
    opacity: 1;
}

.contact-fab:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.contact-fab:active {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.contact-fab i {
    font-size: 1.4rem;
    color: white;
    transition: all 0.3s ease;
    z-index: 1;
}

.contact-fab:hover i {
    transform: scale(1.1);
}

/* Анимация появления кнопки */
.floating-contact-btn {
    animation: fadeInUp 0.6s ease 0.5s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Пульсация для привлечения внимания */
.contact-fab.pulse {
    animation: fabPulse 2s infinite;
}

@keyframes fabPulse {
    0% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 0 0 rgba(33, 37, 41, 0.4);
    }
    70% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 0 15px rgba(33, 37, 41, 0);
    }
    100% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 0 0 rgba(33, 37, 41, 0);
    }
}

/* Скрытие кнопки при прокрутке вниз (опционально) */
.floating-contact-btn.hidden {
    transform: translateY(100px);
    opacity: 0;
    pointer-events: none;
}

/* Адаптивность для плавающей кнопки */
@media (max-width: 768px) {
    .floating-contact-btn {
        bottom: 20px;
        right: 20px;
    }
    
    .contact-fab {
        width: 56px;
        height: 56px;
    }
    
    .contact-fab i {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .floating-contact-btn {
        bottom: 15px;
        right: 15px;
    }
    
    .contact-fab {
        width: 52px;
        height: 52px;
    }
    
    .contact-fab i {
        font-size: 1.2rem;
    }
}

/* Стили для состояния активности */
.contact-fab[aria-expanded="true"] {
    background: linear-gradient(135deg, var(--subtle-text-color) 0%, var(--accent-color) 100%);
    transform: rotate(180deg) scale(1.1);
}

.contact-fab[aria-expanded="true"] i {
    transform: rotate(-180deg);
}

/* Улучшенные стили для модального окна */
.contact-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.contact-modal.is-open {
    display: flex;
}

.contact-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.contact-modal-content {
    position: relative;
    background-color: var(--card-bg-color);
    border-radius: var(--border-radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideInScale 0.4s ease;
    border: 1px solid var(--border-color);
}

.contact-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--subtle-text-color);
    transition: all 0.3s ease;
    z-index: 10;
}

.contact-modal-close:hover {
    background-color: var(--bg-color);
    color: var(--text-color);
    transform: scale(1.1);
}

.contact-modal-close i {
    font-size: 1rem;
}

.contact-modal-header {
    padding: 30px 30px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--bg-color) 0%, var(--card-bg-color) 100%);
}

.contact-modal-header h3 {
    font-family: var(--header-font);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.contact-modal-header p {
    color: var(--subtle-text-color);
    font-size: 0.95rem;
    margin: 0;
}

.contact-modal-body {
    padding: 25px 30px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
    border-radius: var(--border-radius-sm);
}

.contact-item:last-child {
    border-bottom: none;
}

.contact-item:hover {
    background-color: var(--bg-color);
    margin: 0 -15px;
    padding-left: 15px;
    padding-right: 15px;
    transform: translateX(5px);
}

.contact-item-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.contact-item-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.contact-item:hover .contact-item-icon::before {
    opacity: 1;
}

.contact-item:nth-child(1) .contact-item-icon {
    background: linear-gradient(135deg, #0088cc 0%, #006bb3 100%);
    color: white;
}

.contact-item:nth-child(2) .contact-item-icon {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--subtle-text-color) 100%);
    color: white;
}

.contact-item:nth-child(3) .contact-item-icon {
    background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
    color: white;
}

.contact-item:hover .contact-item-icon {
    transform: scale(1.1) rotate(5deg);
}

.contact-item-content {
    flex: 1;
    min-width: 0;
}

.contact-item-content h4 {
    font-family: var(--header-font);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 4px 0;
}

.contact-item-content a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    display: block;
    margin-bottom: 2px;
    transition: all 0.3s ease;
    position: relative;
}

.contact-item-content a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.contact-item-content a:hover::after {
    width: 100%;
}

.contact-item-content a:hover {
    color: var(--subtle-text-color);
}

.contact-item-desc {
    font-size: 0.85rem;
    color: var(--subtle-text-color);
    display: block;
}

.contact-modal-footer {
    padding: 15px 30px 25px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-color);
}

.contact-modal-footer p {
    color: var(--subtle-text-color);
    font-size: 0.9rem;
    margin: 0;
    font-style: italic;
}

/* Улучшенные анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInScale {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Анимация закрытия */
.contact-modal.closing .contact-modal-overlay {
    animation: fadeOut 0.3s ease;
}

.contact-modal.closing .contact-modal-content {
    animation: slideOutScale 0.3s ease;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes slideOutScale {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
}

/* Адаптивность для модального окна */
@media (max-width: 768px) {
    .contact-modal {
        padding: 15px;
    }
    
    .contact-modal-content {
        max-width: 100%;
        margin: 0;
    }
    
    .contact-modal-header {
        padding: 25px 20px 15px;
    }
    
    .contact-modal-header h3 {
        font-size: 1.3rem;
    }
    
    .contact-modal-body {
        padding: 20px;
    }
    
    .contact-item {
        gap: 12px;
        padding: 12px 0;
    }
    
    .contact-item:hover {
        margin: 0 -10px;
        padding-left: 10px;
        padding-right: 10px;
        transform: translateX(3px);
    }
    
    .contact-item-icon {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    
    .contact-item-content h4 {
        font-size: 1rem;
    }
    
    .contact-item-content a {
        font-size: 0.9rem;
    }
    
    .contact-item-desc {
        font-size: 0.8rem;
    }
    
    .contact-modal-footer {
        padding: 12px 20px 20px;
    }
    
    .contact-modal-footer p {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .contact-modal {
        padding: 10px;
    }
    
    .contact-modal-header {
        padding: 20px 15px 12px;
    }
    
    .contact-modal-header h3 {
        font-size: 1.2rem;
    }
    
    .contact-modal-body {
        padding: 15px;
    }
    
    .contact-item {
        gap: 10px;
        padding: 10px 0;
    }
    
    .contact-item-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .contact-modal-footer {
        padding: 10px 15px 15px;
    }
}

/* Дополнительные эффекты для лучшего UX */
.contact-item.copied {
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.contact-item.copied .contact-item-content a {
    color: #155724;
}

/* Стили для состояния фокуса (доступность) */
.contact-fab:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.contact-modal-content:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.contact-item-content a:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Анимация при загрузке страницы */
.floating-contact-btn.loaded {
    animation: bounceIn 0.8s ease 1s both;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(50px);
    }
    50% {
        opacity: 1;
        transform: scale(1.05) translateY(-10px);
    }
    70% {
        transform: scale(0.9) translateY(0);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}
