/* Improved Loader Styles */
.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--dark-color) 0%, var(--footer-bg) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 300px;
    text-align: center;
    padding: 20px;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
    margin-bottom: 25px;
}

.loader-stages {
    color: white;
    font-size: 1.1rem;
    height: 24px;
    position: relative;
    width: 100%;
    margin-bottom: 20px;
}

.loader-stage {
    position: absolute;
    width: 100%;
    left: 0;
    top: 0;
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.4s ease;
}

.loader-stage.active {
    opacity: 1;
    transform: translateY(0);
}

.progress-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.progress-dot.active {
    background: var(--primary-color);
    transform: scale(1.2);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Content transition */
#content {
    opacity: 0;
    transition: opacity 0.5s ease;
}

#content.show {
    opacity: 1;
}

:root {
    --primary-color: #6e3bff;
    --secondary-color: #c33bff;
    --pink-color: #ff3bdc;
    --dark-color: #2d3748;
    --light-color: #f8f9fa;
    --text-color: #4a5568;
    --text-light: #718096;
    --footer-bg: #1a202c;
    --beginner-color: #ff6b6b;
    --pro-color: #4ecdc4;
    --expert-color: #ffd166;
}

body {
    color: var(--text-color);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Шапка с CSS-градиентом */
.hero-section {
    background: 
        linear-gradient(135deg, 
            rgba(110, 59, 255, 0.9) 0%, 
            rgba(9, 63, 143, 0.85) 50%, 
            rgba(252, 35, 227, 0.8) 100%),
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    color: white;
    padding: 5rem 0 4rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: shine 8s infinite linear;
    opacity: 0.5;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(
        to top, 
        rgba(255, 255, 255, 0.05) 0%, 
        rgba(255, 255, 255, 0) 100%
    );
    pointer-events: none;
    z-index: 1;
}

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

.profile-img {
    width: 160px;
    height: 160px;
    object-fit: cover;
    border: 4px solid rgba(255,255,255,0.3);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    backdrop-filter: blur(5px);
    background: rgba(255,255,255,0.1);
    z-index: 2;
}

/* Стили для навыков */
.skills-category {
    margin-bottom: 2.5rem;
}

.category-title {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
    display: inline-block;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1.2rem;
}

.skill-badge {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 8px;
    padding: 0.6rem 1rem;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    border-left: 3px solid var(--primary-color);
    position: relative;
    overflow: visible;
    z-index: 1;
    padding-bottom: 5px;
}

.skill-badge:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    border-left-color: var(--pink-color);
}

.skill-icon {
    margin-right: 0.7rem;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.skill-name {
    font-weight: 500;
    font-size: 0.9rem;
}

/* Уровни навыков */
.skill-level {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 8px 8px;
    transition: all 0.3s ease;
}

.skill-badge[data-level="1"] .skill-level { width: 10%; background: linear-gradient(90deg, var(--beginner-color), #ffcc00); }
.skill-badge[data-level="2"] .skill-level { width: 20%; background: linear-gradient(90deg, var(--beginner-color), #ffcc00); }
.skill-badge[data-level="3"] .skill-level { width: 30%; background: linear-gradient(90deg, var(--beginner-color), #ffcc00); }
.skill-badge[data-level="4"] .skill-level { width: 40%; background: linear-gradient(90deg, var(--beginner-color), #ffcc00); }
.skill-badge[data-level="5"] .skill-level { width: 50%; background: linear-gradient(90deg, var(--beginner-color), #ffcc00); }
.skill-badge[data-level="6"] .skill-level { width: 60%; background: linear-gradient(90deg, var(--pro-color), #00fa9a); }
.skill-badge[data-level="7"] .skill-level { width: 70%; background: linear-gradient(90deg, var(--pro-color), #00fa9a); }
.skill-badge[data-level="8"] .skill-level { width: 80%; background: linear-gradient(90deg, var(--pro-color), #00fa9a); }
.skill-badge[data-level="9"] .skill-level { width: 90%; background: linear-gradient(90deg, var(--expert-color), #ff00cc); }
.skill-badge[data-level="10"] .skill-level { width: 100%; background: linear-gradient(90deg, var(--expert-color), #ff00cc); }

/* Tooltip для навыков */
.skill-tooltip {
    position: absolute;
    bottom: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background: var(--dark-color);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
    pointer-events: none;
    min-width: 100px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.skill-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: var(--dark-color) transparent transparent transparent;
}

/* Бейджи для уровней */
.skill-badge::after {
    content: '';
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--beginner-color);
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s ease;
    z-index: 11;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.skill-badge[data-level="6"]::after,
.skill-badge[data-level="7"]::after,
.skill-badge[data-level="8"]::after {
    background: var(--pro-color);
    content: 'P';
}

.skill-badge[data-level="9"]::after,
.skill-badge[data-level="10"]::after {
    background: var(--expert-color);
    content: '★';
    font-size: 12px;
}

.skill-badge:hover::after {
    opacity: 1;
    transform: scale(1);
}

.skill-badge:hover .skill-tooltip {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Остальные стили */
.contact-card {
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: none;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    border-top: 3px solid var(--primary-color);
}

.section-title {
    position: relative;
    margin-bottom: 1.8rem;
    padding-bottom: 0.5rem;
    font-size: 2rem;
    color: var(--dark-color);
    font-weight: 700;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse-animation {
    animation: pulse 2s infinite;
}

/* Подвал */
.footer {
    color: rgba(255, 255, 255, 0.9);
    background: linear-gradient(135deg, var(--dark-color) 0%, var(--footer-bg) 100%);
    position: relative;
    overflow: hidden;
    padding: 3rem 0;
}

.footer-title {
    color: white;
    font-weight: 600;
}

.footer a {
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.3s ease;
}

.footer a:hover {
    color: rgb(137, 137, 143);
    text-decoration: underline;
}

.footer .list-unstyled {
    color: rgba(255, 255, 255, 0.7);
}

/* Адаптивность */
@media (min-width: 768px) {
    .hero-section {
        padding: 6rem 0 5rem;
    }
    .profile-img {
        width: 200px;
        height: 200px;
    }
    .skills-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}