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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

/* Шапка сайта */
header {
    
    background-color: #942222;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: 200px;
    font-size: 1.5rem;
    font-weight: bold;
}

.logo img{
    margin-right: 20px;
    width: 50px;
    height: 50px;
}

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

nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s;
}

nav a:hover,
nav a.active {
    background-color: #898787;
}

/* Основной контент */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Главная страница - Hero секция */
.hero {
    background: white;
    padding: 3rem 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.hero-content {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.photo-container {
    flex-shrink: 0;
}

.photo-placeholder {
    width: 200px;
    height: 200px;
    border: 3px solid #2c3e50;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #7f8c8d;
    border-radius: 10px;
    background-color: #ecf0f1;
}

.intro h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.intro p {
    margin-bottom: 0.5rem;
    color: #555;
}

.btn-download {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.7rem 1.5rem;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.btn-download:hover {
    background-color: #2980b9;
}

/* Навыки */
.skills {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.skills h2,
.best-projects h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
    font-size: 1.8rem;
}

.skills-container {
    max-width: 800px;
    margin: 0 auto;
}

.skill-item,
.course-item {
    margin-bottom: 1.5rem;
}

.skill-header,
.course-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 25px;
    background-color: #ecf0f1;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    transition: width 0.3s ease;
}

/* Лучшие проекты */
.best-projects {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem 2rem;
}


.project-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 2px solid #e0e0e0;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.project-placeholder {
    width: 100%;
    height: 150px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    border-radius: 5px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.project-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* чтобы картинка заполняла контейнер без искажений */
    border-radius: 5px;
    display: block;
}

.project-card h3 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.project-card p {
    color: #7f8c8d;
}

/* Страница проектов */
.page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.7rem 1.5rem;
    border: 2px solid #3498db;
    background: white;
    color: #3498db;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
}

.filter-btn:hover,
.filter-btn.active {
    background: #3498db;
    color: white;
}

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

.project-card-detailed {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.project-card-detailed:hover {
    transform: translateY(-5px);
}

.project-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.project-placeholder-large {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    text-align: center;
    padding: 1rem;
}

.project-info {
    padding: 1.5rem;
}

.project-info h3 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.project-info p {
    color: #555;
    margin-bottom: 1rem;
}

.project-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.tag {
    background: #ecf0f1;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    color: #555;
}

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

.btn-link {
    padding: 0.5rem 1rem;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.btn-link:hover {
    background: #2980b9;
}

/* Страница дневника */
.diary-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.diary-entries {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.diary-entry {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #ecf0f1;
}

.diary-entry:last-child {
    border-bottom: none;
}

.entry-date {
    font-size: 1.2rem;
    font-weight: bold;
    color: #3498db;
    min-width: 80px;
}

.entry-content h3 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.entry-content p {
    color: #555;
    margin-bottom: 0.5rem;
}

.entry-status {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.entry-status.completed {
    background: #d4edda;
    color: #155724;
}

.entry-status.in-progress {
    background: #fff3cd;
    color: #856404;
}

.entry-status.planned {
    background: #d1ecf1;
    color: #0c5460;
}

.current-courses {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.current-courses h2 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
    font-size: 1.5rem;
}

.add-entry {
    grid-column: 1 / -1;
    text-align: center;
    margin-top: 1rem;
}

.btn-add {
    padding: 0.8rem 2rem;
    background: #2ecc71;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-add:hover {
    background: #27ae60;
}

/* Страница контактов */
.contacts-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.contact-form-container,
.contact-info {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.contact-form-container h2,
.contact-info h2 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #ecf0f1;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.form-group input.error,
.form-group textarea.error {
    border-color: #e74c3c;
}

.error-message {
    display: block;
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

.btn-submit {
    width: 100%;
    padding: 1rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-submit:hover {
    background: #2980b9;
}

.success-message {
    padding: 1rem;
    background: #d4edda;
    color: #155724;
    border-radius: 5px;
    margin-top: 1rem;
    text-align: center;
}

.contact-items {
    margin-bottom: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.8rem;
    background: #f8f9fa;
    border-radius: 5px;
}

.contact-item .icon {
    font-size: 1.5rem;
}

.contact-item a {
    color: #3498db;
    text-decoration: none;
}

.contact-item a:hover {
    text-decoration: underline;
}

.social-links h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.social-icons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-link {
    padding: 0.7rem 1.5rem;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s;
}

.social-link:hover {
    background: #2980b9;
}

/* Подвал */
footer {
    background: #942222;
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

/* Адаптивность */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
    }
    
    nav ul {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .hero-content {
        flex-direction: column;
        text-align: center;
    }
    
    .projects-grid,
    .projects-grid-large {
        grid-template-columns: 1fr;
    }
    
    .diary-section,
    .contacts-section {
        grid-template-columns: 1fr;
    }
    
    .filter-buttons {
        flex-direction: column;
        align-items: center;
    }
    .logo{
        display: flex;
        justify-content: center;
        align-items: center;
        margin-left: 0;
    }
    .logoH{
        margin-right: 0;
        display: none;
    } 
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    
}

}

.index_img{
    height: 195px;
    width:195px;
    border-radius: 9px;
}

.project-placeholder img{
    height: 150px;
    width: 300px;
}



@media (min-width: 500px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

.project-card {
    max-width: 100%;
    box-sizing: border-box;
}

.project-placeholder img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    border-radius: 5px;
}








@media(max-width: 400px){
    .project-card{
        width: 100%;
        max-width: 100%;
    }
    .project-placeholder img{
        width: 100%;
        max-width: 100%;
    }
    .main,
    .header{
        padding:10px
    }
}
