/* ===========================================
   STYLES FOR PHOTO CONTEST PLUGIN
   Версия: 2.0 (обновлено для отображения полного имени)
   =========================================== */

/* VEKA Rus Sans шрифт для системы лайков */
.contest-likes-count,
.contest-likes-count *,
.contest-notification-text,
.contest-error-notification .contest-notification-text {
    font-family: "VEKA Rus Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

/* Специальный класс для использования шрифта VEKA */
.contest-likes-count-veka,
.contest-likes-count-veka * {
    font-family: "VEKA Rus Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

/* ==================== СТИЛИ ДЛЯ ОТОБРАЖЕНИЯ ИМЕНИ УЧАСТНИКА ==================== */

/* Контейнер для отображения информации об участнике */
.contest-participant-display {
    text-align: center;
    margin: 15px 0;
    line-height: 1.2;
    font-family: "VEKA Rus Sans", sans-serif;
}

/* Полная информация в одну строку */
.contest-full-info {
    font-family: "VEKA Rus Sans", sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #0B1742;
    line-height: 1.2;
    display: inline-block;
}

/* Номер работы */
.contest-work-number {
    font-family: "VEKA Rus Sans", sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #0B1742;
}

/* Информация об имени */
.contest-name-info {
    font-family: "VEKA Rus Sans", sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #0B1742;
}

/* Имя участника */
.contest-name {
    font-family: "VEKA Rus Sans", sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #0069B3;
}

/* Фамилия участника (если показывается) */
.contest-surname {
    font-family: "VEKA Rus Sans", sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #0069B3;
}

/* Отдельные классы для шорткодов */
.contest-work-number-only {
    font-family: "VEKA Rus Sans", sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #0B1742;
}

.contest-name-only {
    font-family: "VEKA Rus Sans", sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #0069B3;
}

.contest-surname-only {
    font-family: "VEKA Rus Sans", sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #0069B3;
}

/* Кликабельные заголовки */
.contest-clickable-title {
    text-decoration: none;
    color: inherit;
    display: inline-block;
    transition: all 0.3s ease;
    cursor: pointer;
}

.contest-clickable-title:hover {
    color: #0069B3;
    text-decoration: underline;
}

.contest-clickable-title:hover .contest-work-number,
.contest-clickable-title:hover .contest-name-info {
    color: #0069B3;
}

/* Заголовок на странице работы */
.contest-title-on-page {
    font-family: "VEKA Rus Sans", sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #0B1742;
    line-height: 1.3;
    display: block;
    margin-bottom: 15px;
}

/* ==================== СТИЛИ ДЛЯ КНОПОК ЛАЙКОВ ==================== */

/* Базовые стили кнопки лайка */
.contest-like-btn {
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 26px !important;
    height: 24px !important;
    position: relative !important;
    transition: transform 0.2s ease !important;
    overflow: hidden !important;
}

/* Ховер эффект */
.contest-like-btn:hover:not(.liked):not(:disabled) {
    transform: scale(1.1) !important;
}

/* Активное состояние */
.contest-like-btn:active:not(.liked):not(:disabled) {
    transform: scale(0.95) !important;
}

/* Лайкнутая или отключенная кнопка */
.contest-like-btn.liked,
.contest-like-btn:disabled {
    cursor: not-allowed !important;
    opacity: 0.9 !important;
}

/* Кнопка в состоянии загрузки */
.contest-like-btn.loading {
    cursor: wait !important;
    opacity: 0.7 !important;
}

/* Иконки лайков */
.contest-like-icon {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 26px !important;
    height: 24px !important;
    object-fit: contain !important;
    transition: opacity 0.3s ease !important;
}

/* Иконка выключенного лайка */
.contest-like-icon-off {
    opacity: 1 !important;
    display: block !important;
}

/* Иконка включенного лайка */
.contest-like-icon-on {
    opacity: 0 !important;
    display: block !important;
}

/* Состояние лайкнутой кнопки */
.contest-like-btn.liked .contest-like-icon-off {
    opacity: 0 !important;
    display: none !important;
}

.contest-like-btn.liked .contest-like-icon-on {
    opacity: 1 !important;
    display: block !important;
}

/* Индикатор загрузки */
.contest-like-loading {
    display: inline-block !important;
    width: 20px !important;
    height: 20px !important;
    border: 2px solid #f3f3f3 !important;
    border-top: 2px solid #0069B3 !important;
    border-radius: 50% !important;
    animation: spin 1s linear infinite !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 10 !important;
}

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

/* ==================== СТИЛИ ДЛЯ СЧЕТЧИКА ЛАЙКОВ ==================== */

/* Контейнер счетчика */
.contest-likes-count {
    display: inline-flex !important;
    align-items: baseline !important;
    gap: 6px !important;
    font-family: "VEKA Rus Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    line-height: 1 !important;
    margin-left: 10px !important;
    font-feature-settings: 'kern', 'liga', 'clig', 'calt' !important;
    font-kerning: normal !important;
    text-rendering: optimizeLegibility !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* СИНИЙ СТИЛЬ (по умолчанию) */
.contest-likes-count-blue .likes-label {
    font-weight: 400 !important;
    font-size: 12px !important;
    color: #84858A !important;
    font-family: "VEKA Rus Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    letter-spacing: -0.01em !important;
}

.contest-likes-count-blue .contest-like-count {
    font-weight: 700 !important;
    font-size: 16px !important;
    color: #0B1742 !important;
    font-family: "VEKA Rus Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    letter-spacing: -0.01em !important;
}

/* БЕЛЫЙ СТИЛЬ */
.contest-likes-count-white .likes-label {
    font-weight: 400 !important;
    font-size: 12px !important;
    color: #FFFFFF !important;
    font-family: "VEKA Rus Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    letter-spacing: -0.01em !important;
}

.contest-likes-count-white .contest-like-count {
    font-weight: 700 !important;
    font-size: 16px !important;
    color: #FFFFFF !important;
    font-family: "VEKA Rus Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    letter-spacing: -0.01em !important;
}

/* ==================== СТИЛИ ДЛЯ УВЕДОМЛЕНИЙ ==================== */

/* Текст уведомлений */
.contest-notification-text {
    font-family: "VEKA Rus Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #FFFFFF !important;
    line-height: 1.4 !important;
    letter-spacing: -0.01em !important;
}

.contest-error-notification .contest-notification-text {
    font-family: "VEKA Rus Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

/* Успешное уведомление */
.contest-success-notification {
    position: fixed;
    top: 30px;
    right: 30px;
    background: #0069B3; /* Основной цвет фона */
    border-radius: 12px;
    padding: 16px 24px;
    box-shadow: 0 10px 30px rgba(0, 105, 179, 0.3);
    z-index: 999999;
    min-width: 300px;
    max-width: 400px;
    transform: translateX(100%);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.contest-success-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.contest-notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.contest-notification-icon {
    width: 20px;
    height: 18px;
    object-fit: contain;
    filter: brightness(0) invert(1); /* Делаем иконку белой */
}

.contest-notification-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #FFFFFF;
    font-size: 20px;
    line-height: 1;
    padding: 0;
    margin: 0;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.contest-notification-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Уведомление об ошибке */
.contest-error-notification {
    position: fixed;
    top: 30px;
    right: 30px;
    background: #f44336;
    border-radius: 12px;
    padding: 16px 24px;
    box-shadow: 0 10px 30px rgba(244, 67, 54, 0.3);
    z-index: 999999;
    min-width: 300px;
    max-width: 400px;
    transform: translateX(100%);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.contest-error-notification.show {
    transform: translateX(0);
    opacity: 1;
}

/* ==================== СТИЛИ ДЛЯ ИНФОРМАЦИИ О ЛИМИТАХ ОТПРАВКИ ==================== */

.contest-submission-info {
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-family: 'VEKA Rus Sans', sans-serif;
}

.contest-submission-info.logged-in {
    background-color: #e8f5e9;
    border-left: 4px solid #4caf50;
}

.contest-submission-info.guest {
    background-color: #fff3e0;
    border-left: 4px solid #ff9800;
}

.contest-submission-info p {
    margin: 5px 0;
    font-size: 14px;
    line-height: 1.4;
}

.contest-submission-info a {
    color: #0069B3;
    text-decoration: underline;
}

/* ==================== АНИМАЦИИ ==================== */

/* Анимация пульсации лайка */
@keyframes likePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.like-pulse {
    animation: likePulse 0.4s ease;
}

/* Анимация для активной кнопки */
@keyframes contestLikePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.contest-like-btn.liked .contest-like-icon-on {
    animation: contestLikePulse 0.3s ease;
}

/* ==================== АДАПТИВНОСТЬ ==================== */

/* Планшеты и мобильные устройства (до 768px) */
@media (max-width: 768px) {
    /* Отображение имени участника */
    .contest-full-info {
        font-size: 18px !important;
    }
    
    .contest-work-number,
    .contest-name-info,
    .contest-name,
    .contest-surname,
    .contest-work-number-only,
    .contest-name-only,
    .contest-surname-only {
        font-size: 20px !important;
        color: #0B1742;
    }
    
    .contest-title-on-page {
        font-size: 22px !important;
    }
    
    /* Счетчик лайков */
    .contest-likes-count-blue .likes-label,
    .contest-likes-count-white .likes-label {
        font-size: 14px !important;
    }
    
    .contest-likes-count-blue .contest-like-count,
    .contest-likes-count-white .contest-like-count {
        font-size: 14px !important;
    }
    
    .contest-likes-count {
        gap: 4px !important;
        margin-left: 8px !important;
    }
    
    /* Уведомления */
    .contest-notification-text {
        font-size: 13px !important;
    }
    
    .contest-success-notification,
    .contest-error-notification {
        top: 20px !important;
        right: 20px !important;
        left: 20px !important;
        max-width: none !important;
        min-width: auto !important;
        padding: 14px 20px !important;
    }
    
    /* Кнопки лайков для мобильных */
    .contest-like-btn {
        min-height: 44px !important;
        min-width: 44px !important;
        -webkit-tap-highlight-color: rgba(0, 105, 179, 0.2) !important;
    }
    
    .contest-like-icon {
        width: 24px !important;
        height: 22px !important;
    }
}

/* Мобильные устройства (до 480px) */
@media (max-width: 480px) {
    /* Отображение имени участника */
    .contest-full-info {
        font-size: 16px !important;
    }
    
    .contest-work-number,
    .contest-name-info,
    .contest-name,
    .contest-surname,
    .contest-work-number-only,
    .contest-name-only,
    .contest-surname-only {
        font-size: 18px !important;
        color: #0B1742;
    }
    
    .contest-title-on-page {
        font-size: 20px !important;
    }
    
    /* Счетчик лайков */
    .contest-likes-count-blue .likes-label,
    .contest-likes-count-white .likes-label {
        font-size: 12px !important;
    }
    
    .contest-likes-count-blue .contest-like-count,
    .contest-likes-count-white .contest-like-count {
        font-size: 13px !important;
    }
    
    /* Уведомления */
    .contest-notification-text {
        font-size: 12px !important;
    }
    
    .contest-success-notification,
    .contest-error-notification {
        top: 15px !important;
        right: 15px !important;
        left: 15px !important;
        padding: 12px 16px !important;
    }
    
    /* Компактное отображение для очень маленьких экранов */
    .contest-full-info {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 2px !important;
    }
}

/* Очень маленькие экраны (до 360px) */
@media (max-width: 360px) {
    .contest-full-info {
        font-size: 15px !important;
    }
    
    .contest-work-number,
    .contest-name-info,
    .contest-name,
    .contest-surname {
        font-size: 18px !important;
        color: #0B1742;
    }
    
    .contest-likes-count {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 2px !important;
    }
}

/* ==================== ВСПОМОГАТЕЛЬНЫЕ СТИЛИ ==================== */

/* Предотвращение выделения */
.contest-like-btn,
.contest-likes-count,
.contest-participant-display {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Улучшение доступности для фокуса */
.contest-like-btn:focus-visible {
    outline: 2px solid #0069B3;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Плавные переходы */
.contest-clickable-title,
.contest-like-btn,
.contest-like-icon {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== СТИЛИ ДЛЯ АДМИН-ПАНЕЛИ ==================== */

/* Стили для админ-панели (если используется) */
@media screen and (max-width: 782px) {
    .wp-list-table .column-work_number,
    .wp-list-table .column-name,
    .wp-list-table .column-surname,
    .wp-list-table .column-age_category {
        display: none;
    }
    
    .wp-list-table .column-work_number:before,
    .wp-list-table .column-name:before,
    .wp-list-table .column-surname:before,
    .wp-list-table .column-age_category:before {
        font-weight: bold;
    }
}

/* ==================== ДОПОЛНИТЕЛЬНЫЕ СТИЛИ ДЛЯ ОФОРМЛЕНИЯ ==================== */

/* Градиентный фон для акцентов */
.contest-highlight {
    background: linear-gradient(135deg, #0069B3 0%, #0B1742 100%);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    margin: 10px 0;
}

/* Тень для контейнеров */
.contest-shadow {
    box-shadow: 0 4px 12px rgba(11, 23, 66, 0.1);
    border-radius: 8px;
    padding: 20px;
    background: white;
}

/* Разделитель между элементами */
.contest-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #84858A, transparent);
    margin: 20px 0;
}

/* Стили для статуса лайков */
.contest-likes-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(0, 105, 179, 0.1);
    border-radius: 20px;
    font-size: 12px;
    color: #0069B3;
}

.contest-likes-status.liked {
    background: rgba(0, 105, 179, 0.2);
    font-weight: bold;
}

/* ==================== ПЕРЕМЕННЫЕ CSS ДЛЯ ТЕМ ==================== */

:root {
    --contest-primary: #0069B3;
    --contest-primary-dark: #0B1742;
    --contest-secondary: #84858A;
    --contest-success: #4CAF50;
    --contest-error: #f44336;
    --contest-white: #FFFFFF;
    --contest-light-bg: #F5F7FA;
    --contest-border: #E0E0E0;
}

/* Темная тема (если понадобится) */
@media (prefers-color-scheme: dark) {
    .contest-work-number,
    .contest-name-info,
    .contest-work-number-only {
        color: #0B1742;
    }
    
    .contest-name,
    .contest-surname,
    .contest-name-only,
    .contest-surname-only {
        color: var(--contest-primary) !important;
    }
    
    .contest-title-on-page {
        color: var(--contest-white) !important;
    }
}

/* ==================== СТИЛИ ДЛЯ АРХИВОВ И СПИСКОВ ==================== */

/* Стили для страниц архивов конкурса */
.post-type-archive-contest_photos .contest-participant-display,
.tax-contest_category .contest-participant-display,
.tax-contest_age_category .contest-participant-display {
    margin: 10px 0 15px 0;
    text-align: left;
}

.post-type-archive-contest_photos .contest-full-info,
.tax-contest_category .contest-full-info,
.tax-contest_age_category .contest-full-info {
    font-size: 18px;
}

/* Стили для грид-сеток (если используется) */
.contest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.contest-grid-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contest-grid-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* ==================== СТИЛИ ДЛЯ ПУСТЫХ СОСТОЯНИЙ ==================== */

.contest-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--contest-secondary);
    font-family: "VEKA Rus Sans", sans-serif;
}

.contest-empty-state-icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.contest-empty-state-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--contest-primary-dark);
}

.contest-empty-state-description {
    font-size: 14px;
    max-width: 400px;
    margin: 0 auto;
}


/* ==================== СТИЛИ ДЛЯ ВОЗРАСТНОЙ КАТЕГОРИИ ==================== */

/* Контейнер для возрастной категории */
.contest-age-category {
    font-family: "VEKA Rus Sans", sans-serif;
    font-size: 14px;
    color: #84858A;
    margin-top: 8px;
    line-height: 1.3;
}

/* Метка возрастной категории */
.contest-age-category-label {
    font-weight: 400;
}

/* Значение возрастной категории */
.contest-age-category-value {
    font-weight: 700;
    color: #0069B3;
    margin-left: 4px;
}

/* Блок с возрастом и возрастной категорией вместе */
.contest-age-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.contest-age-container .contest-participant-age,
.contest-age-container .contest-age-category {
    margin-top: 0;
    background: #F5F7FA;
    padding: 8px 12px;
    border-radius: 6px;
    flex: 1;
    min-width: 150px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .contest-age-category {
        font-size: 13px;
    }
    
    .contest-age-container {
        flex-direction: column;
        gap: 8px;
    }
    
    .contest-age-container .contest-participant-age,
    .contest-age-container .contest-age-category {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .contest-age-category {
        font-size: 12px;
    }
}