/* Modern External CSS */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    --primary-color: #4a90e2;
    --secondary-color: #feca57;
    --text-color: #333;
    --bg-color: #f9f9f9;
    --card-bg: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: var(--transition);
    text-align: left;
}

section h2, p {
    text-align: center;
}

/* Large screen navigation */
.navbar-large {
    display: flex;
    background: linear-gradient(135deg, #2c3e50, #3498db);
    max-width: 1500px;
    margin: 0 auto;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    padding: 15px;
    box-shadow: var(--shadow);
}

.navbar-large .nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
}

.navbar-large .nav-links li {
    margin: 0 20px;
}

.navbar-large .nav-links a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 5px;
    transition: var(--transition);
    font-size: 16px;
}

.navbar-large .nav-links a:hover, .navbar-large .nav-links a:focus {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    outline: none;
}

/* Small screen navigation */
.navbar-small {
    display: none;
    background: linear-gradient(135deg, #2c3e50, #3498db);
    max-width: 1500px;
    margin: 0 auto;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    padding: 15px;
    box-shadow: var(--shadow);
}

.menu-toggle {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 5px 10px;
    transition: var(--transition);
}

.menu-toggle .hamburger-icon {
    font-size: 24px;
    line-height: 1;
}

.menu-toggle:hover .hamburger-icon, .menu-toggle:focus .hamburger-icon {
    color: var(--secondary-color);
}

.menu-toggle:focus {
    outline: none;
}

.nav-links-mobile {
    list-style: none;
    margin: 0;
    padding: 0;
    display: none;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
    background: linear-gradient(135deg, #2c3e50, #3498db);
    padding: 10px 0;
    box-shadow: var(--shadow);
    z-index: 2000;
    transition: var(--transition);
}

.nav-links-mobile.active {
    display: flex;
}

.nav-links-mobile li {
    margin: 10px 0;
    text-align: center;
}

.nav-links-mobile a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 5px;
    transition: var(--transition);
    font-size: 16px;
}

.nav-links-mobile a:hover, .nav-links-mobile a:focus {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    outline: none;
}

/* Theme toggle (shared for both nav bars) */
.theme-toggle {
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    transition: var(--transition);
    margin-left: 15px;
}

.theme-toggle i {
    font-size: 18px;
    color: #fff;
}

.theme-toggle:hover i, .theme-toggle:focus i {
    color: var(--secondary-color);
    transform: scale(1.1);
}

.theme-toggle:focus {
    outline: none;
}

main {
    margin-top: 80px;
    padding: 40px 20px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.hero {
    text-align: center;
    padding: 50px 20px;
    background: linear-gradient(to right, #e6f0fa, #f0f8ff);
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.hero h1, .hero h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
    color: #ff6f61;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.text-slide {
    display: inline-block;
    animation: slideLeftToRight 10s linear infinite;
    animation-play-state: running;
    will-change: transform;
}

.text-slide.hidden {
    display: none;
    animation-play-state: paused;
}

@keyframes slideLeftToRight {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.hero p, .hero figcaption {
    font-size: 1.2em;
    color: #555;
    margin: 10px 0;
}

.hero img {
    max-width: 100%;
    height: auto;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hero a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.hero a:hover {
    text-decoration: underline;
}

.two-column {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.two-column article p{
    text-align: left;
}

.three-column {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.project-card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.project-card .project {
    height: 250px;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
}

.project-card .project img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

.project-card h3 {
    font-size: 1.5em;
    margin: 0 0 10px;
    color: var(--primary-color);
}

.details {
    background: rgba(0, 0, 0, 0.05);
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
}

textarea {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
}

table th, table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

table th {
    background: var(--primary-color);
    color: #fff;
    font-weight: 600;
}

form {
    display: flex;
    flex-direction: column;
    max-width: 600px;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

form label {
    margin: 10px 0 5px;
    font-weight: 500;
    color: var(--primary-color);
}

form input, form textarea, form select {
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
    transition: var(--transition);
}

form input:focus, form textarea:focus, form select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(74, 144, 226, 0.3);
    outline: none;
}

button {
    padding: 12px 20px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: var(--transition);
    width: auto;
    margin: 0 auto;
    display: block;
}

button:hover, button:focus {
    background: #357abd;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.toggle-details {
    background: var(--secondary-color);
    width: auto;
}

.toggle-details:hover, .toggle-details:focus {
    background: #e0b03f;
}

fieldset {
    text-align: left;
}

footer {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: #fff;
    position: relative;
    bottom: 0;
    width: 100%;
    margin-top: 40px;
}

footer a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: var(--transition);
}

footer a:hover {
    color: #fff;
    text-decoration: underline;
}

iframe {
    border-radius: 8px;
    margin: 20px 0;
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
}

#back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 15px;
    background: var(--primary-color);
    border-radius: 50%;
    display: none;
    transition: var(--transition);
}

#back-to-top i {
    font-size: 18px;
    color: #fff;
    margin-right: 5px;
    vertical-align: middle;
}

#back-to-top:hover, #back-to-top:focus {
    background: #357abd;
    transform: translateY(-2px);
}

#back-to-top:focus {
    outline: none;
}

/* Dark mode */
body.dark-mode {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --card-bg: #2c2c2c;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

body.dark-mode .hero {
    background: linear-gradient(135deg, #2c3e50, #34495e);
}

body.dark-mode .hero p,.p{
    color: rgb(245, 245, 245);
}

body.dark-mode .project-card {
    background: var(--card-bg);
}

body.dark-mode form {
    background: var(--card-bg);
}

body.dark-mode form input, body.dark-mode form textarea, body.dark-mode form select {
    background: #333;
    color: #e0e0e0;
    border-color: #444;
}

body.dark-mode table th {
    background: #357abd;
}

body.dark-mode .details {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-mode .menu-toggle .hamburger-icon,
body.dark-mode .theme-toggle i,
body.dark-mode #back-to-top i {
    color: #e0e0e0;
}

body.dark-mode .menu-toggle:hover .hamburger-icon,
body.dark-mode .theme-toggle:hover i,
body.dark-mode #back-to-top:hover i {
    color: var(--secondary-color);
}

body.dark-mode .resume-link a {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

body.dark-mode .resume-link a:hover,
body.dark-mode .resume-link a:focus {
    background: var(--primary-color);
    color: #fff;
}

/* Accessibility: Visually hidden class */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Print-friendly CSS */
@media print {
    .navbar-large, .navbar-small, footer, .theme-toggle, iframe, .hero, #back-to-top {
        display: none;
    }
    body {
        background: #fff;
        color: #000;
    }
    .two-column, .three-column {
        display: block;
    }
    .project-card {
        border: none;
        page-break-inside: avoid;
    }
}

/* Responsive design */
@media (max-width: 1200px) {
    main {
        max-width: 1000px;
    }
    .hero {
        padding: 40px 15px;
    }
    .hero h1, .hero h2 {
        font-size: 2.2em;
    }
    .three-column {
        grid-template-columns: repeat(2, 1fr);
    }
    .project-card .project {
        height: 220px;
    }
    .navbar-large .nav-links li {
        margin: 0 15px;
    }
    .navbar-large .nav-links a {
        font-size: 14px;
    }
}

@media (max-width: 1024px) {
    main {
        max-width: 900px;
    }
    .hero {
        padding: 35px 10px;
    }
    .hero h1, .hero h2 {
        font-size: 2em;
    }
    .two-column {
        gap: 20px;
    }
    .three-column {
        grid-template-columns: 1fr;
    }
    .project-card {
        padding: 15px;
    }
    .project-card .project {
        height: 200px;
    }
    .navbar-large .nav-links li {
        margin: 0 10px;
    }
}

@media (max-width: 768px) {
    .navbar-large {
        display: none;
    }
    .navbar-small {
        display: flex;
    }
    .hero {
        padding: 30px 10px;
    }
    .hero h1, .hero h2 {
        font-size: 1.8em;
    }
    .hero p, .hero figcaption {
        font-size: 1em;
    }
    .hero img {
        width: 150px;
    }
    iframe {
        max-width: 100%;
        height: 180px;
    }
    form {
        padding: 15px;
        max-width: 90%;
    }
    form label {
        font-size: 0.9em;
    }
    form input, form textarea, form select {
        font-size: 14px;
        padding: 8px;
    }
    .project-card h3 {
        font-size: 1.3em;
    }
    table th, table td {
        padding: 8px;
        font-size: 0.9em;
    }
    .menu-toggle .hamburger-icon {
        font-size: 20px;
    }
    .theme-toggle i {
        font-size: 16px;
    }
    .theme-toggle {
        padding: 6px;
        margin-left: 10px;
    }
}

@media (max-width: 480px) {
    main {
        padding: 20px 10px;
    }
    .navbar-small {
        padding: 10px;
    }
    .menu-toggle .hamburger-icon {
        font-size: 18px;
    }
    .nav-links-mobile {
        top: 50px;
    }
    .hero {
        padding: 20px 10px;
    }
    .hero h1, .hero h2 {
        font-size: 1.5em;
    }
    .hero p, .hero figcaption {
        font-size: 0.9em;
    }
    .hero img {
        width: 120px;
    }
    .project-card {
        padding: 10px;
    }
    .project-card .project {
        height: 180px;
    }
    .project-card h3 {
        font-size: 1.2em;
    }
    .project-card p {
        font-size: 0.9em;
    }
    form {
        padding: 10px;
        max-width: 100%;
    }
    form label {
        font-size: 0.85em;
    }
    form input, form textarea, form select {
        font-size: 13px;
        padding: 6px;
    }
    button {
        padding: 10px;
        font-size: 14px;
    }
    footer {
        padding: 15px;
        font-size: 0.9em;
    }
    #back-to-top {
        padding: 8px 12px;
    }
    #back-to-top i {
        font-size: 16px;
    }
    iframe {
        height: 150px;
    }
}

.timeline {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    position: relative;
}

.timeline li {
    margin-bottom: 20px;
    padding-left: 30px;
    position: relative;
}

.timeline li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-size: 1.5em;
    line-height: 1;
}

.skills {
    margin: 20px 0;
}

.skill {
    margin-bottom: 15px;
}

.skill label {
    display: block;
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.progress-bar {
    background: #ddd;
    border-radius: 5px;
    height: 15px;
    overflow: hidden;
}

.progress {
    background: var(--primary-color);
    height: 100%;
    font-size: 10px;
    transition: width 1s ease-in-out;
}

.resume-link {
    display: inline-block;
    margin-top: 20px;
}

.resume-link a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border: 2px solid var(--primary-color);
    border-radius: 5px;
    transition: var(--transition);
}

.resume-link a:hover,
.resume-link a:focus {
    background: var(--primary-color);
    color: #fff;
    outline: none;
}

.resume-link i {
    font-size: 1.2em;
}

blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 15px;
    margin: 20px 0;
    font-style: italic;
    color: #555;
}

cite {
    display: block;
    margin-top: 10px;
    font-size: 0.9em;
    color: var(--text-color);
}

.cta {
    text-align: center;
    margin: 40px 0;
    font-size: 1.1em;
}

.cta a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.cta a:hover {
    text-decoration: underline;
}

body.dark-mode blockquote {
    border-left-color: var(--primary-color);
    color: #bbb;
}

body.dark-mode cite {
    color: #e0e0e0;
}

body.dark-mode .progress-bar {
    background: #555;
}

/* W3.CSS overrides */
.w3-button {
    background: transparent;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    transition: var(--transition);
}

.w3-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.w3-large {
    font-size: 24px !important;
}

body.dark-mode .w3-button:hover {
    background: rgba(255, 255, 255, 0.3);
}