/* ===== VARIABLES ===== */
:root {
    --primary-color: #2d46b9;
    --secondary-color: #1e3799;
    --accent-color: #4a69bd;
    --text-color: #333;
    --light-text: #f4f4f4;
    --dark-bg: #222;
    --light-bg: #f9f9f9;
    --gray-bg: #f1f1f1;
    --border-color: #ddd;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: var(--text-color);
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

section {
    padding: 100px 0;
}

/* ===== PRELOADER ===== */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
   color: #091054;
    background: linear-gradient(135deg, var(--border-color),var(--border-color), var(--gray-bg), var(--accent-color));
    background-size: 400% 400%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s ease;
    animation: backgroundPulse 8s ease infinite;
}

.preloader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.preloader-logo {
    margin-bottom: 20px;
    animation: logoReveal 1.5s ease forwards;
    opacity: 0;
}

.preloader-logo h1 {
    font-size: 42px;
    font-weight: 700;
    color: var(--primary-color);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.preloader-logo span {
    color: var(--accent-color);
    position: relative;
}

.preloader-logo span::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.3);
    z-index: -1;
}

.preloader-text {
    color: var(--secondary-color);
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 30px;
    opacity: 0;
    animation: textReveal 1s ease 0.5s forwards;
}

.loader-container {
    position: relative;
    width: 200px;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.loader-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 10px;
    animation: progressAnimation 2.5s ease-in-out forwards;
}

.loader-percentage {
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    animation: textReveal 1s ease 0.8s forwards;
}

.preloader-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: particleFloat 3s linear infinite;
}

.particle:nth-child(1) {
    top: 20%;
    left: 20%;
    width: 15px;
    height: 15px;
    animation-duration: 8s;
}

.particle:nth-child(2) {
    top: 60%;
    left: 80%;
    width: 12px;
    height: 12px;
    animation-duration: 10s;
    animation-delay: 1s;
}

.particle:nth-child(3) {
    top: 40%;
    left: 40%;
    width: 8px;
    height: 8px;
    animation-duration: 6s;
    animation-delay: 2s;
}

.particle:nth-child(4) {
    top: 80%;
    left: 10%;
    width: 10px;
    height: 10px;
    animation-duration: 9s;
    animation-delay: 1.5s;
}

.particle:nth-child(5) {
    top: 10%;
    left: 60%;
    width: 6px;
    height: 6px;
    animation-duration: 7s;
    animation-delay: 0.5s;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
}

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

.primary-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.secondary-btn {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.secondary-btn:hover {
    background-color: var(--primary-color);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

/* ===== HEADER ===== */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: transparent;
    z-index: 1000;
    transition: var(--transition);
    padding: 20px 0;
}

header.scrolled {
    background-color: #fff;
    box-shadow: var(--shadow);
    padding: 15px 0;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
}

.logo span {
    color: var(--accent-color);
}

nav ul {
    display: flex;
}

nav ul li {
    margin-left: 30px;
}

nav ul li a {
    font-weight: 500;
    position: relative;
    padding: 5px 0;
}

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

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

nav ul li a:hover::after,
nav ul li a.active::after {
    width: 100%;
}

.hamburger-menu {
    display: none;
    cursor: pointer;
}

.close-menu {
    display: none;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 5px 0;
    transition: var(--transition);
    position: relative;
}

.bar::before,
.bar::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    transition: var(--transition);
}

.bar::before {
    transform: translateY(-8px);
}

.bar::after {
    transform: translateY(8px);
}

.hamburger-menu.active .bar {
    background-color: transparent;
}

.hamburger-menu.active .bar::before {
    transform: rotate(45deg);
}

.hamburger-menu.active .bar::after {
    transform: rotate(-45deg);
}

/* ===== HERO SECTION ===== */
.hero {
    height: 100vh;
    background-color: var(--light-bg);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    margin-top: 0; /* Default margin for desktop */
}

.hero::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background-color: rgba(74, 105, 189, 0.1);
    z-index: 0;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -100px;
    left: -100px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background-color: rgba(45, 70, 185, 0.1);
    z-index: 0;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.hero-text {
    flex: 1;
    padding-right: 30px;
}

.hero-text h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.2;
}

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

.hero-text h1 span::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 8px;
    background-color: rgba(74, 105, 189, 0.3);
    z-index: -1;
}

.hero-text h2 {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 20px;
    color: var(--accent-color);
}

.typing-text::after {
    content: '|';
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-text p {
    font-size: 18px;
    margin-bottom: 30px;
    max-width: 500px;
}

.hero-btns {
    margin-bottom: 30px;
}

.hero-btns .btn {
    margin-right: 15px;
    margin-bottom: 15px;
}

.social-icons {
    display: flex;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #fff;
    color: var(--primary-color);
    margin-right: 15px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.social-icon:hover {
    background-color: var(--primary-color);
    color: #fff;
    transform: translateY(-3px);
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-container {
    width: 350px;
    height: 350px;
    border-radius: 50%;
    overflow: hidden;
    border: 10px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scroll-down {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.scroll-down a {
    color: var(--primary-color);
    font-size: 24px;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) translateX(-50%); }
    40% { transform: translateY(-20px) translateX(-50%); }
    60% { transform: translateY(-10px) translateX(-50%); }
}

/* ===== SECTION HEADER ===== */
.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 36px;
    font-weight: 700;
    position: relative;
    display: inline-block;
    margin-bottom: 15px;
}

.section-header h2 span {
    color: var(--primary-color);
}

.section-line {
    width: 80px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 0 auto;
}

/* ===== ABOUT SECTION ===== */
.about {
    background-color: #fff;
}

.about-content {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 40px;
}

.about-image {
    flex: 0 0 40%;
    max-width: 400px;
    position: relative;
}

.about-image::before {
    content: '';
    position: absolute;
    top: -12px;
    left: -12px;
    width: 50px;
    height: 50px;
    border-top: 3px solid var(--primary-color);
    border-left: 3px solid var(--primary-color);
    z-index: 1;
}

.about-image::after {
    content: '';
    position: absolute;
    bottom: -12px;
    right: -12px;
    width: 50px;
    height: 50px;
    border-bottom: 3px solid var(--primary-color);
    border-right: 3px solid var(--primary-color);
    z-index: 1;
}

.about-image img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    object-fit: cover;
    object-position: center;
}

.about-image img:hover {
    transform: scale(1.03);
}

/* Responsive styles for about section */
@media screen and (max-width: 992px) {
    .about-content {
        flex-direction: column;
        align-items: center;
    }
    
    .about-image {
        flex: 0 0 100%;
        margin-bottom: 30px;
        max-width: 380px;
    }
    
    .about-text {
        padding-left: 0;
    }
}

.about-text {
    flex: 1;
    min-width: 300px;
    padding-left: 20px;
}

.about-text h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.about-text p {
    margin-bottom: 20px;
}

.about-info {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.info-item span {
    font-weight: 600;
    color: var(--primary-color);
}

/* ===== SKILLS SECTION ===== */
.skills {
    background-color: var(--light-bg);
}

.skills-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
    gap: 40px;
}

.skill-category h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.skill-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.skill-item {
    background-color: #fff;
    padding: 15px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.skill-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.skill-info p {
    font-weight: 500;
}

.skill-bar {
    height: 8px;
    background-color: var(--gray-bg);
    border-radius: 10px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 10px;
    width: 0;
    transition: width 1.5s ease;
}

/* ===== PORTFOLIO SECTION ===== */
.portfolio {
    background-color: #fff;
}

.portfolio-filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.filter-btn {
    padding: 8px 20px;
    margin: 5px;
    background-color: var(--gray-bg);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.filter-btn.active,
.filter-btn:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.portfolio-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.portfolio-item {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
}

.portfolio-item:hover {
    transform: translateY(-10px);
}

.portfolio-img {
    height: 250px;
    overflow: hidden;
}

.portfolio-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.portfolio-item:hover .portfolio-img img {
    transform: scale(1.1);
}

.portfolio-info {
    padding: 20px;
    background-color: #fff;
}

.portfolio-info h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
}

.portfolio-info p {
    color: var(--accent-color);
    font-size: 14px;
    margin-bottom: 10px;
}

.portfolio-links {
    display: flex;
    gap: 10px;
}

.portfolio-link {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: var(--gray-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    transition: var(--transition);
}

.portfolio-link:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.portfolio-details {
    padding: 8px 15px;
    border-radius: 4px;
    background-color: var(--primary-color);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    transition: var(--transition);
}

.portfolio-details:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

/* ===== CONTACT SECTION ===== */
.contact {
    background-color: var(--light-bg);
    position: relative;
    overflow: hidden;
}

.contact::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background-color: rgba(74, 105, 189, 0.1);
    z-index: 0;
}

.contact::after {
    content: '';
    position: absolute;
    bottom: -100px;
    left: -100px;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background-color: rgba(45, 70, 185, 0.1);
    z-index: 0;
}

.contact-content {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    position: relative;
    z-index: 1;
}

.contact-info {
    flex: 1;
    min-width: 300px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}

.contact-card {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
    transform: translateY(0);
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.contact-card:nth-child(1) {
    animation-delay: 0.1s;
}

.contact-card:nth-child(2) {
    animation-delay: 0.2s;
}

.contact-card:nth-child(3) {
    animation-delay: 0.3s;
}

.contact-card:nth-child(4) {
    animation-delay: 0.4s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.contact-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.contact-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: var(--transition);
    overflow: visible;
    position: relative;
    line-height: 1;
    padding: 0;
}

.contact-card:hover .contact-card-icon {
    transform: rotateY(360deg);
    background-color: var(--secondary-color);
}

.contact-card-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.contact-card-content p {
    font-size: 16px;
  width: 150px;
    
    color: var(--text-color);
}

.contact-card-content a {
    font-size: 14px;
    color: var(--text-color);
    transition: var(--transition);
}

.contact-card-content a:hover {
    color: var(--primary-color);
}

.contact-social {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    animation: fadeIn 0.8s ease forwards;
    opacity: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.contact-social h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 30px;
    color: var(--primary-color);
    position: relative;
}

.contact-social h3::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background-color: var(--primary-color);
}

.social-icons-large {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.social-icon-large {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #fff;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: visible;
    z-index: 1;
}

.social-icon-large::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    transform: scale(0);
    transition: var(--transition);
    z-index: -1;
    border-radius: 50%;
}

.social-icon-large:hover {
    color: #fff;
    transform: translateY(-10px);
}

.social-icon-large:hover::before {
    transform: scale(1);
}

/* ===== FOOTER ===== */
footer {
    background-color: var(--dark-bg);
    color: var(--light-text);
    padding: 50px 0;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
}

.footer-logo a {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
}

.footer-logo span {
    color: var(--accent-color);
}

.footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: var(--light-text);
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.back-to-top.active {
    opacity: 1;
    visibility: visible;
}

/* ===== PROJECT MODAL ===== */
.project-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.project-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #fff;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    border-radius: 10px;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.project-modal.active .modal-content {
    transform: scale(1);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    color: var(--text-color);
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--primary-color);
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 28px;
    color: var(--primary-color);
}

.modal-body {
    padding: 30px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.project-images {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.main-image {
    width: 100%;
    height: 300px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.image-thumbnail {
    width: 80px;
    height: 60px;
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.image-thumbnail.active {
    border-color: var(--primary-color);
}

.image-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.project-details h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tech-tag {
    padding: 5px 15px;
    background-color: var(--gray-bg);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
}

.project-features ul {
    list-style: disc;
    padding-left: 20px;
}

.project-features li {
    margin-bottom: 8px;
}

.project-links {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

/* Dark mode styles for modal */
[data-theme="dark"] .modal-content {
    background-color: var(--dark-bg);
}

[data-theme="dark"] .modal-header {
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .tech-tag {
    background-color: var(--gray-bg);
    color: var(--light-text);
}

/* Responsive styles for modal */
@media (max-width: 768px) {
    .modal-body {
        grid-template-columns: 1fr;
    }
    
    .main-image {
        height: 250px;
    }
}

.back-to-top:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
}

/* ===== RESPONSIVE STYLES ===== */
/* Large Devices (Desktops & Laptops) */
@media screen and (max-width: 1200px) {
    .container {
        max-width: 960px;
    }
    
    .hero-text h1 {
        font-size: 42px;
    }
    
    .image-container {
        width: 320px;
        height: 320px;
    }
    
    .portfolio-items {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* Medium Devices (Tablets & Small Laptops) */
@media screen and (max-width: 992px) {
    .container {
        max-width: 720px;
    }
    
    .hero {
        margin-top: 60px; /* Add margin-top for tablets and smaller devices */
        height: auto;
        padding: 100px 0 50px;
    }
    
    .hero-content {
        flex-direction: column;
        text-align: center;
    }

    .hero-text {
        padding-right: 0;
        margin-bottom: 50px;
    }

    .hero-text p {
        margin: 0 auto 30px;
    }

    .social-icons {
        justify-content: center;
    }

    .about-content {
        flex-direction: column;
    }

    .about-image {
        margin-bottom: 30px;
        padding-right: 0;
    }

    .skills-content {
        grid-template-columns: 1fr;
    }
    
    section {
        padding: 80px 0;
    }
    
    .contact-content {
        flex-direction: column;
    }
    
    .contact-info {
        margin-bottom: 40px;
    }
}

/* Small Devices (Small Tablets & Large Phones) */
@media screen and (max-width: 768px) {
    .container {
        max-width: 540px;
    }
    
    section {
        padding: 70px 0;
    }

    .hero {
        margin-top: 70px;
    }

    .hamburger-menu {
        display: block;
    }

    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 250px;
        height: 100vh;
        background-color: #fff;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        padding: 80px 20px 20px;
        transition: var(--transition);
        z-index: 999;
    }

    nav.active {
        right: 0;
    }

    .close-menu {
        display: block;
        position: absolute;
        top: 20px;
        right: 20px;
        font-size: 24px;
        cursor: pointer;
        color: var(--text-color);
        transition: var(--transition);
    }

    .close-menu:hover {
        color: var(--primary-color);
        transform: rotate(90deg);
    }

    nav ul {
        flex-direction: column;
    }

    nav ul li {
        margin: 15px 0;
    }

    .hero-text h1 {
        font-size: 36px;
    }

    .hero-text h2 {
        font-size: 20px;
    }

    .hero-text p {
        font-size: 16px;
    }

    .image-container {
        width: 280px;
        height: 280px;
    }

    .portfolio-filter {
        flex-direction: column;
        align-items: center;
    }

    .filter-btn {
        width: 200px;
    }
    
    .section-header {
        margin-bottom: 40px;
    }
    
    .contact-card {
        padding: 20px;
    }
    
    .contact-card-content p {
        width: auto;
    }
}

/* Extra Small Devices (Mobile Phones) */
@media screen and (max-width: 576px) {
    .container {
        width: 95%;
        padding: 0 10px;
    }
    
    section {
        padding: 60px 0;
    }
    
    .section-header h2 {
        font-size: 28px;
    }

    .hero {
        margin-top: 80px;
        padding: 80px 0 40px;
    }

    .hero-text h1 {
        font-size: 28px;
    }
    
    .hero-text h2 {
        font-size: 18px;
    }
    
    .hero-btns .btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .about-text h3 {
        font-size: 20px;
    }

    .about-info {
        grid-template-columns: 1fr;
    }

    .portfolio-items {
        grid-template-columns: 1fr;
    }
    
    .portfolio-img {
        height: 220px;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 35px;
        height: 35px;
    }
    
    /* Add margin-bottom to header for mobile screens */
    header {
        margin-bottom: 30px;
        padding: 15px 0;
    }
    
    .logo a {
        font-size: 24px;
    }
    
    .contact-info {
        grid-template-columns: 1fr;
    }
    
    .social-icons-large .social-icon-large {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

/* Very Small Devices (Small Mobile Phones) */
@media screen and (max-width: 480px) {
    .hero-text h1 {
        font-size: 24px;
    }
    
    .hero-text p {
        font-size: 14px;
    }
    
    .image-container {
        width: 240px;
        height: 240px;
        border-width: 8px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .section-header h2 {
        font-size: 24px;
    }
    
    .about-text p {
        font-size: 14px;
    }
    
    .skill-info p {
        font-size: 14px;
    }
    
    .contact-card {
        padding: 15px;
    }
    
    .contact-card-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .contact-card-content h3 {
        font-size: 16px;
    }
    
    .contact-card-content p {
        font-size: 14px;
    }
}

/* Tiny Devices (Very Small Mobile Phones) */
@media screen and (max-width: 360px) {
    .container {
        width: 100%;
        padding: 0 8px;
    }
    
    .hero-text h1 {
        font-size: 22px;
    }
    
    .hero-text h2 {
        font-size: 16px;
    }
    
    .image-container {
        width: 200px;
        height: 200px;
        border-width: 6px;
    }
    
    .social-icon {
        width: 35px;
        height: 35px;
    }
    
    .hero-btns .btn {
        padding: 8px 16px;
        font-size: 13px;
        margin-right: 8px;
    }
    
    .portfolio-info h3 {
        font-size: 16px;
    }
    
    .portfolio-info p {
        font-size: 13px;
    }
    
    .contact-social h3 {
        font-size: 20px;
    }
    
    .social-icons-large {
        gap: 15px;
    }
    
    .social-icons-large .social-icon-large {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

/* ===== HEIGHT-BASED MEDIA QUERIES ===== */
/* For Short Height Screens */
@media screen and (max-height: 700px) {
    .hero {
        height: auto;
        min-height: 100vh;
        padding: 80px 0 40px;
    }
    
    .hero-text h1 {
        font-size: 32px;
        margin-bottom: 5px;
    }
    
    .hero-text h2 {
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    .hero-text p {
        margin-bottom: 20px;
    }
    
    .hero-btns {
        margin-bottom: 20px;
    }
    
    .image-container {
        width: 280px;
        height: 280px;
    }
    
    section {
        padding: 60px 0;
    }
    
    .section-header {
        margin-bottom: 30px;
    }
}

/* For Very Short Height Screens */
@media screen and (max-height: 600px) {
    .hero {
        padding: 60px 0 30px;
    }
    
    .hero-text h1 {
        font-size: 28px;
    }
    
    .hero-text h2 {
        font-size: 16px;
    }
    
    .hero-text p {
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    .hero-btns {
        margin-bottom: 15px;
    }
    
    .image-container {
        width: 240px;
        height: 240px;
        border-width: 8px;
    }
    
    .social-icon {
        width: 35px;
        height: 35px;
        margin-right: 10px;
    }
    
    section {
        padding: 50px 0;
    }
    
    .about-content, .skills-content, .portfolio-items, .contact-content {
        gap: 20px;
    }
    
    .scroll-down {
        display: none;
    }
}

/* For Extremely Short Height Screens (Landscape on small phones) */
@media screen and (max-height: 450px) {
    header {
        padding: 10px 0;
    }
    
    .hero {
        padding: 40px 0 20px;
    }
    
    .hero-content {
        flex-direction: row;
        align-items: center;
        text-align: left;
    }
    
    .hero-text {
        padding-right: 20px;
        margin-bottom: 0;
    }
    
    .hero-text h1 {
        font-size: 24px;
    }
    
    .hero-text h2 {
        font-size: 14px;
    }
    
    .hero-text p {
        display: none;
    }
    
    .image-container {
        width: 180px;
        height: 180px;
        border-width: 5px;
    }
    
    .social-icons {
        justify-content: flex-start;
    }
    
    section {
        padding: 40px 0;
    }
    
    .section-header h2 {
        font-size: 22px;
    }
    
    .section-header {
        margin-bottom: 20px;
    }
    
    .about-content, .contact-content {
        flex-direction: row;
    }
    
    .about-image {
        margin-bottom: 0;
    }
    
    .portfolio-img {
        height: 180px;
    }
    
    .contact-card {
        padding: 10px;
    }
    
    .contact-card-icon {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
}

/* Combined Width and Height Media Queries for Better Responsiveness */
@media screen and (max-width: 768px) and (max-height: 500px) {
    .hero-content {
        flex-direction: row;
        text-align: left;
    }
    
    .hero-text {
        padding-right: 20px;
        margin-bottom: 0;
    }
    
    .social-icons {
        justify-content: flex-start;
    }
    
    .image-container {
        width: 160px;
        height: 160px;
        border-width: 5px;
    }
    
    nav.active {
        padding-top: 60px;
    }
    
    .about-info {
        display: flex;
        flex-wrap: wrap;
    }
    
    .info-item {
        width: 50%;
        margin-bottom: 10px;
    }
}