/* Global Reset and Body Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Navigation Bar */
nav {
    background: #2c3e50;
    color: white;
    padding: 1rem;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

nav a {
    color: white;
    text-decoration: none;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    transition: color 0.3s;
}

nav a:hover {
    color: #3498db;
}

/* Hero Section - UPDATED WITH REDUCED HEIGHT */
.hero {
    height: 60vh; /* Changed from 100vh to 60vh */
    background: linear-gradient(135deg, #3498db, #8e44ad);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding: 2rem;
}

.hero h1 {
    font-size: 3rem;
    font-family: 'Roboto', sans-serif;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.5rem;
    max-width: 600px;
}

/* General Section Styling */
section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

section h2 {
    font-family: 'Roboto', sans-serif;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

/* About Section */
.about {
    background: #f9f9f9;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.profile-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #3498db;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.about p {
    max-width: 800px;
    font-size: 1.1rem;
    text-align: center;
}

/* Projects Section - Simplified */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.project-card i {
    font-size: 2rem;
    color: #3498db;
    margin-bottom: 1rem;
}

.project-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.project-card h3 {
    font-family: 'Roboto', sans-serif;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.project-card p {
    color: #666;
    margin-bottom: 1.5rem;
}

.project-link {
    display: inline-block;
    background: #3498db;
    color: white;
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    font-weight: 500;
    transition: background 0.3s;
}

.project-link:hover {
    background: #2980b9;
}

/* Certifications Section */
#certifications {
    background: #f8f9fa;
}

.certifications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.certification-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    border-left: 4px solid #3498db;
}

.certification-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.cert-icon {
    margin-bottom: 1.5rem;
}

.cert-icon i {
    font-size: 3rem;
    color: #3498db;
}

.certification-card h3 {
    font-family: 'Roboto', sans-serif;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.cert-issuer {
    color: #7f8c8d;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.cert-date {
    color: #95a5a6;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.cert-description {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.cert-verify {
    display: inline-block;
    background: #27ae60;
    color: white;
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.3s;
}

.cert-verify:hover {
    background: #219a52;
}

/* Work Experience Section */
.experience-item {
    background: white;
    border-left: 4px solid #3498db;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.experience-item h3 {
    font-family: 'Roboto', sans-serif;
    margin-bottom: 0.5rem;
}

.experience-item p {
    color: #666;
}

/* Visitor Stats Section - UPDATED WITH REDUCED HEIGHT */
.visitor-stats {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px 20px; /* Changed from 60px to 40px */
    color: white;
    text-align: center;
}

.stats-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 30px; /* Reduced from 40px to 30px */
}

.stat-item {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px; /* Reduced from 30px to 25px */
    min-width: 250px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.stat-item i {
    font-size: 2.5rem; /* Reduced from 3rem to 2.5rem */
    margin-bottom: 12px; /* Reduced from 15px to 12px */
    color: #fff;
    opacity: 0.9;
}

.stat-item h3 {
    margin: 0 0 12px 0; /* Reduced from 15px to 12px */
    font-size: 1.2rem; /* Reduced from 1.3rem to 1.2rem */
    font-weight: 600;
    letter-spacing: 1px;
}

.stat-item p {
    margin: 0;
    font-size: 1rem; /* Reduced from 1.1rem to 1rem */
    opacity: 0.9;
}

.visitor-count {
    font-size: 2.2rem !important; /* Reduced from 2.5rem to 2.2rem */
    font-weight: bold !important;
    color: #fff !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    opacity: 1 !important;
}

.visitor-count.loading {
    opacity: 0.6 !important;
    animation: pulse 1.5s ease-in-out infinite alternate;
}

.visitor-count.error {
    color: #ff6b6b !important;
    font-size: 1rem !important;
}

@keyframes pulse {
    from {
        opacity: 0.6;
    }
    to {
        opacity: 1;
    }
}

/* Footer */
footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem;
}

footer a {
    color: #3498db;
    text-decoration: none;
    margin: 0 1rem;
}

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

footer i {
    font-size: 1.5rem;
}

/* IMPROVED RESPONSIVE DESIGN WITH BETTER BREAKPOINTS */

/* Ultra-wide screens (1400px and up) */
@media (min-width: 1400px) {
    .hero h1 {
        font-size: 4rem;
    }
    
    .hero p {
        font-size: 1.8rem;
    }
    
    section {
        padding: 6rem 2rem;
        max-width: 1400px;
    }
    
    section h2 {
        font-size: 3rem;
    }
    
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem;
    }
    
    .certifications-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem;
    }
}

/* Extra Large screens (1200px to 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
    .hero h1 {
        font-size: 3.5rem;
    }
    
    .hero p {
        font-size: 1.6rem;
    }
    
    section {
        padding: 5rem 2rem;
    }
}

/* Large screens (992px to 1199px) - Desktop */
@media (min-width: 992px) and (max-width: 1199px) {
    .hero h1 {
        font-size: 3rem;
    }
    
    .hero p {
        font-size: 1.5rem;
    }
    
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .certifications-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Medium screens (768px to 991px) - Tablets */
@media (min-width: 768px) and (max-width: 991px) {
    .hero {
        height: 55vh;
        padding: 2rem 1.5rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.3rem;
    }
    
    section {
        padding: 3rem 1.5rem;
    }

    section h2 {
        font-size: 2.2rem;
    }

    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .certifications-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .visitor-stats {
        padding: 35px 15px;
    }
    
    .stats-container {
        gap: 25px;
    }
    
    .stat-item {
        padding: 22px;
        min-width: 200px;
    }
}

/* Small screens (576px to 767px) - Large phones */
@media (min-width: 576px) and (max-width: 767px) {
    nav ul {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
        justify-content: center;
    }
    
    nav a {
        font-size: 0.95rem;
        padding: 0.5rem;
    }

    .hero {
        height: 50vh;
        padding: 1.5rem;
    }

    .hero h1 {
        font-size: 2.2rem;
        margin-bottom: 0.8rem;
    }

    .hero p {
        font-size: 1.2rem;
    }
    
    section {
        padding: 2.5rem 1rem;
    }

    section h2 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }

    .profile-img {
        width: 130px;
        height: 130px;
    }
    
    .about p {
        font-size: 1rem;
    }

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

    .project-card {
        padding: 1.2rem;
    }
    
    .project-card img {
        height: 160px;
    }

    .certifications-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .certification-card {
        padding: 1.5rem;
    }
    
    .visitor-stats {
        padding: 30px 15px;
    }

    .stats-container {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    .stat-item {
        min-width: 250px;
        width: 90%;
        max-width: 300px;
        padding: 20px;
    }
    
    .visitor-count {
        font-size: 1.9rem !important;
    }
    
    .stat-item i {
        font-size: 2.2rem;
    }
}

/* Extra small screens (up to 575px) - Small phones */
@media (max-width: 575px) {
    nav {
        padding: 0.8rem 0.5rem;
    }
    
    nav ul {
        flex-direction: column;
        gap: 0.8rem;
        text-align: center;
    }
    
    nav a {
        font-size: 0.9rem;
        padding: 0.3rem;
    }

    .hero {
        height: 45vh;
        padding: 1rem;
    }
    
    .hero h1 {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
    }

    .hero p {
        font-size: 1.1rem;
        max-width: 90%;
    }
    
    section {
        padding: 2rem 0.8rem;
    }

    section h2 {
        font-size: 1.8rem;
        margin-bottom: 1.2rem;
    }

    .profile-img {
        width: 100px;
        height: 100px;
    }
    
    .about p {
        font-size: 0.95rem;
        max-width: 95%;
    }

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

    .project-card {
        padding: 1rem;
    }
    
    .project-card img {
        height: 140px;
    }
    
    .project-card h3 {
        font-size: 1.1rem;
    }
    
    .project-card p {
        font-size: 0.9rem;
    }

    .certifications-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }
    
    .certification-card {
        padding: 1rem;
    }
    
    .cert-icon i {
        font-size: 2rem;
    }
    
    .certification-card h3 {
        font-size: 1.1rem;
    }
    
    .cert-description {
        font-size: 0.85rem;
    }
    
    .experience-item {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .experience-item h3 {
        font-size: 1.1rem;
    }
    
    .experience-item p {
        font-size: 0.9rem;
    }

    .visitor-stats {
        padding: 25px 10px;
    }
    
    .stats-container {
        gap: 15px;
    }
    
    .stat-item {
        min-width: 200px;
        width: 95%;
        max-width: 280px;
        padding: 15px;
    }
    
    .stat-item i {
        font-size: 1.8rem;
        margin-bottom: 10px;
    }
    
    .stat-item h3 {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    
    .stat-item p {
        font-size: 0.9rem;
    }
    
    .visitor-count {
        font-size: 1.6rem !important;
    }
    
    footer {
        padding: 1.5rem 1rem;
    }
    
    footer a {
        margin: 0 0.5rem;
    }
    
    footer i {
        font-size: 1.2rem;
    }
}