/* Root variables for theming */
:root {
    --bg-color: #0d1117;
    --card-bg: #161b22;
    --card-border: #30363d;
    --accent: #00d2ff;
    --accent-glow: rgba(0, 210, 255, 0.3);
    --text-main: #ffffff;
    --text-muted: #8b949e;
    --font-family: 'Inter', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-family);
    line-height: 1.6;
    overflow-x: hidden;
}

a { text-decoration: none; }
ul { list-style: none; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.accent { color: var(--accent); }

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--accent);
    color: #000;
    box-shadow: 0 4px 15px var(--accent-glow);
}
.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(0, 210, 255, 0.5);
    transform: translateY(-2px);
}

.btn-outline {
    border: 1px solid var(--accent);
    color: var(--accent);
}
.btn-outline:hover { background: var(--accent-glow); }

/* Navbar */
.navbar {
    padding: 20px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    background: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--card-border);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-main);
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-links a:not(.btn) {
    color: var(--text-main);
    font-weight: 600;
    transition: color 0.3s;
}
.nav-links a:not(.btn):hover { color: var(--accent); }

/* Dropdown Menu */
.dropdown { position: relative; display: inline-block; }
.dropdown-content {
    display: none;
    position: absolute;
    background-color: #161b22;
    min-width: 220px;
    box-shadow: 0px 8px 20px 0px rgba(0,0,0,0.8);
    z-index: 100;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    top: 100%;
    left: -20px;
    overflow: hidden;
}
.dropdown-content a {
    color: var(--text-main) !important;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 14px;
    font-weight: 500 !important;
    transition: 0.3s ease;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.dropdown-content a:last-child { border-bottom: none; }
.dropdown-content a:hover {
    background-color: rgba(0, 240, 255, 0.1);
    color: var(--accent) !important;
}
.dropdown:hover .dropdown-content { display: block; animation: fadeIn 0.3s ease; }

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-top: 80px;
}

.glow-bg {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    pointer-events: none;
}

.hero-content {
    text-align: center;
    max-width: 800px;
}

.subtitle {
    color: var(--text-muted);
    letter-spacing: 3px;
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.title {
    font-size: 64px;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 30px;
}

.desc {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.badges {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.badge {
    background: #1f2937;
    color: var(--accent);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    border: 1px solid var(--accent);
}

/* Services */
.services { padding: 100px 0; }
.section-title { font-size: 42px; text-align: center; margin-bottom: 10px; }
.section-desc { text-align: center; color: var(--text-muted); margin-bottom: 60px; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 40px 30px;
    border-radius: 12px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border-color: var(--accent);
}

.card .icon { font-size: 40px; margin-bottom: 20px; }
.card h3 { font-size: 20px; margin-bottom: 15px; }
.card p { color: var(--text-muted); font-size: 15px; }

/* Portfolio */
.portfolio { padding: 100px 0; background: #090c10; }
.port-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.proj-card {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
    height: 250px;
    display: block;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.proj-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border-color: var(--accent);
}

.proj-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, opacity 0.3s ease;
}

.proj-card:hover .proj-img { transform: scale(1.05); opacity: 0.3; }

.proj-placeholder {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}

.proj-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
    text-align: center;
}

.proj-card:hover .proj-overlay { opacity: 1; }
.proj-name {
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.proj-link { color: var(--accent); font-size: 14px; font-weight: 600; }

/* Animations */
.fade {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade.on { opacity: 1; transform: translateY(0); }

/* Footer / Contact */
.footer { padding: 100px 0 30px; border-top: 1px solid var(--card-border); }
.footer-content {
    display: flex;
    justify-content: space-between;
    gap: 50px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.footer-info, .footer-form { flex: 1; min-width: 300px; }
.footer-info p { color: var(--text-muted); margin: 20px 0; }
.email-link { color: var(--accent); font-size: 18px; font-weight: bold; }

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.contact-form input, .contact-form textarea {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 15px;
    border-radius: 6px;
    color: white;
    font-family: inherit;
}

.contact-form input:focus, .contact-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.footer-bottom {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    padding-top: 30px;
    border-top: 1px solid var(--card-border);
}

/* Responsive Mobile Menu */
.menu-toggle {
    display: none;
    font-size: 32px;
    color: var(--accent);
    cursor: pointer;
    user-select: none;
    line-height: 1;
}

@media (max-width: 768px) {
    .title { font-size: 42px; }
    
    /* Показываем гамбургер */
    .menu-toggle {
        display: block;
        z-index: 101;
    }

    /* Стили для выезжающего меню */
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(13, 17, 23, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        align-items: center;
        padding: 30px 0;
        gap: 25px;
        border-bottom: 1px solid var(--card-border);
        border-top: 1px solid var(--card-border);
        
        opacity: 0;
        visibility: hidden;
        transform: translateY(-20px);
        transition: all 0.3s ease;
        z-index: 100;
    }

    .nav-links.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .dropdown-content {
        position: static;
        min-width: 100%;
        background: transparent;
        box-shadow: none;
        border: none;
        text-align: center;
        margin-top: 10px;
    }
    
    .dropdown:hover .dropdown-content { display: block; }
    .badges { flex-direction: column; align-items: center; }
}

@media (max-width: 480px) {
    /* Make chat widget responsive on very small screens */
    #tg-chat-widget {
        bottom: 10px;
        right: 10px;
        left: auto;
        z-index: 9999;
    }
    #tg-chat-box {
        width: calc(100vw - 20px) !important;
        height: 400px !important;
        max-width: 380px;
    }
}

/* Telegram Chat Widget */
#tg-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: inherit;
}
#tg-chat-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent);
    color: #111;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}
#tg-chat-btn:hover { transform: scale(1.1); }
#tg-chat-box {
    width: 320px;
    height: 420px;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    overflow: hidden;
}
.tg-chat-header {
    background: var(--accent);
    color: #111;
    padding: 15px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.tg-chat-header button {
    background: none;
    border: none;
    color: #111;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}
.tg-chat-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #121212;
}
.tg-msg {
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    max-width: 80%;
    word-wrap: break-word;
}
.tg-bot {
    background: #2a2a2a;
    color: #eee;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.tg-user {
    background: var(--accent);
    color: #111;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.tg-chat-footer {
    display: flex;
    padding: 10px;
    background: #1e1e1e;
    border-top: 1px solid #333;
}
#tg-chat-input {
    flex: 1;
    background: #121212;
    border: 1px solid #333;
    border-radius: 20px;
    padding: 10px 15px;
    color: #eee;
    font-size: 14px;
    outline: none;
}
#tg-chat-input:focus { border-color: var(--accent); }
#tg-chat-send {
    background: var(--accent);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-left: 8px;
    color: #111;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
