:root {
    --bg-color: #0f0c15;
    --card-bg: #1a1625;
    --primary: #8b5cf6; /* Фиолетовый */
    --primary-hover: #7c3aed;
    --text-main: #ffffff;
    --text-sec: #a1a1aa;
    --accent: #d946ef; /* Розовый неон */
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    
    /* Магия для прижатия футера */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    flex: 1; /* Это растягивает блок, толкая футер вниз */
    width: 100%;
}

/* Header */
.header {
    background: rgba(15, 12, 21, 0.9);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
}

.dot { color: var(--primary); }

.nav a {
    color: var(--text-sec);
    text-decoration: none;
    margin-left: 20px;
    transition: 0.3s;
    font-weight: 600;
}

.nav a:hover, .nav a.active {
    color: var(--primary);
}

.btn-login, .btn-logout {
    border: 1px solid var(--primary);
    padding: 5px 15px;
    border-radius: 5px;
    color: var(--primary) !important;
}

.btn-login:hover {
    background: var(--primary);
    color: white !important;
}

/* Hero */
.hero {
    text-align: center;
    padding: 80px 0;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.highlight {
    color: var(--primary);
    text-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
}

.contacts {
    margin-top: 30px;
}

.contact-link {
    color: var(--accent);
    text-decoration: none;
    margin: 0 15px;
    font-size: 1.2rem;
    border-bottom: 1px dashed var(--accent);
}

/* Showcase & Cards */
.showcase {
    margin: 60px 0;
}

.showcase h2 {
    margin-bottom: 20px;
    border-left: 4px solid var(--primary);
    padding-left: 15px;
}

.horizontal-scroll {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding-bottom: 20px;
    scroll-snap-type: x mandatory;
}

.card {
    min-width: 300px;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    scroll-snap-align: start;
    border: 1px solid rgba(255,255,255,0.05);
    transition: transform 0.3s;
    position: relative;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.card img {
    width: 100%;
    height: 256px; /* Фиксируй высоту */
    width: 256px; /* Фиксируй высоту */
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

.badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.btn-more {
    display: inline-block;
    margin-top: 15px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-sec);
    border-top: 1px solid rgba(255,255,255,0.05);
    /* margin-top убери, если был, он не нужен при флексе */
    margin-top: auto; /* На всякий случай, хотя flex:1 у main уже работает */
}

/* Адаптив */
@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .header-content { flex-direction: column; height: auto; padding: 10px 0; }
    .nav { margin-top: 10px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
    .nav a { margin: 0; }
}


/* --- Стили для списков и фильтров --- */
.list-header {
    margin-bottom: 40px;
}
.tags-filter {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.filter-label {
    color: var(--text-sec);
    margin-right: 10px;
}
.tag-chip {
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary);
    padding: 5px 12px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: 0.2s;
    border: 1px solid transparent;
}
.tag-chip:hover, .tag-chip.active {
    background: var(--primary);
    color: white;
}
.reset-filter {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    margin-left: auto;
}
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

/* Фиксируем высоту карточки, чтобы они были как на витрине */
.grid-card {
    height: 450px; /* Фиксированная высота */
    display: flex;
    flex-direction: column;
    position: relative; /* Для абсолютной ссылки */
    overflow: hidden;
}

.grid-card img {
    height: 200px; /* Фиксируем высоту картинки */
    width: 100%;
    object-fit: cover;
}

.card-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Делаем всю карточку ссылкой */
.card-link-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
}

/* Скрываем старую кнопку "Подробнее", так как теперь вся карта кликабельна */
.btn-more {
    display: none; 
}

/* --- 7. Убираем бейдж типа проекта --- */
.type-badge {
    display: none;
}
.tags-mini {
    margin: 10px 0;
}
.mini-tag {
    font-size: 0.8rem;
    color: var(--text-sec);
    margin-right: 10px;
}

/* --- Детальная страница --- */
.detail-header {
    margin-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 20px;
}
.type-badge, .achievement-badge {
    background: var(--card-bg);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-right: 10px;
    border: 1px solid var(--primary);
}
.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}
.text-block {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #d1d5db;
}
.alert-box {
    background: rgba(217, 70, 239, 0.1);
    border-left: 4px solid var(--accent);
    padding: 20px;
    margin-top: 20px;
    color: #f0abfc;
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}
.gallery-grid img {
    width: 100%;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
}
.sidebar-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    position: sticky;
    top: 100px;
}
.sidebar-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
    margin: 0 auto 20px;
    display: block;
}
.full-width {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 10px;
    text-decoration: none;
    font-weight: 600;
}
.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-secondary {
    background: transparent;
    border: 1px solid var(--text-sec);
    color: var(--text-sec);
}
.back-link {
    display: inline-block;
    margin-top: 40px;
    color: var(--text-sec);
    text-decoration: none;
}

/* --- Команда --- */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Чуть шире */
    gap: 40px; /* Большие отступы */
    margin-top: 40px;
    padding-bottom: 60px;
}

.team-card {
    text-align: center;
    padding: 30px 20px;
    background: var(--card-bg);
    border-radius: 16px;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid rgba(255,255,255,0.05); /* Дефолтная рамка */
}

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


/* Стиль для Руководителя (Lead/Admin) - "Пиздатая рамка" */
.team-card.leader-style {
    border: 2px solid var(--primary);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
    background: linear-gradient(145deg, #1a1625, #231d33);
}

.team-card.leader-style .role-badge {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 10px var(--primary);
}

/* Стиль для Разработчика - более сдержанный */
.team-card.dev-style {
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.team-card.dev-style .role-badge {
    border: 1px solid var(--text-sec);
    color: var(--text-sec);
}

.avatar-wrapper {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--primary);
}
.avatar-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.avatar-placeholder {
    width: 100%;
    height: 100%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: bold;
    color: white;
}
.role-badge {
    display: inline-block;
    background: rgba(255,255,255,0.1);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    margin-bottom: 15px;
}
.stats {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* --- Лента и Принципы --- */
.principles-list {
    list-style: none;
    counter-reset: principle-counter;
    max-width: 800px;
    margin: 40px auto;
}
.principle-item {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
}
.principle-item .number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    opacity: 0.5;
}
.news-feed {
    max-width: 800px;
    margin: 40px auto;
}
.news-post {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid rgba(255,255,255,0.05);
}
.news-post header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: var(--text-sec);
}
.login-container {
    max-width: 400px;
    margin: 100px auto;
    background: var(--card-bg);
    padding: 40px;
    border-radius: 12px;
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-sec);
}
.form-group input {
    width: 100%;
    padding: 10px;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: white;
}
.error-msg {
    color: #ef4444;
    margin-bottom: 20px;
    text-align: center;
}

/* Адаптив для детали */
@media (max-width: 768px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
    .sidebar-card {
        position: static;
        order: -1; /* Сайдбар наверх на мобилках */
        margin-bottom: 30px;
    }
}

.project-link-icon {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--accent);
    text-decoration: none;
    margin-bottom: 10px;
    font-weight: bold;
}
.project-link-icon:hover {
    text-decoration: underline;
}

.zoomable-img {
    cursor: zoom-in;
    transition: transform 0.2s;
}
.zoomable-img:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
}
.modal-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
}
.close-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}


.budget-dashboard {
    margin-bottom: 40px;
    display: flex;
    justify-content: center;
}
.budget-card {
    background: linear-gradient(135deg, #1a1625, #2d2442);
    border: 1px solid var(--primary);
    padding: 20px 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
}
.budget-label {
    display: block;
    color: var(--text-sec);
    font-size: 0.9rem;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.budget-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: #4ade80; /* Зеленый цвет денег */
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.3);
}

.print-item {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 1rem;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}
.print-item:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--glass-border);
}
.print-item.completed {
    animation: fadeOut 0.3s ease forwards;
}
@keyframes fadeOut {
    to { opacity: 0; transform: translateX(20px); }
}