:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
    --font-family: 'Segoe UI', sans-serif;
}

body {
    font-family: var(--font-family);
    margin: 0;
    line-height: 1.6;
    background-color: var(--light-color);
    color: var(--dark-color);
    scroll-behavior: smooth; /* Bo'limlarga silliq o'tish */
}

/* ============================================== */
/* Global stil va reset */
/* ============================================== */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}
a:hover { color: darken(var(--primary-color), 10%); }
ul { list-style: none; padding: 0; margin: 0; }
h1, h2, h3 { margin-top: 0; margin-bottom: 10px; }
p { margin-bottom: 10px; }
.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}
.btn:hover {
    background-color: darken(var(--primary-color), 10%);
    transform: translateY(-2px);
}

/* ============================================== */
/* Header va Navigatsiya (Animations) */
/* ============================================== */
.main-header {
    background: linear-gradient(135deg, var(--primary-color), #6a11cb);
    color: white;
    padding: 20px 0;
    text-align: center;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden; /* Animatsiyalar uchun */
}
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 80%;
    max-width: 1200px;
    margin: 0 auto;
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    animation: fadeInDown 0.8s ease-out forwards;
}
.logo {
    font-size: 1.8em;
    font-weight: bold;
}
.nav-links {
    display: flex;
}
.nav-links li {
    margin-left: 20px;
}
.nav-links a {
    color: white;
    font-weight: bold;
    transition: color 0.3s ease;
}
.nav-links a:hover {
    color: var(--light-color);
}

.hero-section {
    margin-top: 50px;
}
.hero-section h1 {
    font-size: 3.5em;
    margin-bottom: 15px;
}
.hero-section p {
    font-size: 1.5em;
    margin-bottom: 30px;
}

/* Header elementlari uchun kirish animatsiyalari */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.fade-in-up {
    opacity: 0; /* Boshlang'ich holatda yashirin */
    animation: fadeInUp 0.8s ease-out forwards;
}
.fade-in-up.delay-1 { animation-delay: 0.3s; }
.fade-in-up.delay-2 { animation-delay: 0.6s; }

/* ============================================== */
/* Asosiy bo'limlar */
/* ============================================== */
.section {
    padding: 60px 20px;
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}
.section:nth-child(even) { /* Juft bo'limlar uchun orqa fon */
    background-color: var(--light-color);
}
h2 {
    font-size: 2.5em;
    margin-bottom: 40px;
    color: var(--dark-color);
    position: relative;
    display: inline-block;
}
h2::after { /* Sarlavha ostidagi chiziq */
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
    margin: 10px auto 0;
    border-radius: 2px;
}

/* ============================================== */
/* Men haqimda (About) */
/* ============================================== */
.about-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}
.profile-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--primary-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}
.about-content p {
    font-size: 1.1em;
    max-width: 700px;
}

/* ============================================== */
/* Malakalar (Skills) (Animation) */
/* ============================================== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
}
.skill-item {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    text-align: left;
}
.skill-item h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}
.progress-bar-container {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}
.progress-bar {
    height: 15px;
    background-color: var(--primary-color);
    width: 0%; /* Boshlang'ich holat */
    border-radius: 5px;
    animation: fillProgressBar 1.5s ease-out forwards; /* Animatsiya */
}

/* Skill bar animatsiyasi */
@keyframes fillProgressBar {
    from { width: 0%; }
    to { width: var(--skill-level); } /* JS orqali o'rnatiladi */
}

.html-css-skill { --skill-level: 95%; animation-delay: 0.2s; }
.js-skill { --skill-level: 85%; animation-delay: 0.4s; }
.react-vue-skill { --skill-level: 75%; animation-delay: 0.6s; }
.ui-ux-skill { --skill-level: 90%; animation-delay: 0.8s; }

/* ============================================== */
/* Portfoliyo (Transitions) */
/* ============================================== */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}
.portfolio-item {
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Hover uchun silliq o'tish */
}
.portfolio-item:hover {
    transform: translateY(-5px) scale(1.02); /* Biroz ko'tarish va kattalashish */
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}
.portfolio-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.portfolio-item h3 {
    margin: 15px 20px 5px;
    color: var(--primary-color);
}
.portfolio-item p {
    margin: 0 20px 15px;
    font-size: 0.95em;
    color: var(--secondary-color);
}

/* ============================================== */
/* Aloqa (Contact) (Transitions) */
/* ============================================== */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 600px;
    margin: 30px auto 0;
    text-align: left;
}
.contact-form input,
.contact-form textarea {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    width: 100%;
    box-sizing: border-box; /* Padding bilan birga hisoblash */
    transition: border-color 0.3s ease, box-shadow 0.3s ease; /* Focus uchun silliq o'tish */
}
.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 8px rgba(var(--primary-color-rgb), 0.2);
    outline: none;
}
.contact-form button {
    align-self: flex-start; /* Tugmani chapga surish */
}

/* ============================================== */
/* Footer */
/* ============================================== */
footer {
    background-color: var(--dark-color);
    color: var(--light-color);
    text-align: center;
    padding: 25px 0;
    font-size: 0.9em;
}

/* ============================================== */
/* Scroll-to-top tugmasi (Transitions) */
/* ============================================== */
#scrollToTopBtn {
    display: none; /* Boshlang'ich holatda yashirin */
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99;
    border: none;
    outline: none;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    padding: 15px;
    border-radius: 50%;
    font-size: 1.2em;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: background-color 0.3s ease, opacity 0.3s ease, transform 0.3s ease; /* Silliq ko'rinish */
}
#scrollToTopBtn:hover {
    background-color: darken(var(--primary-color), 10%);
    transform: scale(1.1);
}