:root {
    --gradient-start: #000f4a;
    --gradient-middle: #073a01;
    --gradient-end: #004b34;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --card-bg: rgba(255, 255, 255, 0.1);
    --nav-bg: rgba(0, 0, 0, 0.8);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-middle), var(--gradient-end));
    min-height: 100vh;
    background-color: black;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    z-index: 1000;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--text-secondary);
}

/* Sections */
section {
    padding: 5rem 0;
}

#hero {
    height: 100vh;
    display: flex;
    align-items: center;
    text-align: center;
}

#hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

/* Skills */
.skill-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-category {
    background: rgba(255, 255, 255, 0.15);
    padding: 1.5rem;
    border-radius: 10px;
    backdrop-filter: blur(5px);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.skill-category h4 {
    margin-bottom: 0.5rem;
}

/* Projects */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    align-items: stretch;
}

.project-card {
    background: rgba(255, 255, 255, 0.15);
    padding: 2rem;
    border-radius: 10px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.project-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border: 1px solid var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s;
    text-align: center;
    width: 100%;
}

.project-link:hover {
    background: var(--text-primary);
    color: var(--gradient-start);
}

/* Social */
.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    justify-items: center;
    max-width: 800px;
    margin: 0 auto;
}

.social-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-primary);
    text-decoration: none;
    transition: transform 0.3s;
}

.social-link:hover {
    transform: translateY(-5px);
}

.social-link i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Books */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.book-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 10px;
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.book-image {
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: 5px;
}

.book-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.book-card:hover .book-image img {
    transform: scale(1.05);
}

.book-card h3 {
    font-size: 1.5rem;
    margin: 0;
}

.book-card p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .book-image {
        height: 300px;
    }
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    background: var(--nav-bg);
}

footer p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    #hero h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
}

/* Hero */
.hero-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.hero-text {
    flex: 1;
    text-align: left;
}

.profile-image {
    flex-shrink: 0;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Hero Responsive */
@media (max-width: 768px) {
    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
    }

    .hero-text {
        text-align: center;
    }

    .profile-image {
        width: 200px;
        height: 200px;
    }
}

/* GitHub Activity */
.github-activity {
    margin-top: 3rem;
    text-align: center;
}

.github-activity h3 {
    margin-bottom: 1.5rem;
}

.github-stats {
    max-width: 100%;
    margin: 1rem 0;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .github-stats {
        width: 100%;
    }
}

/* About section */
#about p {
    font-size: 1.2rem;
    max-width: 1100px;
    margin: 0 auto;
    line-height: 1.8;
    text-align: center;
}

/* Skills */
@media (max-width: 768px) {
    .skill-category, .project-card {
        margin-bottom: 1.5rem;
        background: rgba(255, 255, 255, 0.18);
    }
    
    .skill-category:last-child, .project-card:last-child {
        margin-bottom: 0;
    }
}

.project-image {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    width: 100%;
    flex-grow: 1;
    max-width: 100%;
}

.project-image img {
    width: auto;
    height: auto;
    max-height: 20vh;
    max-width: 100%;
    display: block;
    margin: 0 auto;
    object-fit: contain;
    box-sizing: border-box;
}

.project-links {
    display: flex;
    gap: 1rem;
    margin-top: auto;
}

.project-links .project-link {
    flex: 1;
    text-align: center;
}

/* Дополнительно обеспечим правильное поведение на мобильных устройствах */
@media (max-width: 768px) {
    .project-card {
        padding: 1rem;
        width: 100%;
        overflow: hidden;
    }
    
    .project-image {
        margin: 0.5rem 0;
        max-width: calc(100% + 2rem);
        margin-left: -1rem;
        margin-right: -1rem;
    }
    
    .project-image img {
        max-width: calc(100% - 2rem);
        margin: 0 1rem;
    }
}

#books {
    padding: 5rem 0;
}

#books-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    align-items: stretch;
    max-width: 800px;
    margin: 0 auto;
}

#books-container div {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#books-container img {
    width: 100%;
    height: auto;
    border-radius: 5px;
    margin-bottom: 1rem;
}

#books-container h3 {
    margin-bottom: 0.5rem;
}

#books-container p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

#books-container a {
    display: inline-block;
    margin-top: 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border: 1px solid var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s;
}

#books-container a:hover {
    background: var(--text-primary);
    color: var(--gradient-start);
}

.book-author {
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 1rem;
}

.book-opinion {
    margin-top: 1rem;
    line-height: 1.6;
}

/* Используем существующие стили project-card и project-image */
#books-container .project-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

#books-container .project-image {
    margin: 1rem 0;
    flex-grow: 0;
}
