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

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 2rem 0 2.75rem 0;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
    flex: 1;
    min-width: 220px;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
}

.logo-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 0;
    margin-top: 0;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: transform 0.2s;
}

.logo-link:hover {
    transform: scale(1.05);
}

.logo {
    flex-shrink: 0;
    transition: transform 0.2s;
}

.logo:hover {
    transform: rotate(5deg);
}

header h1 {
    font-size: 2.5rem;
    margin: 0;
    padding: 0;
    font-weight: 700;
    line-height: 1.2;
}

.header-links {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    padding-top: 0;
    margin-top: 0;
}

.telegram-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 500;
}

.telegram-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.telegram-link svg {
    flex-shrink: 0;
}

.email-link-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 0.9rem;
}

.email-link-header:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.email-link-header svg {
    flex-shrink: 0;
}

.github-link-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 0.9rem;
}

.github-link-header:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.github-link-header svg {
    flex-shrink: 0;
}

.developer-info {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 20px;
    margin-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.developer-contact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.separator {
    opacity: 0.6;
    font-weight: 300;
}

.email-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.email-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.developer-info a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.developer-info a:hover {
    opacity: 1;
    text-decoration: underline;
}

.tech-stack {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
}

.stack-label {
    font-weight: 600;
    opacity: 0.95;
}

.stack-items {
    opacity: 0.85;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

.back-link {
    color: white;
    text-decoration: none;
    display: inline-block;
    margin-top: 1rem;
    margin-bottom: 0;
    opacity: 0.9;
    transition: opacity 0.2s;
    font-size: 0.95rem;
}

.back-link:hover {
    opacity: 1;
}

main {
    flex: 1;
    padding: 2rem 0;
    margin-top: 0;
}

main:has(.project-detail) {
    padding-top: 2.5rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.project-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.project-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

.project-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.project-description {
    color: var(--text-light);
    margin-bottom: 1rem;
    flex: 1;
}

.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-light);
}

.views-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.views-item svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.project-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.project-date {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.project-date .date-label {
    font-weight: 600;
    color: var(--text-color);
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-test {
    background-color: #fef3c7;
    color: #92400e;
}

.status-dev {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-mvp {
    background-color: #d1fae5;
    color: #065f46;
}

.status-idea {
    background-color: #f3e8ff;
    color: #6b21a8;
}

.voting-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.vote-buttons {
    display: flex;
    gap: 0.5rem;
}

.vote-btn {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.vote-btn:hover {
    border-color: var(--primary-color);
    background-color: var(--bg-color);
}

.vote-btn.upvote.active {
    border-color: var(--success-color);
    background-color: #d1fae5;
    color: var(--success-color);
}

.vote-btn.downvote.active {
    border-color: var(--danger-color);
    background-color: #fee2e2;
    color: var(--danger-color);
}

.rating {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    min-width: 40px;
    text-align: center;
}

.rating.positive {
    color: var(--success-color);
}

.rating.negative {
    color: var(--danger-color);
}

.views-count {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-left: auto;
}

.views-count svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.project-detail {
    max-width: 900px;
    margin: 0 auto;
    padding-top: 1rem;
}

.detail-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.detail-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.detail-content {
    padding: 2rem;
}

.detail-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.detail-description {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.detail-description h1,
.detail-description h2,
.detail-description h3 {
    color: var(--text-color);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.detail-description h1 {
    font-size: 2rem;
}

.detail-description h2 {
    font-size: 1.75rem;
}

.detail-description h3 {
    font-size: 1.5rem;
}

.detail-description p {
    margin-bottom: 1rem;
}

.detail-description ul,
.detail-description ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.detail-description li {
    margin-bottom: 0.5rem;
}

.detail-description a {
    color: var(--primary-color);
    text-decoration: none;
}

.detail-description a:hover {
    text-decoration: underline;
}

.detail-description img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

.detail-description strong {
    font-weight: 600;
    color: var(--text-color);
}

.detail-description em {
    font-style: italic;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    color: var(--text-light);
}

.detail-meta-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

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

.info-card {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.info-card.full-width {
    grid-column: 1 / -1;
}

.info-icon {
    font-size: 2rem;
    line-height: 1;
}

.info-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stack-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.stack-tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--text-color);
    font-weight: 500;
}

.rating-details {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    align-items: center;
}

.upvotes-count,
.downvotes-count {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    background: var(--card-bg);
}

.upvotes-count {
    color: var(--success-color);
}

.downvotes-count {
    color: var(--danger-color);
}

.info-card .info-content .rating {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0.25rem 0;
    display: block;
    text-align: left;
}

.info-card .info-content .info-label {
    margin-bottom: 0.5rem;
}

.detail-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

@media (min-width: 768px) {
    .detail-actions {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 500px) {
    .detail-actions {
        grid-template-columns: 1fr;
    }
    
    .detail-actions .vote-btn,
    .service-link {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }
}

.detail-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: 8px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-label {
    font-size: 0.875rem;
    color: var(--text-light);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 1.1rem;
    color: var(--text-color);
    font-weight: 500;
}

.detail-actions .vote-btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-voting .rating {
    font-size: 2rem;
}

.service-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: var(--shadow);
    font-size: 1rem;
    border: none;
    cursor: pointer;
    width: 100%;
}

.service-link:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.service-link.disabled {
    background: var(--bg-color);
    color: var(--text-light);
    cursor: not-allowed;
    opacity: 0.6;
    pointer-events: none;
}

.service-link.disabled:hover {
    background: var(--bg-color);
    transform: none;
    box-shadow: var(--shadow);
}

.detail-todos {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.detail-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.todos-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s;
}

.todo-item:hover {
    box-shadow: var(--shadow);
}

.todo-item.completed {
    opacity: 0.7;
    background: var(--bg-color);
}

.todo-checkbox {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.todo-text {
    flex: 1;
    color: var(--text-color);
    font-size: 0.95rem;
}

.todo-item.completed .todo-text {
    text-decoration: line-through;
    color: var(--text-light);
}

.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.error {
    text-align: center;
    padding: 3rem;
    color: var(--danger-color);
}

footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 3rem;
    text-align: center;
    color: var(--text-light);
}

.global-nav {
    padding: 1.75rem 0;
    background: transparent;
}

.global-nav .container {
    display: flex;
    justify-content: center;
}

.global-nav-buttons {
    display: inline-flex;
    gap: 1.1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.global-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.9rem;
    border-radius: 999px;
    border: 2px solid var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    color: var(--primary-color);
    background: white;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

.global-nav-link:hover {
    background: rgba(37, 99, 235, 0.18);
    transform: translateY(-1px);
}

.global-nav-link.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-lg);
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.75rem;
    margin: 2.5rem 0 3.5rem;
}

.article-card {
    background: var(--card-bg);
    border-radius: 18px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(226, 232, 240, 0.6);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.article-card-link {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 1.75rem;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.article-card-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-color);
}

.article-card-meta {
    font-size: 0.85rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.article-views {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    text-transform: none;
    letter-spacing: normal;
}

.article-views svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.article-card-excerpt {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
    flex: 1;
}

.article-card-footer {
    margin-top: auto;
    display: flex;
    justify-content: flex-end;
}

.article-read-more {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
}
.article-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.15);
    color: var(--primary-color);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}
.article-tag-secondary {
    background: rgba(59, 130, 246, 0.08);
    color: var(--primary-color);
}

.article-detail {
    margin: 2.5rem auto 4rem;
    max-width: 860px;
}

.article-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.back-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.back-link:hover {
    text-decoration: underline;
}

.article-detail-title {
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 1.75rem;
    color: var(--text-color);
}

.article-detail-date {
    font-size: 0.95rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.article-detail-date .article-views {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.article-detail-date .article-views svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.article-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}

.article-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.article-detail-content {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2.25rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(226, 232, 240, 0.6);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.article-detail-content p {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--text-color);
}

.article-detail-content p + p {
    margin-top: 0.5rem;
}

.article-detail-content ul,
.article-detail-content ol {
    padding-left: 1.5rem;
    color: var(--text-color);
}

.article-detail-content a {
    color: var(--primary-color);
    text-decoration: underline;
}

.article-detail-footer {
    margin-top: 2rem;
    display: flex;
    justify-content: flex-end;
}

.article-telegram-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

.article-telegram-link:hover {
    text-decoration: underline;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 1.75rem;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-left,
    .header-right {
        width: 100%;
    }

    .header-right {
        align-items: flex-start;
    }

    .header-links {
        width: 100%;
        align-items: flex-start;
    }

    .global-nav {
        padding: 1.25rem 0 2.25rem;
    }

    .global-nav-buttons {
        width: 100%;
        justify-content: center;
        gap: 0.75rem;
    }

    .global-nav-link {
        flex: 1 1 140px;
        justify-content: center;
    }

    .developer-info {
        font-size: 0.8rem;
    }

    .developer-contact {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .separator {
        display: none;
    }

    .tech-stack {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .stack-items {
        font-size: 0.8rem;
    }

    .detail-title {
        font-size: 2rem;
    }

    .detail-image {
        height: 250px;
    }

    .detail-info {
        grid-template-columns: 1fr;
    }

    .detail-info-grid {
        grid-template-columns: 1fr;
    }

    .detail-header {
        flex-direction: column;
    }

    .article-detail-title {
        font-size: 2rem;
    }

    .article-detail-content {
        padding: 1.75rem;
    }

    .article-detail {
        margin: 2rem auto 3rem;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }
}

