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

:root {
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a6a;
    --text-muted: #8888a0;
    --accent: #6c5ce7;
    --accent-light: #a29bfe;
    --accent-dark: #5a4bd1;
    --accent-glow: rgba(108,92,231,0.15);
    --gradient-1: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 50%, #74b9ff 100%);
    --gradient-2: linear-gradient(135deg, #fd79a8 0%, #fdcb6e 100%);
    --gradient-3: linear-gradient(135deg, #00cec9 0%, #6c5ce7 100%);
    --border: #e8e8f0;
    --shadow: 0 4px 20px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.1);
    --radius: 16px;
    --nav-bg: rgba(255,255,255,0.85);
    --hero-overlay: rgba(255,255,255,0.9);
}

[data-theme="dark"] {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --text-primary: #e8e8f0;
    --text-secondary: #b8b8d0;
    --text-muted: #6868a0;
    --accent: #a29bfe;
    --accent-light: #c8c4ff;
    --accent-dark: #6c5ce7;
    --accent-glow: rgba(162,155,254,0.2);
    --border: #2a2a4a;
    --shadow: 0 4px 20px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.4);
    --nav-bg: rgba(15,15,26,0.9);
    --hero-overlay: rgba(15,15,26,0.9);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    transition: all 0.3s ease;
    overflow-x: hidden;
}

h1,h2,h3,h4,h5,h6 { font-family: 'Space Grotesk', sans-serif; font-weight: 700; }

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

/* ===== NAVBAR ===== */
.navbar {
    position: fixed; top: 0; width: 100%; z-index: 1000;
    background: var(--nav-bg); backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
}
.navbar .container {
    display: flex; align-items: center; justify-content: space-between;
    padding: 15px 20px;
}
.nav-logo {
    font-family: 'Space Grotesk', sans-serif; font-size: 1.5rem; font-weight: 700;
    background: var(--gradient-1); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    text-decoration: none;
}
.nav-links { display: flex; gap: 8px; list-style: none; align-items: center; }
.nav-links a {
    text-decoration: none; color: var(--text-secondary); padding: 8px 16px;
    border-radius: 8px; font-size: 0.9rem; font-weight: 500;
    transition: all 0.3s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); background: var(--accent-glow); }
.theme-toggle {
    background: var(--bg-card); border: 1px solid var(--border);
    width: 40px; height: 40px; border-radius: 10px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; transition: all 0.3s ease; color: var(--text-primary);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.hamburger {
    display: none; flex-direction: column; gap: 5px; cursor: pointer;
    background: none; border: none; padding: 5px;
}
.hamburger span {
    width: 25px; height: 2px; background: var(--text-primary);
    transition: all 0.3s ease; border-radius: 2px;
}

/* ===== HERO ===== */
.hero {
    min-height: 100vh; display: flex; align-items: center;
    padding-top: 80px; position: relative; overflow: hidden;
}
.hero::before {
    content: ''; position: absolute; top: -50%; right: -30%;
    width: 800px; height: 800px; border-radius: 50%;
    background: var(--gradient-1); opacity: 0.08; filter: blur(80px);
    animation: float 8s ease-in-out infinite;
}
.hero::after {
    content: ''; position: absolute; bottom: -30%; left: -20%;
    width: 600px; height: 600px; border-radius: 50%;
    background: var(--gradient-2); opacity: 0.06; filter: blur(60px);
    animation: float 10s ease-in-out infinite reverse;
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-30px); } }
.hero-content { position: relative; z-index: 2; max-width: 700px; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--accent-glow); color: var(--accent);
    padding: 8px 20px; border-radius: 50px; font-size: 0.85rem; font-weight: 600;
    margin-bottom: 24px; border: 1px solid rgba(108,92,231,0.2);
    animation: fadeInUp 0.8s ease;
}
.hero-badge::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem); line-height: 1.1;
    margin-bottom: 20px; animation: fadeInUp 0.8s ease 0.2s both;
}
.hero h1 .gradient-text {
    background: var(--gradient-1); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p {
    font-size: 1.15rem; color: var(--text-secondary); margin-bottom: 36px;
    max-width: 500px; animation: fadeInUp 0.8s ease 0.4s both;
}
.hero-buttons { display: flex; gap: 16px; animation: fadeInUp 0.8s ease 0.6s both; flex-wrap: wrap; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

/* ===== BUTTONS ===== */
.btn {
    padding: 14px 32px; border-radius: 12px; font-weight: 600; font-size: 0.95rem;
    text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
    transition: all 0.3s ease; cursor: pointer; border: none;
}
.btn-primary {
    background: var(--gradient-1); color: #fff;
    box-shadow: 0 4px 15px rgba(108,92,231,0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(108,92,231,0.4); }
.btn-outline {
    background: transparent; color: var(--text-primary);
    border: 2px solid var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* ===== SECTIONS ===== */
.section { padding: 100px 0; }
.section-header { text-align: center; margin-bottom: 60px; }
.section-header h2 { font-size: 2.5rem; margin-bottom: 16px; }
.section-header p { color: var(--text-secondary); font-size: 1.1rem; max-width: 600px; margin: 0 auto; }
.section-label {
    display: inline-block; background: var(--accent-glow); color: var(--accent);
    padding: 6px 16px; border-radius: 50px; font-size: 0.8rem; font-weight: 600;
    letter-spacing: 1px; text-transform: uppercase; margin-bottom: 12px;
}

/* ===== SERVICES ===== */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.service-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 36px 28px; transition: all 0.4s ease; position: relative; overflow: hidden;
}
.service-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: var(--gradient-1); transform: scaleX(0); transition: transform 0.4s ease;
    transform-origin: left;
}
.service-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }
.service-card:hover::before { transform: scaleX(1); }
.service-icon {
    width: 56px; height: 56px; border-radius: 14px; background: var(--accent-glow);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; color: var(--accent); margin-bottom: 20px;
}
.service-card h3 { font-size: 1.2rem; margin-bottom: 10px; }
.service-card p { color: var(--text-secondary); font-size: 0.95rem; }

/* ===== SKILLS ===== */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.skill-item {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
    padding: 20px 24px; transition: all 0.3s ease;
}
.skill-item:hover { border-color: var(--accent); }
.skill-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.skill-header span:first-child { font-weight: 600; }
.skill-header span:last-child { color: var(--accent); font-weight: 600; font-size: 0.9rem; }
.skill-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.skill-fill {
    height: 100%; background: var(--gradient-1); border-radius: 3px;
    transition: width 1.5s ease; width: 0;
}
.skill-fill.animate { width: var(--level); }

/* ===== PROJECTS ===== */
.project-tabs { display: flex; gap: 12px; justify-content: center; margin-bottom: 40px; flex-wrap: wrap; }
.project-tab {
    padding: 10px 24px; border-radius: 10px; border: 1px solid var(--border);
    background: var(--bg-card); cursor: pointer; font-weight: 500;
    transition: all 0.3s ease; color: var(--text-secondary);
}
.project-tab.active, .project-tab:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 28px; }
.project-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; transition: all 0.4s ease;
}
.project-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }
.project-image {
    width: 100%; height: 220px; object-fit: cover;
    background: var(--gradient-1); display: flex; align-items: center;
    justify-content: center; color: #fff; font-size: 3rem;
}
.project-image img { width: 100%; height: 100%; object-fit: cover; }
.project-info { padding: 24px; }
.project-info h3 { font-size: 1.2rem; margin-bottom: 8px; }
.project-info p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 12px; }
.project-meta { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.project-meta span {
    font-size: 0.8rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px;
}
.project-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.project-tag {
    padding: 4px 12px; border-radius: 6px; font-size: 0.75rem; font-weight: 500;
    background: var(--accent-glow); color: var(--accent);
}
.project-status {
    display: inline-block; padding: 4px 12px; border-radius: 6px;
    font-size: 0.75rem; font-weight: 600; margin-bottom: 8px;
}
.status-completed { background: rgba(0,206,201,0.15); color: #00cec9; }
.status-running { background: rgba(253,203,110,0.15); color: #e17055; }

/* ===== REVIEWS ===== */
.reviews-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.review-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 32px; transition: all 0.3s ease;
}
.review-card:hover { border-color: var(--accent); }
.review-stars { color: #fdcb6e; font-size: 0.9rem; margin-bottom: 16px; }
.review-text { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.8; margin-bottom: 20px; font-style: italic; }
.review-author { display: flex; align-items: center; gap: 12px; }
.review-avatar {
    width: 48px; height: 48px; border-radius: 50%; background: var(--gradient-1);
    display: flex; align-items: center; justify-content: center; color: #fff;
    font-weight: 700; font-size: 1.1rem; overflow: hidden;
}
.review-avatar img { width: 100%; height: 100%; object-fit: cover; }
.review-author-info h4 { font-size: 0.95rem; }
.review-author-info p { font-size: 0.8rem; color: var(--text-muted); }

/* ===== COMPANIES ===== */
.companies-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 24px; }
.company-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 28px; text-align: center; transition: all 0.3s ease;
}
.company-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.company-logo {
    width: 80px; height: 80px; margin: 0 auto 16px; border-radius: 16px;
    background: var(--accent-glow); display: flex; align-items: center;
    justify-content: center; overflow: hidden;
}
.company-logo img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.company-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.company-card p { font-size: 0.85rem; color: var(--text-secondary); }

/* ===== CONTACT ===== */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.contact-info-list { display: flex; flex-direction: column; gap: 20px; }
.contact-item {
    display: flex; align-items: center; gap: 16px; padding: 20px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 12px; transition: all 0.3s ease;
}
.contact-item:hover { border-color: var(--accent); }
.contact-icon {
    width: 48px; height: 48px; border-radius: 12px; background: var(--accent-glow);
    display: flex; align-items: center; justify-content: center;
    color: var(--accent); font-size: 1.1rem; flex-shrink: 0;
}
.contact-item h4 { font-size: 0.95rem; margin-bottom: 2px; }
.contact-item p { font-size: 0.85rem; color: var(--text-secondary); }

.contact-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-weight: 500; font-size: 0.9rem; }
.form-group input, .form-group textarea {
    padding: 14px 18px; border-radius: 12px; border: 1px solid var(--border);
    background: var(--bg-card); color: var(--text-primary); font-family: 'Inter', sans-serif;
    font-size: 0.95rem; transition: all 0.3s ease; outline: none;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-group textarea { min-height: 120px; resize: vertical; }

/* ===== FOOTER ===== */
.footer {
    background: var(--bg-secondary); border-top: 1px solid var(--border);
    padding: 40px 0; text-align: center;
}
.footer p { color: var(--text-muted); font-size: 0.9rem; }

/* ===== LIVE CHAT ===== */
.chat-widget {
    position: fixed; bottom: 24px; right: 24px; z-index: 9999;
}
.chat-toggle {
    width: 60px; height: 60px; border-radius: 50%;
    background: var(--gradient-1); border: none; color: #fff;
    font-size: 1.5rem; cursor: pointer; box-shadow: 0 4px 20px rgba(108,92,231,0.4);
    transition: all 0.3s ease; display: flex; align-items: center; justify-content: center;
}
.chat-toggle:hover { transform: scale(1.1); }
.chat-box {
    position: absolute; bottom: 70px; right: 0; width: 350px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 16px; box-shadow: var(--shadow-lg);
    display: none; overflow: hidden; animation: slideUp 0.3s ease;
}
.chat-box.active { display: block; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.chat-header {
    background: var(--gradient-1); color: #fff; padding: 16px 20px;
    display: flex; justify-content: space-between; align-items: center;
}
.chat-header h4 { font-size: 1rem; }
.chat-close { background: none; border: none; color: #fff; font-size: 1.2rem; cursor: pointer; }
.chat-messages {
    height: 300px; overflow-y: auto; padding: 16px;
    display: flex; flex-direction: column; gap: 10px;
}
.chat-msg {
    max-width: 80%; padding: 10px 14px; border-radius: 12px;
    font-size: 0.85rem; line-height: 1.5;
}
.chat-msg.visitor { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.admin { align-self: flex-start; background: var(--bg-secondary); border-bottom-left-radius: 4px; }
.chat-input-area { display: flex; padding: 12px; border-top: 1px solid var(--border); gap: 8px; }
.chat-input-area input {
    flex: 1; padding: 10px 14px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--bg-primary);
    color: var(--text-primary); outline: none; font-size: 0.85rem;
}
.chat-input-area button {
    padding: 10px 16px; border-radius: 10px; background: var(--accent);
    color: #fff; border: none; cursor: pointer; font-weight: 600;
}
.chat-pre-form { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.chat-pre-form input {
    padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border);
    background: var(--bg-primary); color: var(--text-primary); outline: none; font-size: 0.85rem;
}
.chat-pre-form button {
    padding: 10px; border-radius: 10px; background: var(--gradient-1);
    color: #fff; border: none; cursor: pointer; font-weight: 600;
}

/* ===== SCROLL ANIMATIONS ===== */
.reveal { opacity: 0; transform: translateY(40px); transition: all 0.8s ease; }
.reveal.active { opacity: 1; transform: translateY(0); }
.reveal-left { opacity: 0; transform: translateX(-40px); transition: all 0.8s ease; }
.reveal-left.active { opacity: 1; transform: translateX(0); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .nav-links { 
        display: none; position: absolute; top: 100%; left: 0; right: 0;
        background: var(--nav-bg); backdrop-filter: blur(20px);
        flex-direction: column; padding: 20px; border-bottom: 1px solid var(--border);
    }
    .nav-links.active { display: flex; }
    .hamburger { display: flex; }
    .hero h1 { font-size: 2.5rem; }
    .contact-grid { grid-template-columns: 1fr; }
    .projects-grid { grid-template-columns: 1fr; }
    .chat-box { width: 300px; right: -10px; }
    .hero-buttons { flex-direction: column; }
    .btn { text-align: center; justify-content: center; }
}

@media (max-width: 480px) {
    .section { padding: 60px 0; }
    .section-header h2 { font-size: 1.8rem; }
    .services-grid { grid-template-columns: 1fr; }
    .skills-grid { grid-template-columns: 1fr; }
    .reviews-grid { grid-template-columns: 1fr; }
    .companies-grid { grid-template-columns: 1fr; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; }

/* ===== ABOUT SECTION ===== */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.about-image { position: relative; }
.about-image img { width: 100%; border-radius: var(--radius); }
.about-image-placeholder {
    width: 100%; aspect-ratio: 1; border-radius: var(--radius);
    background: var(--gradient-1); display: flex; align-items: center;
    justify-content: center; color: #fff; font-size: 4rem;
}
.about-text h3 { font-size: 1.8rem; margin-bottom: 16px; }
.about-text p { color: var(--text-secondary); margin-bottom: 20px; }
@media (max-width: 768px) {
    .about-grid { grid-template-columns: 1fr; gap: 30px; }
}

/* ===== ALERT/TOAST ===== */
.toast {
    position: fixed; top: 20px; right: 20px; padding: 14px 24px;
    background: var(--accent); color: #fff; border-radius: 12px;
    font-size: 0.9rem; font-weight: 500; z-index: 99999;
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s both;
}
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-20px); } }
.toast.error { background: #e74c3c; }
.toast.success { background: #00cec9; }
