@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&family=Montserrat:wght@700;800&display=swap');

:root {
    --primary: #f59e0b;
    --primary-hover: #d97706;
    
    /* Light Theme (Default) */
    --bg-dark: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --glass: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.1);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme Variables */
body.dark-theme {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass: rgba(30, 41, 59, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

h1, h2, h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
}

/* Glassmorphism Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    transition: var(--transition);
}

header.scrolled {
    padding: 1rem 5%;
    box-shadow: var(--shadow);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.logo span {
    color: var(--text-main);
    margin-left: 6px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2.5rem;
    align-items: center;
}

nav a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

/* Theme Toggle Button */
#theme-toggle {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
    font-size: 1.2rem;
    margin-left: 20px;
}

#theme-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(245, 158, 11, 0.1);
}

.header-btns {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.hamburger {
    display: none;
}

/* Hero Section */
.hero {
    height: 100vh;
    background: linear-gradient(rgba(15, 23, 42, 0.5), rgba(15, 23, 42, 0.7)), url('img/hero.png');
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 0 10%;
    color: #ffffff; /* Always light text on hero for readability */
}

.hero-content {
    max-width: 800px;
    animation: fadeInUp 1s ease-out;
}

.hero h1 {
    font-size: clamp(2.5rem, 8vw, 5rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero h1 span {
    color: var(--primary);
}

.hero p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2.5rem;
}

.btn {
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(245, 158, 11, 0.3);
}

/* Sections */
section {
    padding: 100px 10%;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.section-title .line {
    width: 80px;
    height: 4px;
    background: var(--primary);
    margin: 0 auto;
}

/* About Grid Styles */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.lead {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.about-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.stat-card {
    background: var(--bg-card);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

.stat-number {
    color: var(--primary);
    font-size: 2.5rem;
    margin-bottom: 5px;
}

.about-image img {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
}

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

.service-img {
    height: 200px;
    overflow: hidden;
}

.service-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.service-card:hover .service-img img {
    transform: scale(1.1);
}

.service-info {
    padding: 30px;
}

.service-info h3 {
    margin-bottom: 15px;
    color: var(--primary);
}

.service-info p {
    color: var(--text-muted);
}

/* Portfolio Page specific styles */
.portfolio-hero {
    background: linear-gradient(rgba(15, 23, 42, 0.8), rgba(15, 23, 42, 0.8)), url('img/hero.png');
    background-size: cover;
    background-position: center;
    padding: 180px 10% 80px;
    text-align: left;
}

.portfolio-hero h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    color: #fff;
    margin-bottom: 20px;
}

.portfolio-hero h1 span {
    color: var(--primary);
}

.portfolio-hero p {
    color: rgba(255, 255, 255, 0.7);
    max-width: 600px;
    font-size: 1.1rem;
}

.filters-section {
    padding: 40px 10% 20px;
    background: var(--bg-dark);
    text-align: center;
}

.gallery-section {
    padding: 40px 10% 100px;
}

/* Gallery & Filters */
.filters {
    margin-bottom: 2rem;
}

.filter-btns {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 20px 0;
}

.btn-filter {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-filter.active, .btn-filter:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(245, 158, 11, 0.05);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.gallery-item {
    position: relative;
    height: 350px;
    border-radius: 8px;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: var(--transition);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay span {
    background: var(--primary);
    color: #ffffff;
    padding: 0.5rem 1rem;
    font-weight: bold;
    border-radius: 4px;
    font-size: 0.8rem;
    text-transform: uppercase;
}

/* Contact Widget */
.contact-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
}

.widget-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.contact-widget.active .widget-menu {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

.widget-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: var(--transition);
    font-size: 1.2rem;
    position: relative;
}

.widget-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    border: 2px solid var(--bg-card);
}

.widget-label {
    position: absolute;
    right: 65px;
    background: var(--bg-card);
    color: var(--text-main);
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 1; /* Always visible when menu is active */
    box-shadow: var(--shadow);
    border: 1px solid var(--glass-border);
    font-weight: 600;
}

.widget-btn:hover {
    transform: scale(1.1);
}

.btn-whatsapp {
    background-color: #25D366;
}

.btn-call {
    background-color: var(--primary);
}

.widget-toggle {
    width: 60px;
    height: 60px;
    background-color: var(--primary);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    animation: pulse 2s infinite;
    transition: var(--transition);
}

.contact-widget.active .widget-toggle {
    transform: rotate(45deg);
    background-color: #ef4444; /* Red for close */
    animation: none;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(245, 158, 11, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

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

.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Contact */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.contact-info h3 {
    font-size: 2rem;
    margin-bottom: 20px;
}

.contact-info p {
    color: var(--text-muted);
}

.contact-desc {
    margin-bottom: 30px;
}

.contact-list {
    list-style: none;
}

.contact-list li {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.contact-list i {
    color: var(--primary);
    font-size: 1.2rem;
    width: 25px;
}

.contact-list a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

.contact-list a:hover {
    color: var(--primary);
}

.footer-phones {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

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

.footer-phones a:hover {
    color: var(--primary-hover);
}

.footer-phones span {
    color: var(--text-muted);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-form input, .contact-form textarea {
    padding: 15px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    color: var(--text-main);
    font-family: inherit;
    box-shadow: var(--shadow);
}

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

footer {
    padding: 50px 10%;
    background: var(--bg-card);
    text-align: center;
    border-top: 1px solid var(--glass-border);
}

@media (max-width: 1024px) {
    section {
        padding: 80px 5%;
    }
    .hero {
        padding: 0 5%;
    }
}

@media (max-width: 768px) {
    header {
        padding: 1rem 5%;
    }

    .hamburger {
        display: block;
        cursor: pointer;
    }

    .hamburger .bar {
        display: block;
        width: 25px;
        height: 3px;
        margin: 5px auto;
        transition: var(--transition);
        background-color: var(--text-main);
    }

    nav {
        position: absolute;
        top: 100%;
        left: -150vw;
        transform: translateX(-50%);
        gap: 0;
        flex-direction: column;
        background-color: var(--bg-card);
        width: 100vw;
        height: 100vh;
        overflow-y: auto;
        text-align: center;
        transition: left 0.3s ease-in-out;
        box-shadow: var(--shadow);
        padding: 1.5rem 5vw;
        border-bottom: 1px solid var(--glass-border);
    }

    nav.active {
        left: 50%;
    }

    /* Блокировка скролла при открытом меню */
    body.no-scroll {
        overflow: hidden;
        height: 100vh;
        width: 100%;
        position: fixed;
    }

    .logo {
        font-size: 1.1rem;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        row-gap: 2px;
    }
    
    .logo span {
        margin-left: 4px;
    }

    nav ul {
        flex-direction: column;
        gap: 1.5rem;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .hero {
        align-items: center;
        text-align: center;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .hero p {
        font-size: 1rem;
    }

    /* Stack grid sections */
    .about-grid, .contact-container {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }

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

    .section-title h2 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.8rem;
    }

    .header-contact-btn {
        display: none;
    }

    .contact-widget {
        bottom: 20px;
        right: 20px;
    }

    .widget-toggle {
        width: 50px;
        height: 50px;
    }

    .footer-phones {
        flex-direction: column;
        gap: 8px;
    }

    .footer-phones span {
        display: none;
    }
}
