/* Toast Notifications Container */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    pointer-events: none;
    max-width: 400px;
}

/* Toast Notification Styles */
.toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    margin-bottom: 12px;
    padding: 16px 20px;
    pointer-events: auto;
    position: relative;
    animation: toastSlideIn 0.3s ease-out;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 100%;
    word-wrap: break-word;
    min-height: 52px;
}

.toast::before {
    content: '';
    width: 4px;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    border-radius: 8px 0 0 8px;
}

.toast.success {
    border: 1px solid #c3e6cb;
    color: #155724;
}

.toast.success::before {
    background: #28a745;
}

.toast.error {
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.toast.error::before {
    background: #dc3545;
}

.toast.info {
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.toast.info::before {
    background: #17a2b8;
}

.toast.warning {
    border: 1px solid #ffeaa7;
    color: #856404;
}

.toast.warning::before {
    background: #ffc107;
}

/* Toast Icons */
.toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: white;
}

.toast.success .toast-icon {
    background: #28a745;
}

.toast.error .toast-icon {
    background: #dc3545;
}

.toast.info .toast-icon {
    background: #17a2b8;
}

.toast.warning .toast-icon {
    background: #ffc107;
}

.toast-content {
    flex: 1;
    line-height: 1.4;
}

.toast-close {
    background: rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.15);
    color: #555;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
    padding: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: all 0.2s;
    border-radius: 50%;
    flex-shrink: 0;
    margin-left: 12px;
    z-index: 1;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 0, 0, 0.2);
    color: #333;
    transform: scale(1.1);
}

/* Toast Animations */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.toast.removing {
    animation: toastSlideOut 0.3s ease-in forwards;
}

/* Global Message Utilities */
.showMessage {
    /* Utility class for JavaScript message showing */
}

/* Header Styles */
.header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
}

/* Logo Styles */
.logo {
    font-size: 2.5rem;
    font-weight: 600;
    color: #0f73b1;
    text-decoration: none;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-image {
    height: 35px;
    width: auto;
    object-fit: contain;
}

.logo:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

/* Navigation Container */
.nav-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(102, 126, 234, 0.08);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 0.725rem;
    border: 1px solid rgba(102, 126, 234, 0.15);
}


/* Navigation Styles */
.nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.nav a {
    text-decoration: none;
    color: #1f2937;
    font-weight: 500;
    font-size: 1rem;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    transition: all 0.2s ease;
    padding: 0.75rem 0.75rem;
    border-radius: 0.5rem;
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 2.75rem;
    box-sizing: border-box;
}

.nav a:hover {
    color: #0967d3;
    background: #f1f5f9;
    transform: translateY(-1px);
}

.nav a.active {
    color: #2f73b2;
    font-weight: 500;
    background: #f1f5f9;
    border: 1px solid #d6dcf2;
}


/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    align-items: center;
    gap: 8px;
    background: rgba(102, 126, 234, 0.08);
    border: 1px solid rgba(102, 126, 234, 0.15);
    cursor: pointer;
    padding: 0.625rem 1rem;
    border-radius: 12px;
    transition: all 0.2s ease;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    backdrop-filter: blur(10px);
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.menu-label {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mobile-menu-btn:hover {
    background: rgba(102, 126, 234, 0.12);
    border-color: rgba(102, 126, 234, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.mobile-menu-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(102, 126, 234, 0.15);
}

.mobile-menu-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translateY(6px);
}

.mobile-menu-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translateY(-6px);
}

.mobile-menu-btn.active {
    background: #0967d3;
    border-color: #0967d3;
}

.mobile-menu-btn.active .menu-label {
    color: white;
}

.mobile-menu-btn.active .hamburger-line {
    background: white;
}

.hamburger-line {
    width: 20px;
    height: 2px;
    background: #374151;
    border-radius: 1px;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Navigation Divider */
.nav-divider {
    width: 1px;
    height: 32px;
    background: #e5e7eb;
}

/* Auth Buttons */
.auth-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.auth-buttons .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

/* User Greeting */
/* .user-greeting стили перенесены в main.css */

/* Button Styles - Header specific sizes */
/* Базовый стиль .btn перенесен в main.css */

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

/* .btn-primary стили перенесены в main.css */

/* .btn-secondary стили перенесены в main.css */

.btn-secondary.active,
.auth-buttons .btn-secondary.active {
    color: #0967d3 !important;
    font-weight: 500 !important;
    background: #f1f5f9 !important;
    border: 1px solid #d6dcf2 !important;
}

/* Small buttons for compact areas */
/* .btn-sm стили перенесены в main.css */

/* Full width buttons */
.btn-full {
    width: 100%;
}

/* Footer Styles */
.footer {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #94a3b8;
    padding: 3rem 0 1.5rem 0;
    margin-top: 3rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 1rem;
}

.footer-section h4,
.footer-title {
    color: white;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 1.5rem;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

.footer-legal {
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.footer-legal a {
    color: #94a3b8;
    text-decoration: none;
}

.footer-legal a:hover {
    color: white;
}

.footer-legal span {
    margin: 0 0.5rem;
    color: #6b7280;
}

.footer-copyright {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Social Links */
.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    justify-content: flex-start;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    overflow: hidden;
    flex-shrink: 0;
    box-sizing: border-box;
}

.social-link img {
    width: 24px;
    height: 24px;
    max-width: 24px;
    max-height: 24px;
    object-fit: contain;
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-2px);
}

.social-link.telegram {
    background: rgba(38, 165, 214, 0.2);
}

.social-link.telegram:hover {
    background: #26a5d6;
    color: white;
}

.social-link.vk {
    background: rgba(76, 117, 163, 0.2);
}

.social-link.vk:hover {
    background: #4c75a3;
    color: white;
}

/* Dynamic hamburger menu for any screen size when content doesn't fit */
@media (max-width: 1024px) {
    /* Show mobile menu button */
    .mobile-menu-btn {
        display: flex;
    }
    
    /* Hide desktop navigation */
    .nav-container {
        position: fixed;
        top: 90px;
        right: 0;
        width: 250px;
        max-width: 70vw;
        max-height: calc(100vh - 110px);
        background: white;
        flex-direction: column;
        gap: 0;
        padding: 1.5rem 1rem;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
        transform: translateX(100%);
        opacity: 0;
        overflow-y: auto;
        overflow-x: hidden;
        z-index: 999;
        border: 1px solid #e5e7eb;
        border-radius: 16px 0 0 16px;
        /* Убираем стили десктопа */
        backdrop-filter: none;
        /* Добавляем скроллбар стилизацию */
        scrollbar-width: thin;
        scrollbar-color: #cbd5e1 #f3f4f6;
    }
    
    /* Стилизация скроллбара для webkit браузеров */
    .nav-container::-webkit-scrollbar {
        width: 6px;
    }
    
    .nav-container::-webkit-scrollbar-track {
        background: #f3f4f6;
    }
    
    .nav-container::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 3px;
    }
    
    .nav-container::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }
    
    .nav-container.active {
        transform: translateX(0);
        opacity: 1;
        z-index: 999;
    }
    
    .nav {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }
    
    .nav a {
        font-size: 0.9375rem;
        padding: 0.875rem 1.25rem;
        width: 100%;
        text-align: left;
        border-radius: 8px;
        word-wrap: break-word;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .nav-divider {
        width: 100%;
        height: 1px;
        margin: 1.5rem 0;
        background: #e5e7eb;
    }
    
    .auth-buttons {
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
        margin-top: 1rem;
        min-width: auto;
        min-height: auto;
    }
    
    .auth-buttons .btn {
        width: 100%;
        max-width: 100%;
        min-width: auto;
        justify-content: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Desktop - optimized menu */
@media (min-width: 1025px) and (max-width: 1400px) {
    .nav-container {
        gap: 0.5rem;
        padding: 0.375rem;
    }
    
    .nav {
        gap: 0.125rem;
    }
    
    .nav a {
        font-size: 0.9rem;
        padding: 0.5rem 0.625rem;
    }
    
    .auth-buttons {
        gap: 0.5rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* Tablet landscape - compact menu */
@media (min-width: 769px) and (max-width: 1024px) {
    .header-content {
        padding: 0 1.5rem;
    }
    
    .nav-container {
        gap: 0.375rem;
        padding: 0.25rem;
    }
    
    .nav {
        gap: 0.125rem;
    }
    
    .nav a {
        font-size: 0.875rem;
        padding: 0.5rem 0.625rem;
    }
    
    .auth-buttons {
        gap: 0.75rem;
    }
    
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.9375rem;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    /* Header mobile styles */
    .header-content {
        padding: 0 1rem;
        height: 60px;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .logo-image {
        height: 32px;
    }
    
    /* Дополнительные мобильные стили для элементов, которые не меняются на планшетах */
    
    .auth-buttons-content {
        width: 100%;
    }
    
    .auth-buttons-skeleton {
        width: 100%;
        flex-direction: column;
    }
    
    .skeleton-btn {
        width: 100%;
        height: 44px;
    }
    
    .auth-buttons .btn {
        width: 100%;
        max-width: 100%;
        min-width: auto;
        justify-content: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .btn-sm {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .user-greeting {
        font-size: 12px;
        margin-right: 0.25rem;
    }
    
    /* Footer mobile styles */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* Small mobile - compact menu button */
@media (max-width: 480px) {
    .menu-label {
        font-size: 0.875rem;
    }
    
    .mobile-menu-btn {
        padding: 0.5rem 0.875rem;
        gap: 6px;
    }
}

/* Very small mobile devices */
@media (max-width: 360px) {
    /* Уже обрабатывается в @media (max-width: 1024px) */
    
    /* Скрываем текст "Меню" только на очень маленьких экранах */
    .menu-label {
        display: none;
    }
    
    .mobile-menu-btn {
        padding: 8px;
    }
    
    .nav a {
        font-size: 0.875rem;
        padding: 0.75rem 1rem;
    }
    
    .auth-buttons .btn {
        padding: 0.625rem 1rem;
        font-size: 0.813rem;
        min-width: 100px;
    }
}

/* Overlay for mobile menu */
@media (max-width: 768px) {
    /* Prevent body scroll when menu is open */
    body:has(.nav-container.active) {
        overflow: hidden;
    }
    
    body:has(.nav-container.active)::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 98;
        animation: fadeIn 0.3s ease;
    }
}

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

/* Общие стили для контейнеров страниц */
.page-container {
    max-width: 1500px;
    margin: -4rem auto 0;
    padding: 0 2rem;
    position: relative;
    z-index: 10;
}

.content-card {
    background: #f8fafc;
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

/* Адаптивность для контейнеров */
@media (max-width: 768px) {
    .page-container {
        margin-top: -2rem;
        padding: 0 1rem;
    }
    
    .content-card {
        padding: 1.5rem;
        border-radius: 16px;
    }
    
    /* Центрируем иконки соцсетей на мобильных */
    .footer-section .social-links {
        justify-content: center;
    }
}