/* Modern Minimalist Design */
:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --text-light: #ffffff;
    --text-dark: #1f2937;
    --bg-light: #f8fafc;
    --bg-dark: #0f172a;
    --card-bg-light: #ffffff;
    --card-bg-dark: #1e293b;
    --border-light: #e5e7eb;
    --border-dark: #334155;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
    transition: all 0.3s ease;
}

body.dark-theme {
    color: var(--text-light);
    background-color: var(--bg-dark);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
    z-index: 1000;
    transition: all 0.3s ease;
}

.dark-theme .navbar {
    background: rgba(15, 23, 42, 0.95);
    border-bottom-color: var(--border-dark);
}

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

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-brand:hover {
    color: var(--secondary-color);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.dark-theme .nav-link {
    color: var(--text-light);
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.theme-toggle {
    background: none;
    border: 2px solid var(--border-light);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-dark);
}

.dark-theme .theme-toggle {
    border-color: var(--border-dark);
    color: var(--text-light);
}

.theme-toggle:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: scale(1.05);
}

.register {
    background: var(--primary-color);
    color: white !important;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.register:hover {
    background: var(--secondary-color);
    color: white !important;
    transform: translateY(-1px);
}

.logout {
    color: #ef4444 !important;
}

.logout:hover {
    color: #dc2626 !important;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 2rem 2rem;
}

/* Hero Section */
.hero-section {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    align-items: center;
    margin-bottom: 4rem;
    padding: 3rem 0;
}

@media (max-width: 768px) {
    .hero-section {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
}

.hero-image {
    position: relative;
}

.hero-image img {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary-color);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

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

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content p {
    font-size: 1.2rem;
    color: #6b7280;
    line-height: 1.7;
}

.dark-theme .hero-content p {
    color: #9ca3af;
}

/* Section Headers */
.section-header {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-dark);
}

.dark-theme .section-header {
    color: var(--text-light);
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.project-card {
    background: var(--card-bg-light);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.dark-theme .project-card {
    background: var(--card-bg-dark);
    border-color: var(--border-dark);
}

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

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.project-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.dark-theme .project-title {
    color: var(--text-light);
}

.project-description {
    color: #6b7280;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.dark-theme .project-description {
    color: #9ca3af;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tech-badge {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.project-link:hover {
    color: var(--secondary-color);
    transform: translateX(5px);
}

/* Comments Section */
.comments-section {
    margin-top: 4rem;
}

.comment-form {
    background: var(--card-bg-light);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    margin-top: 3rem;
    margin-bottom: 2rem;
}

.dark-theme .comment-form {
    background: var(--card-bg-dark);
    border-color: var(--border-dark);
}

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

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.dark-theme .form-label {
    color: var(--text-light);
}

.form-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: var(--card-bg-light);
    color: var(--text-dark);
}

.dark-theme .form-input {
    background: var(--card-bg-dark);
    border-color: var(--border-dark);
    color: var(--text-light);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Comments List */
.comments-list {
    display: grid;
    gap: 1.5rem;
}

.comment-card {
    background: var(--card-bg-light);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.dark-theme .comment-card {
    background: var(--card-bg-dark);
    border-color: var(--border-dark);
}

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

.comment-content {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--text-dark);
}

.dark-theme .comment-content {
    color: var(--text-light);
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: #6b7280;
}

.dark-theme .comment-meta {
    color: #9ca3af;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--card-bg-light);
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.dark-theme .empty-state {
    background: var(--card-bg-dark);
    border-color: var(--border-dark);
}

.empty-icon {
    font-size: 4rem;
    color: #d1d5db;
    margin-bottom: 1.5rem;
}

.dark-theme .empty-icon {
    color: #4b5563;
}

.empty-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.dark-theme .empty-title {
    color: var(--text-light);
}

.empty-description {
    color: #6b7280;
    margin-bottom: 2rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.dark-theme .empty-description {
    color: #9ca3af;
}

/* Auth Required Message */
.auth-required-message {
    text-align: center;
    padding: 2rem;
    background: var(--card-bg-light);
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.dark-theme .auth-required-message {
    background: var(--card-bg-dark);
    border-color: var(--border-dark);
}

.auth-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.auth-required-message h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.dark-theme .auth-required-message h4 {
    color: var(--text-light);
}

.auth-required-message p {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.dark-theme .auth-required-message p {
    color: #9ca3af;
}

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

.btn-secondary {
    background: var(--card-bg-light);
    color: var(--text-dark);
    border: 2px solid var(--border-light);
}

.dark-theme .btn-secondary {
    background: var(--card-bg-dark);
    color: var(--text-light);
    border-color: var(--border-dark);
}

.btn-secondary:hover {
    background: var(--border-light);
    border-color: var(--primary-color);
}

.dark-theme .btn-secondary:hover {
    background: var(--border-dark);
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.dark-theme .alert-success {
    background: #064e3b;
    color: #a7f3d0;
    border-color: #065f46;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.dark-theme .alert-error {
    background: #7f1d1d;
    color: #fca5a5;
    border-color: #991b1b;
}

.alert-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.alert-close:hover {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 1rem;
    }

    .nav-menu {
        gap: 1rem;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .main-content {
        padding: 90px 1rem 2rem;
    }

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

    .project-card {
        padding: 1.5rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

.dark-theme ::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

.dark-theme ::-webkit-scrollbar-thumb {
    background: var(--border-dark);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Authentication Pages */
.auth-container {
    min-height: calc(100vh - 70px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.dark-theme .auth-container {
    background: linear-gradient(135deg, #1e293b, #0f172a);
}

.auth-card {
    background: var(--card-bg-light);
    border-radius: 20px;
    padding: 3rem 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-light);
    width: 100%;
    max-width: 420px;
    position: relative;
    overflow: hidden;
}

.dark-theme .auth-card {
    background: var(--card-bg-dark);
    border-color: var(--border-dark);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.dark-theme .auth-header h1 {
    color: var(--text-light);
}

.auth-header p {
    color: #6b7280;
    font-size: 1rem;
}

.dark-theme .auth-header p {
    color: #9ca3af;
}

.auth-form {
    margin-bottom: 2rem;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.auth-divider {
    position: relative;
    text-align: center;
    margin: 2rem 0;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-light);
}

.dark-theme .auth-divider::before {
    background: var(--border-dark);
}

.auth-divider span {
    background: var(--card-bg-light);
    padding: 0 1rem;
    font-size: 0.875rem;
    color: #6b7280;
    position: relative;
    z-index: 1;
}

.dark-theme .auth-divider span {
    background: var(--card-bg-dark);
    color: #9ca3af;
}

.auth-providers {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.provider-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    border: 2px solid var(--border-light);
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    background: var(--card-bg-light);
    color: var(--text-dark);
}

.dark-theme .provider-btn {
    background: var(--card-bg-dark);
    border-color: var(--border-dark);
    color: var(--text-light);
}

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

.yandex-btn {
    border-color: #ff0000;
    color: #ff0000;
}

.yandex-btn:hover {
    background: #ff0000;
    color: white;
}

.telegram-btn {
    border-color: #0088cc;
    color: #0088cc;
}

.telegram-btn:hover {
    background: #0088cc;
    color: white;
}

/* Telegram Widget Button Styling */
.telegram-login-widget,
.widget_button,
.telegram-login-widget iframe,
.telegram-login-widget div,
.telegram-login-widget button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.75rem !important;
    padding: 0.875rem 1.5rem !important;
    border: 2px solid #0088cc !important;
    border-radius: 12px !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    background: var(--card-bg-light) !important;
    color: #0088cc !important;
    width: 100% !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 1rem !important;
    cursor: pointer !important;
    min-height: 48px !important;
}

.dark-theme .telegram-login-widget,
.dark-theme .widget_button,
.dark-theme .telegram-login-widget iframe,
.dark-theme .telegram-login-widget div,
.dark-theme .telegram-login-widget button {
    background: var(--card-bg-dark) !important;
    border-color: #0088cc !important;
    color: #0088cc !important;
}

.telegram-login-widget:hover,
.widget_button:hover,
.telegram-login-widget iframe:hover,
.telegram-login-widget div:hover,
.telegram-login-widget button:hover {
    transform: translateY(-2px) !important;
    box-shadow: var(--shadow) !important;
    background: #0088cc !important;
    color: white !important;
}

.auth-footer {
    text-align: center;
}

.auth-footer p {
    color: #6b7280;
    font-size: 0.875rem;
}

.dark-theme .auth-footer p {
    color: #9ca3af;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Telegram Widget */
.telegram-widget-container {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

/* Page Headers */
.page-header {
    text-align: center;
    margin-bottom: 4rem;
    padding: 2rem 0;
}

.page-header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-dark);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dark-theme .page-header h1 {
    color: var(--text-light);
}

.page-header p {
    font-size: 1.2rem;
    color: #6b7280;
    max-width: 600px;
    margin: 0 auto;
}

.dark-theme .page-header p {
    color: #9ca3af;
}

/* Contacts Section */
.contacts-section {
    padding: 2rem 0;
}

.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.contact-card {
    background: var(--card-bg-light);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.dark-theme .contact-card {
    background: var(--card-bg-dark);
    border-color: var(--border-dark);
}

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

.contact-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.contact-card:hover::before {
    transform: scaleX(1);
}

.contact-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
}

.contact-card:hover .contact-icon {
    transform: scale(1.1);
}

.contact-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.dark-theme .contact-content h3 {
    color: var(--text-light);
}

.contact-content p {
    color: #6b7280;
    font-size: 1rem;
}

.dark-theme .contact-content p {
    color: #9ca3af;
}
