/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Root Variables for Responsive Sizing */
:root {
    --section-padding: 5rem 0;
    --heading-size-large: 2.5rem;
    --heading-size-medium: 2rem;
    --heading-size-small: 1.8rem;
    --text-size-large: 1.2rem;
    --text-size-normal: 1rem;
    --text-size-small: 0.9rem;
}

/* Navigation */
.navbar {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo a {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover {
    color: #3498db;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background: #333;
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    display: flex;
    align-items: center;
    min-height: 100vh;
    padding: 100px 20px 50px;
    max-width: 1200px;
    margin: 0 auto;
    gap: 3rem;
}

.hero-content {
    flex: 1;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.highlight {
    color: #3498db;
}

.hero-description {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #666;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-image {
    flex: 1;
    text-align: center;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: transparent;
    color: #3498db;
    border: 2px solid #3498db;
}

.btn-secondary:hover {
    background: #3498db;
    color: white;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-outline {
    background: transparent;
    color: #333;
    border: 2px solid #333;
}

/* Sections */
section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #2c3e50;
}

/* About Section */
.about {
    background: #f8f9fa;
}

.about-content {
    text-align: center;
}

.about-text p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: #666;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.stat {
    text-align: center;
}

.stat h3 {
    font-size: 2rem;
    color: #3498db;
    margin-bottom: 0.5rem;
}

/* Skills Section */
.skills {
    padding: 5rem 0;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.skill-card:hover {
    transform: translateY(-5px);
}

.skill-card i {
    font-size: 3rem;
    color: #3498db;
    margin-bottom: 1rem;
}

.skill-card h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.skill-card p {
    color: #666;
    line-height: 1.6;
}

/* Projects Section */
.projects {
    background: #f8f9fa;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.project-card:hover {
    transform: translateY(-5px);
}

.project-image {
    padding: 2rem;
    text-align: center;
    background: #f8f9fa;
}

.project-image i {
    font-size: 3rem;
    color: #3498db;
}

.project-content {
    padding: 2rem;
}

.project-content h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.project-content p {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.project-tech span {
    background: #e9ecef;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
}

.project-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Contact Section */
.contact {
    padding: 5rem 0;
}

.contact-description {
    text-align: center;
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    align-items: start;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.contact-item i {
    font-size: 1.5rem;
    color: #3498db;
}

.contact-item h4 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.contact-item p {
    color: #666;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 5px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    padding: 2rem 0;
    text-align: center;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    color: white;
    font-size: 1.5rem;
    transition: color 0.3s;
}

.social-links a:hover {
    color: #3498db;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
/* Tablet and Smaller Desktops */
@media screen and (max-width: 1024px) {
    :root {
        --heading-size-large: 2.2rem;
        --heading-size-medium: 1.8rem;
    }
    
    .hero {
        padding: 120px 40px 60px;
        gap: 2rem;
    }
    
    .section-title {
        font-size: var(--heading-size-medium);
        margin-bottom: 2.5rem;
    }
    
    .skills-grid,
    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

/* Tablets and Large Phones */
@media screen and (max-width: 768px) {
    :root {
        --section-padding: 4rem 0;
        --heading-size-large: 2rem;
        --heading-size-medium: 1.6rem;
        --text-size-large: 1.1rem;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: white;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0,0,0,0.05);
        padding: 2rem 0;
        height: calc(100vh - 70px);
        overflow-y: auto;
        z-index: 1000;
    }
    
    .nav-menu.active {
        left: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .hero {
        flex-direction: column-reverse;
        text-align: center;
        padding: 100px 30px 40px;
        gap: 3rem;
    }
    
    .hero-title {
        font-size: var(--heading-size-large);
    }
    
    .hero-description {
        font-size: var(--text-size-normal);
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-image {
        max-width: 300px;
        margin: 0 auto;
    }
    
    .section-title {
        font-size: var(--heading-size-medium);
    }

    .about-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .project-links {
        flex-direction: column;
    }

    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    section {
        padding: var(--section-padding);
    }
    
    .btn {
        padding: 10px 20px;
    }
}

/* Phones */
@media screen and (max-width: 480px) {
    :root {
        --section-padding: 3rem 0;
        --heading-size-large: 1.8rem;
        --heading-size-medium: 1.5rem;
        --heading-size-small: 1.3rem;
        --text-size-normal: 0.95rem;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .hero {
        padding: 100px 15px 30px;
        gap: 2rem;
    }
    
    .hero-title {
        font-size: var(--heading-size-large);
    }
    
    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .hero-buttons .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .section-title {
        font-size: var(--heading-size-medium);
        margin-bottom: 2rem;
    }
    
    .skill-card, 
    .project-card {
        padding: 1.5rem;
    }
    
    .about-stats {
        grid-template-columns: 1fr;
    }
    
    .stat h3 {
        font-size: 1.8rem;
    }
    
    .project-links {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .project-links .btn {
        width: 100%;
        text-align: center;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 10px;
    }
}

/* Extra Small Devices */
@media screen and (max-width: 320px) {
    .nav-container {
        padding: 0 10px;
    }
    
    .hero-title {
        font-size: 1.6rem;
    }
    
    .section-title {
        font-size: 1.4rem;
    }
}

/* Landscape Mode Fixes */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding-top: 120px;
    }
    
    .nav-menu.active {
        max-height: 80vh;
        overflow-y: auto;
    }
}

/* High Resolution Screens */
@media screen and (min-width: 1400px) {
    .container, 
    .hero,
    .nav-container {
        max-width: 1320px;
    }
    
    :root {
        --heading-size-large: 3rem;
        --heading-size-medium: 2.8rem;
        --text-size-large: 1.3rem;
    }
}

/* Object Detection Page Styles */
@media screen and (max-width: 768px) {
    .detection-container {
        margin: 80px 20px 30px;
        padding: 15px;
    }
    
    .upload-area {
        padding: 20px;
    }
    
    .upload-area i {
        font-size: 36px !important;
    }
    
    .back-btn {
        position: relative;
        top: auto;
        left: auto;
        display: inline-block;
        margin-bottom: 20px;
    }
    
    .detected-objects {
        grid-template-columns: 1fr;
    }
    
    .result-canvas {
        max-width: 100%;
        height: auto;
    }
}

@media screen and (max-width: 480px) {
    .upload-area {
        padding: 15px;
    }
    
    .upload-btn {
        width: 100%;
        margin: 10px 0;
    }
    
    .object-tag {
        font-size: 12px;
        padding: 6px 10px;
    }
}