/* Page header styles */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 3rem 0;
}

/* Только заголовок страницы (не шапка сайта!) */
.page-header .header-content {
    text-align: center;
}

@media (min-width: 768px) {
    .page-header .header-content {
        text-align: left;
    }
}

.page-header .header-content h1 {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--gray-900);
    margin-bottom: 1rem;
    background: linear-gradient(to right, var(--gray-900), var(--primary-dark));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

@media (min-width: 768px) {
    .page-header .header-content h1 {
        font-size: 3rem;
    }
}

.page-header .header-content p {
    font-size: 1.125rem;
    color: var(--gray-600);
    font-weight: 500;
    line-height: 1.5;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--gray-300);
    border-radius: 0.75rem;
    font-weight: 600;
    color: var(--gray-800);
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.back-button:hover {
    transform: scale(1.05);
    border-color: var(--primary);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Projects grid styles */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.project-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    will-change: transform, opacity;
    animation: fadeIn 0.5s ease forwards;
    margin-top: 0 !important;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.project-image-container {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: #f5f7fa;
    border-bottom: 1px solid #e5e7eb;
}

.project-image-container .project-image-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.project-image-container .project-image-first {
    z-index: 1;
}

.project-image-container img,
.project-image-container .image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.project-image {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    cursor: pointer;
}

.project-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    z-index: 1;
}

.project-image:hover::before {
    background: rgba(0, 0, 0, 0.2);
}

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

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

.project-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.project-info h3 {
    margin: 0 0 1rem;
    color: var(--gray-900);
    font-size: 1.25rem;
}

.project-info p {
    color: var(--gray-600);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.project-category {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    border-radius: 20px;
    font-size: 0.875rem;
    margin-top: auto;
    align-self: flex-start;
}

/* Анимации карточек — общие правила в css/animations.css (.animate-fadeIn по появлению в зоне видимости) */

/* Адаптивность */
@media (max-width: 767px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
        padding: 1rem;
    }

    .project-image {
        height: 200px;
    }

    .project-info {
        padding: 1rem;
    }
}

/* Стили для загрузки изображений */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-200);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--error);
    padding: 1rem;
    text-align: center;
}

.error-message i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.error-message span {
    font-size: 0.875rem;
}

/* Улучшенные стили для placeholder */
.image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    transition: opacity 0.3s ease;
}

/* Стили для изображений */
.lazy-image {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lazy-image.loaded {
    opacity: 1;
}

/* Стили для модального окна */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-image {
    max-width: 100%;
    max-height: calc(90vh - 4rem);
    object-fit: contain;
}

.close-modal {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-600);
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: var(--gray-900);
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Контактная секция */
.contact-section {
    background: var(--gray-100);
    padding: 4rem 0;
    text-align: center;
    margin-top: 2rem;
}

.contact-section h2 {
    color: var(--gray-900);
    margin-bottom: 1rem;
}

.contact-section p {
    color: var(--gray-600);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

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

.primary-button,
.secondary-button {
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.primary-button {
    background: var(--primary);
    color: white;
}

.primary-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.secondary-button {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.secondary-button:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* Responsive styles */
@media (max-width: 767px) {
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .loading-spinner {
        width: 30px;
        height: 30px;
        border-width: 3px;
    }
} 