/* Стили для фронтенд отображения */
.kungfu-frontend-students {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
@media (min-width:900px) {
	.kungfu-frontend-students {
		margin-top: 50px;
	}
}
.kungfu-search-wrapper {
	margin: 0 auto;
}
.kungfu-students-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px; /* Равные отступы между карточками */
    margin-top: 20px;
    justify-content: flex-start; /* Выравнивание по левому краю */
}

.kungfu-student-card {
    background: #111;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 20px;
	padding-top: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    box-sizing: border-box;
    flex: 0 0 calc(25% - 15px); /* 4 карточки в ряд с учетом gap */
    min-width: 280px; /* Минимальная ширина */  
    display: flex;
    flex-direction: column;
    height: auto; /* Автоматическая высота */
    min-height: 250px; /* Минимальная высота для единообразия */
	text-align: center;
}

/* Заголовок карточки с фиксированной высотой */
.student-header {
    margin-bottom: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
    flex-shrink: 0; /* Запрещаем сжатие */
	overflow-x: scroll;
	text-align: center;
}

.kungfu-student-card h3 {
    margin: 0 auto;
	padding: 0;
    color: #fff;
    font-size: 18px;
    line-height: 1.3;
    word-wrap: break-word; /* Перенос длинных слов */
    overflow-wrap: break-word;
    hyphens: auto; /* Переносы слов */
}

/* Контент карточки занимает доступное пространство */
.student-header h3 {
	text-transform: uppercase;
	margin: 10px 0;
}
.student-info {
    flex: 1; /* Занимает все доступное пространство */
    display: flex;
	flex-direction: column-reverse;
    justify-content: space-between;
	padding-bottom: 20px;
	margin-bottom: 16px;
	border-bottom: 1px solid #333;
}
.student-info-items {
	padding-top: 12px;
	padding-left: 8px;
	font-size: 12px;
}
@media (min-width: 800px) {
	.student-info {
		flex-direction: row;
	}
	.student-info-items {
		padding-bottom: 12px;
	}
}

.student-info p {
    margin: 6px 0 !important;
    font-size: 18px;
    line-height: 1.4;
    color: #ccc;
}
.total-rate-title {
	text-align: center !important;
	text-transform: uppercase;
	font-size: 18px;
}

/* Кнопка внизу карточки */
.kungfu-button {
    display: inline-block;
    background: #0073aa;
    color: white;
    padding: 10px 16px;
    text-decoration: none;
    border-radius: 4px;
    margin-top: 15px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0; /* Фиксированная позиция */
}

.kungfu-button:hover {
    background: #005a87;
}

/* Стили для вкладок дивизионов */
.kungfu-division-tabs {
    display: flex;
    margin: 0 0 20px 0;
    border-bottom: 1px solid #333;
    padding: 0 0 20px 0; /* Убрал верхний паддинг */
    justify-content: center; /* Центрируем вкладки */
}

.kungfu-tab {
    padding: 12px 24px;
    text-decoration: none;
    color: #fff;
    background: #222;
    border: 1px solid #333;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    margin-right: 5px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 160px; /* Фиксированная ширина вкладок */
}

.kungfu-tab:hover {
    background: #333;
}

.kungfu-tab-active {
    background: #0073aa;
    color: white;
}

/* Стили для деталей ученика */
.kungfu-student-details {
    margin: 0 auto;
    padding: 8px;
}

.kungfu-back-button {
    display: inline-block;
    margin-bottom: 20px;
    color: #0073aa;
    text-decoration: none;
    padding: 8px 16px;
    border: 2px solid #0073aa;
    border-radius: 4px;
	position: absolute;
	left: 12px;
}

.achievement-item {
	display: flex;
	flex-wrap: wrap;
	width: 100%;
	box-sizing: border-box;
    padding: 16px 16px;
    margin: 24px auto 36px auto;
    /*border-left: 4px solid #0073aa;*/
	flex-direction: column;
	position: relative;
	border: 1px solid #333;
	border-radius: 16px;
	/*box-shadow: 0 0 10px rgba(0, 128, 255, 0.5), 0 0 20px rgba(0, 128, 255, 0.3);*/
}
.achievement-meta-details {
		text-align: center !important;
		margin: 16px 0 10px 0 !important;
	}
@media (min-width: 800px) {
	.achievement-item {
		flex-direction: row;
		flex-wrap: inherit;
	}
	.achievement-meta-details {
		text-align: left !important;
	}
}
.plus-points {
	color: yellowgreen;
	font-weight: bold;
}
.achievement-date {
	color: #0073aa;
}
.achievement-item h3 {
    margin: 0 0 10px 0;
	width: unset;
	display: inline;
	text-transform: uppercase;
    color: yellow;
    font-size: 16px;
	padding-left: unset;
	padding-right: unset;
	padding-bottom: 4px;
	border-bottom: 0 solid #0073aa;
}
.achievement-item-icon {
	display: contents;
}
.achievement-item-icon img {
	margin: 0 auto 12px auto;
	width: 170px;
	height: auto;
}
@media (min-width: 800px) {
	.achievement-item-icon img {
		margin: 8px 32px 0 32px;
		width: 120px;
	}
	.achievement-item h3 {
		display: block;
    	width: max-content;
		padding-top: 0;
	}
}
.achievement-item-details {
	padding: 0;
}
.achievement-item-details p {
	font-size: 16px;
}
.student-details-achiv-done {
	margin-top: 8px;
	margin-right: 8px;
	color: yellowgreen;
}
@media (max-width: 800px) {
	.student-details-achiv-done {
		margin-top: 12px;
	}
}

/* Адаптивность */
@media (max-width: 1200px) {
    .kungfu-student-card {
        flex: 1 1 calc(33.333% - 15px); /* 3 карточки в ряд */
        max-width: calc(33.333% - 15px);
    }
}

@media (max-width: 900px) {
    .kungfu-student-card {
        flex: 1 1 calc(50% - 15px); /* 2 карточки в ряд */
        max-width: calc(50% - 15px);
    }
}

@media (max-width: 768px) {
    .kungfu-students-grid {
        gap: 10px;
    }
    
    .kungfu-student-card {
        flex: 1 1 100%; /* 1 карточка в ряд */
        max-width: 100%;
        min-width: auto;
    }
    
    .kungfu-division-tabs {
        flex-direction: column;
        gap: 5px;
    }
    
    .kungfu-tab {
        margin-right: 0;
        border-radius: 4px;
        border: 1px solid #333;
        min-width: auto;
    }
    
    .kungfu-tab-active {
        border-radius: 4px;
    }
}

@media (max-width: 800px) {
    .kungfu-frontend-students {
        padding: 10px;
    }
    
    .kungfu-student-card {
        padding: 15px;
    }
    
    .kungfu-student-card h3 {
        font-size: 20px;
    }
}
.kungfu-total-points {
	background: #222; 
	padding: 8px 20px; 
	border-radius: 5px; 
}
.total-points {
	width: 100%;
	text-align: center;
	display: block;
	color: #fff;
	font-size: 50px;
}
.total-points-subtitle{
	color: #ccc;
	font-size: 14px;
	width: 100%;
	text-align: center;
	display: block;
	margin-top: 8px;
}
.kungfu-student-personal-card {
	background-color: #111;
	border: 2px solid #222;
	border-radius: 12px;
	padding: 12px 16px;
	max-width: 800px;
	margin: 0 auto;
	position: relative;
	font-weight: bold;
}
@media (min-width: 800px) {
	.kungfu-student-personal-card {
		margin-top: 70px;
	}
}
.regular-text {
    padding: 4px;
    border: 1px solid #ddd;
	max-width: 260px;
	font-family: 'Tenor Sans', sans-serif;
	height: 36px;
  font-size: 20px;
  background-color: #111;
  color: #fff;
  padding-left: 16px;
  border: 1px solid #333;
  border-radius: 6px;
}
.points-to-next-star {
	margin: 5px 0 0;
	font-size: 14px;
	text-align: center !important;
}
.progress-text {
	margin: 5px 0 0;
	font-size: 16px !important;
	color: #ccc;
	text-align: center !important;
	display: block;
}
.student-status-text {
	color: #0073aa;
	text-align: center !important;
	margin: 4px 0 !important;
	word-wrap: anywhere;
}
.student-authority-stars {
	min-height: 30px;
	margin-top: 8px;
	font-size: 24px !important;
	display: inline-flex;
    flex-wrap: nowrap;
    white-space: nowrap;
    gap: 2px;
	justify-content: center;
}
.achievement-points-icon {
	display: block;
	margin: 5px 0;
	font-size: 28px;
	color: yellowgreen;
	position: absolute;
	top: 12px;
}
@media (min-width: 800px) {
	.achievement-points-icon {
		font-size: 23px;
	}
}
.student-authority-stars .star {
    opacity: 0;
    transform: scale(0);
    display: inline-block;
    margin-right: 5px;
}
.student-authority-stars .star.animate {
    animation: starAppear 0.5s ease-in-out forwards;
}
@keyframes starAppear {
    0% { opacity: 0; transform: scale(0); }
    100% { opacity: 1; transform: scale(1); }
}
.stat-desc {
  font-size: 14px;
  text-align: center !important;
  padding: 8px;	
  line-height: 24px !important;
}
.stat-wrap {
	display: flex;
	justify-content: space-around;
	flex-wrap: wrap;
}
.kungfu-bar-chart {
    display: flex;
	width: max-content;
    justify-content: flex-start;
    align-items: flex-end;
    gap: 10px; /* Отступ между столбиками */
	min-height: 250px;
    overflow-x: scroll;
}
.bar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 50px; /* Фиксированная ширина для каждого столбика */
}
.yearly-chart {
    background-color: #222;
	padding: 8px;
	border-radius: 8px;
}
.yearly-chart .bar-container {
    min-width: 80px; /* Для годового графика */
}
.monthly-chart .bar-container {
  min-width: 80px;
}
.bar {
    background-color: #4CAF50;
    width: 60px;
    transition: height 0.5s ease;
    position: relative;
	border-radius: 8px;
	align-content: end;
	padding: 8px 0;
}
.bar-label {
    font-size: 20px;
    color: #ccc;
    margin-top: 5px;
}
.bar-value {
    font-size: 20px;
    color: #000;
    width: 100%;
    text-align: center;
}
.progress-bar-container {
    margin: 10px 0;
    width: 100%;
    height: 20px;
    background-color: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
}
.progress-bar-fill {
    width: 0%;
    height: 100%;
    background-color: #f1c40f;
    transition: width 1s ease-in-out;
}
.progress-percent-text {
	color: #fff;
  font-size: 16px;
  position: relative;
  top: 0;
  display: block;
}
.share-achievement {
        margin-top: 16px;
		margin-right: 4px;
		background-color: #111;
        color: white;
        border: 1px solid #333;
        border-radius: 4px;
        cursor: pointer;
        font-size: 16px;
		width: 45px;
		text-align: center;
		height: 45px;
    }
    .share-achievement:hover {
        background-color: #005177;
    }
    .share-modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: #111;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1000;
    }
	@media (min-width:800px) {
		.share-modal {
			margin-top: 36px;
		}
	}
    .share-modal-content {
        background: #111;
        padding: 20px;
        border-radius: 8px;
        width: 100%;
        text-align: center;
        position: relative;
    }
    @media (min-width:800px) {
        .share-modal-content {
            width: 60vh;
			height: 70vh;
			overflow-y: scroll;
			overflow-x: hidden;
        }
    }
    .share-modal-content h3 {
        color: #fff;
		position: relative;
		top: -2px;
		left: 32px;
    }
	.share-desc {
		font-size: 16px;
		color: #2196f3;
		font-weight: normal;
		text-align: center !important;
		margin-top: 0 !important;
	}
    .share-modal-actions {
        margin-top: 10px;
		margin-bottom: 16px;
        display: flex;
        justify-content: center;
        gap: 10px;
    }
    .share-modal-actions button {
        padding: 8px 16px;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        font-size: 14px;
    }
    #copy-link {
        background-color: #2196f3;
        color: white;
    }
    #copy-link:hover {
        background-color: #1976d2;
    }
    #download-image {
        background-color: #4caf50;
        color: white;
    }
    #download-image:hover {
        background-color: #388e3c;
    }
    #close-modal {
        background-color: #d32f2f;
        color: white;
		border: 0;
		padding: 8px 12px;
		border-radius: 4px;
		float: right;
		z-index: 999;
		position: relative;
		cursor: pointer;
    }
    #close-modal:hover {
        background-color: #b71c1c;
    }
    #share-canvas {
        border: 0 solid #ccc;
        margin: 12px auto;
        display: block;
    }
    #share-link {
        resize: none;
        border: 1px solid #ccc;
        border-radius: 4px;
        background: #fff;
        color: #333;
    }
	.share-button-wrap {
		position: absolute;
		right: 12px;
		top: 0;
	}
	
	.achievement-points-icon {
      font-size: 2rem;
      font-weight: bold;
      color: #ffd700; /* Золотой цвет */
      text-shadow: 0 0 10px rgba(255, 215, 0, 0.8); /* Легкое свечение */
      opacity: 0; /* Скрыт до активации */
    }

    /* Класс для запуска анимации */
    .animate {
      animation: popAndFade 1s ease-out forwards;
    }

    /* Анимация появления с сохранением видимости */
    @keyframes popAndFade {
      0% {
        transform: scale(0.2);
        opacity: 0;
      }
      50% {
        transform: scale(1.2);
        opacity: 1;
      }
      100% {
        transform: scale(1);
        opacity: 1; /* Надпись остается видимой */
      }
    }

    /* Эффект вспышки */
    .achievement-points-icon::after {
      content: '';
      position: absolute;
      top: 50%;
      left: 50%;
      width: 20px;
      height: 20px;
      background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 10%, transparent 70%);
      transform: translate(-50%, -50%) scale(0);
      pointer-events: none;
    }

    /* Запуск вспышки вместе с анимацией */
    .animate::after {
      animation: sparkle 1s ease-out forwards;
    }

    @keyframes sparkle {
      0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
      }
      50% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0.8;
      }
      100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0; /* Вспышка исчезает */
      }
    }
	


/* Прогресс-бар */
.progress-bar {
  width: 100%;
  height: 20px;
  background-color: #ddd; /* Фон */
  border-radius: 10px;
  overflow: hidden;
  opacity: 0; /* Скрыт до появления */
}

.progress-bar-fill {
  height: 100%;
  background-color: #ffd700; /* Золотой цвет */
  width: 0%; /* Начальная ширина */
}

.progress-bar.animate {
  opacity: 1; /* Становится видимым */
}

.progress-bar.animate .progress-bar-fill {
  animation: fillProgress 1s ease-out forwards; /* Заполнение */
}

/* Анимация заполнения прогресс-бара */
@keyframes fillProgress {
  0% { width: 0%; }
  100% { width: var(--progress-percent, 75%); } /* Используем CSS-переменную */
}
.text-status-container {
	display: flex;
	justify-content: center;
	margin-bottom: 8px;
}
.text-status-container p {
	margin: 0 !important;
}
.text-status-container span {
	position: relative;
	top: 4px;
}

.guest-block {
	position: absolute;
	left: 12px;
	padding: 8px;
	background-color: #0073aa;
	border-radius: 4px;
	color: #fff;
	font-size: 16px;
}
.guest-block span {
	margin-right: 4px;
}
.nav {
	display: flex;
	flex-direction: column;
	position: absolute;
	z-index: 999;
	gap: 16px;
}
.nav a {
	display: block;
	width: 24px;
	height: 24px;
	text-decoration: none;
	padding: 4px;
}
.nav-icon {
	font-size: 28px !important;
}
.nav-icon-list {
	font-size: 32px !important;
	position: relative;
	left: -4px;
}
.under-logo {
	margin-top: 0 !important;
	margin-bottom: 16px !important;
	text-align: center !important;
	color: #666;
	font-size: 16px;
}
.student-avatar {
	text-align: center;
}
.student-avatar img {
	box-shadow: 0 0 20px rgba(0, 128, 255, 0.7), 0 0 20px rgba(0, 128, 255, 0.5);
}
.student-avatar div {
	margin: 0 auto;
}