* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #06b6d4;
    --bg-color: #0f0f23;
    --bg-secondary: #1a1a2e;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --gradient-primary: linear-gradient(135deg, #6366f1, #8b5cf6);
    --gradient-secondary: linear-gradient(135deg, #06b6d4, #3b82f6);
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scroll from minor layout issues */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(20px);
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); /* Add subtle shadow for depth */
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo .logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.accent {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease, transform 0.2s ease;
    position: relative; /* For underline effect */
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    z-index: 1001; /* Ensure hamburger is above menu when open */
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    margin: 3px 0;
    transition: 0.3s;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    padding-top: 80px; /* Add padding to account for fixed navbar */
}

.hero-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.btn-primary, .btn-secondary {
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: var(--glass-border);
}

/* Floating Card */
.floating-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(20px);
    animation: float 6s ease-in-out infinite;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); /* Add shadow for depth */
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-title {
    font-weight: 600;
    color: var(--text-primary);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.code-preview {
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: pre-wrap; /* Ensure line breaks are honored */
    word-break: break-word; /* Break long lines */
}

.keyword { color: #8b5cf6; }
.variable { color: #06b6d4; }
.function { color: #10b981; }
.property { color: #f59e0b; }
.string { color: #f87171; }

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

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

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.scroll-line {
    width: 2px;
    height: 30px;
    background: var(--gradient-primary);
    border-radius: 2px;
    margin-bottom: 0.5rem;
    animation: scroll 2s ease-in-out infinite;
}

@keyframes scroll {
    0%, 100% { opacity: 0.3; transform: scaleY(1); }
    50% { opacity: 1; transform: scaleY(1.5); }
}

/* Section Titles */
.section-title {
    text-align: center;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 4rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    padding-top: 2rem; /* Ensure title is not hidden by navbar */
}

/* Skills Section */
.skills-section {
    padding: 6rem 0;
    background: var(--bg-secondary);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.skill-category {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.skill-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.category-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.category-header i {
    font-size: 2rem;
    color: var(--primary-color);
}

.category-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

.skill-item {
    margin-bottom: 1.5rem;
}

.skill-item span {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.skill-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    width: 0%;
    transition: width 1.5s ease-in-out;
}

/* Skills & Languages Section */
.skills-languages-section {
    padding: 6rem 0;
    background: var(--bg-secondary);
}

.skills-languages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 3rem;
    margin-top: 3rem;
}

.skill-category {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2.5rem;
    backdrop-filter: blur(20px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.skill-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.category-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.category-header i {
    font-size: 2.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.category-header h3 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.skill-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.skill-item {
    position: relative;
}

.skill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.skill-header span {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.skill-header .percentage {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-color);
}

.skill-bar {
    position: relative;
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    overflow: hidden;
}

.skill-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 6px;
    width: 0%;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.skill-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.skill-progress.animate {
    width: var(--target-width);
}

/* Enhanced Projects Section */
.projects-section {
    padding: 6rem 0;
    background: var(--bg-secondary);
}

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

.project-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    backdrop-filter: blur(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2); /* Added shadow for better depth */
}

.project-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    border-color: rgba(99, 102, 241, 0.3);
}

.project-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 15, 35, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.overlay-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.project-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 140px;
    position: relative;
    overflow: hidden;
}

/* Ripple effect for buttons */
.project-btn .ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 0.6s linear;
    background-color: rgba(255, 255, 255, 0.7);
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.demo-btn {
    background: var(--gradient-primary);
    color: white;
}

.demo-btn:hover {
    background: var(--gradient-secondary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
}

.github-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.github-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.project-content {
    padding: 2rem;
}

.project-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.project-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    font-size: 0.95rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tag {
    padding: 0.4rem 0.8rem;
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tech-tag:hover {
    background: rgba(99, 102, 241, 0.3);
    transform: translateY(-1px);
}

/* AI Showcase Section */
.ai-showcase-section {
    padding: 6rem 0;
    background: var(--bg-secondary);
}

.ai-demo-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.prompt-examples h3, .prompt-gallery h3 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.prompt-input-group {
    margin-bottom: 2rem;
}

#promptInput {
    width: 100%;
    height: 120px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    color: var(--text-primary);
    font-family: inherit;
    resize: vertical;
    margin-bottom: 1rem;
}

#promptInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.generate-btn {
    width: 100%;
    padding: 1rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

.prompt-output {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    min-height: 100px;
    white-space: pre-wrap;
    color: var(--text-secondary);
    line-height: 1.6;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); /* Added subtle shadow */
}

.example-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.example-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); /* Added subtle shadow */
}

.example-card:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.2);
}

.example-card h4 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.example-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.example-card code {
    display: block;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--accent-color);
}

/* Contact Section */
.contact-section {
    padding: 6rem 0;
}

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-info h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.contact-info p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
}

.contact-item i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.contact-form {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(20px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2); /* Added shadow */
}

.form-group {
    position: relative;
    margin-bottom: 2rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background: transparent;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group textarea {
    height: 120px;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

/* For labels that act as placeholders */
.form-group label {
    position: absolute;
    top: 1rem;
    left: 1rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    pointer-events: none;
    background-color: var(--bg-color);
    padding: 0 0.25rem;
    transform-origin: left top;
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:focus + label,
.form-group textarea:not(:placeholder-shown) + label,
.form-group select:focus + label,
.form-group select:not([value=""]) + label {
    top: -0.5rem;
    left: 0.5rem;
    font-size: 0.8rem;
    color: var(--primary-color);
    background: var(--bg-color);
    padding: 0 0.5rem;
    transform: scale(0.9);
}

/* For elements with .has-value class (JS controlled) */
.form-group input.has-value + label,
.form-group textarea.has-value + label,
.form-group select.has-value + label {
    top: -0.5rem;
    left: 0.5rem;
    font-size: 0.8rem;
    color: var(--primary-color);
    background: var(--bg-color);
    padding: 0 0.5rem;
    transform: scale(0.9);
}

.submit-btn {
    width: 100%;
    padding: 1rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--glass-border);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer p {
    color: var(--text-secondary);
}

/* Social Connect Section */
.social-connect {
    margin-top: 3rem;
    padding: 2rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    backdrop-filter: blur(20px);
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); /* Added shadow */
}

.social-connect h4 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 600;
}

.social-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
}

.social-link:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-color: var(--primary-color);
}

.social-link.github:hover {
    border-color: #8b5cf6;
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.3);
}

.social-link.linkedin:hover {
    border-color: #06b6d4;
    box-shadow: 0 10px 30px rgba(6, 182, 212, 0.3);
}

.social-link i {
    font-size: 1.25rem;
}

.social-link.github i {
    color: #8b5cf6;
}

.social-link.linkedin i {
    color: #06b6d4;
}

/* CV Section Styles */
.cv-section {
    padding: 6rem 0;
    background: var(--bg-color);
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px; /* Adjust for fixed navbar */
}

.cv-container {
    display: grid;
    grid-template-columns: 1fr; /* Already stacking, good for responsiveness */
    gap: 3rem;
    align-items: center;
}

/* Terminal Style Intro */
.terminal-intro {
    background: rgba(15, 15, 35, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    font-family: 'Fira Code', monospace;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.terminal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.terminal-controls {
    display: flex;
    gap: 0.5rem;
}

.control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.control.close { background: #ff5f57; }
.control.minimize { background: #ffbd2e; }
.control.maximize { background: #28ca42; }

.terminal-title {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.terminal-content {
    padding: 2rem;
}

.type-effect {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.prompt {
    color: var(--accent-color);
}

.command {
    color: var(--text-primary);
}

.cursor {
    color: var(--primary-color);
    animation: blink 1s infinite;
}

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

.terminal-output {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(99, 102, 241, 0.1);
    border-left: 3px solid var(--primary-color);
    border-radius: 4px;
}

.response {
    color: var(--text-secondary);
    font-style: italic;
}

/* CV Preview Window */
.cv-window {
    background: rgba(15, 15, 35, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
}

.cv-window:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.cv-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cv-controls {
    display: flex;
    gap: 0.5rem;
}

.cv-control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.cv-control.red { background: #ff5f57; }
.cv-control.yellow { background: #ffbd2e; }
.cv-control.green { background: #28ca42; }

.cv-title {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    margin-left: auto;
}

.cv-content {
    padding: 2rem;
}

.code-editor {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    margin-bottom: 2rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    overflow: hidden;
}

.line-numbers {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-secondary);
    line-height: 1.8;
    user-select: none;
}

.code-content {
    padding: 1rem;
    line-height: 1.8;
}

.line {
    display: block;
}

.keyword { color: #8b5cf6; }
.variable { color: #06b6d4; }
.function { color: #10b981; }
.method { color: #f59e0b; }
.string { color: #f87171; }

.cv-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cv-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.cv-btn.primary {
    background: var(--gradient-primary);
    color: white;
}

.cv-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

.cv-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.cv-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Responsive Design - Tablet & Larger Phones */
@media (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }

    .hero-title {
        font-size: 3rem; /* Slightly smaller for tablets */
    }

    .section-title {
        font-size: 2.5rem; /* Slightly smaller for tablets */
        margin-bottom: 3rem; /* Adjusted for better spacing */
    }

    .hero-content {
        gap: 3rem;
    }

    .skills-languages-grid, .skills-grid, .projects-grid, .ai-demo-container, .contact-container {
        gap: 2rem; /* Reduce gap on smaller screens */
    }

    .skill-category, .project-card, .contact-form, .social-connect, .floating-card {
        padding: 1.75rem; /* Slightly reduce padding */
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px; /* Aligned with navbar height */
        flex-direction: column;
        background-color: var(--bg-secondary);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        padding: 2rem 0;
        height: calc(100vh - 70px); /* Take full height below navbar */
        overflow-y: auto; /* Allow scrolling if menu is long */
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-description {
        font-size: 1rem; /* Adjust description size for mobile */
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 2.5rem; /* Adjust for mobile */
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .project-card {
        margin: 0 1rem; /* Add horizontal margin on mobile */
    }
    
    .project-image {
        height: 200px;
    }
    
    .overlay-content {
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .project-btn {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
        min-width: 120px;
    }
    
    .ai-demo-container {
        grid-template-columns: 1fr;
        gap: 2.5rem; /* Adjust gap for mobile */
    }
    
    .contact-container {
        grid-template-columns: 1fr;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .skills-languages-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .skills-languages-section .skill-category {
        padding: 2rem;
    }
    
    .category-header h3 {
        font-size: 1.5rem;
    }
    
    .social-links {
        flex-direction: column;
        align-items: center;
    }
    
    .social-link {
        width: 200px;
        justify-content: center;
    }
    
    .cv-container {
        gap: 2rem;
    }
    
    .terminal-content, .cv-content {
        padding: 1.5rem 1rem;
    }
    
    .code-editor {
        font-size: 0.8rem;
    }
    
    .cv-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .cv-btn {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
    /* Add padding to sections to prevent content from going under the fixed header */
    .hero, .skills-languages-section, .skills-section, .projects-section, .ai-showcase-section, .cv-section, .contact-section {
        padding-top: calc(70px + 2rem); /* Navbar height + some extra padding */
        padding-bottom: 4rem; /* Ensure consistent bottom padding */
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .nav-container {
        padding: 1rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-description {
        font-size: 0.9rem; /* Further reduce description size */
    }

    .section-title {
        font-size: 1.8rem; /* Smaller for very small screens */
        margin-bottom: 2rem;
    }
    
    .skills-languages-section .skill-category {
        padding: 1.5rem;
    }
    
    .project-content {
        padding: 1.5rem;
    }
    
    .project-content h3 {
        font-size: 1.3rem;
    }
    
    .project-image {
        height: 160px; /* Slightly smaller image height */
    }
    
    .social-connect {
        margin: 2rem 0; /* Remove horizontal margin as container handles it */
        padding: 1.5rem;
    }
    
    .social-link {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .type-effect {
        font-size: 1rem; /* Adjust terminal text size */
    }

    .terminal-content, .cv-content {
        padding: 1rem;
    }

    .code-editor {
        font-size: 0.75rem; /* Smaller code font */
    }

    .cv-btn {
        padding: 0.8rem 1.5rem; /* Adjust CV button size */
    }
}

/* Language Switcher Styles */
.language-switcher {
    position: relative;
    z-index: 1001;
}

.language-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 25px;
    padding: 0.5rem 1rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    min-width: 60px;
}

.language-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    backdrop-filter: blur(20px);
    min-width: 150px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1002;
    pointer-events: none;
}

.language-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.3s ease;
    font-size: 0.9rem;
    text-align: left;
}

.language-option:hover {
    background: rgba(99, 102, 241, 0.2);
}

.language-option:first-child {
    border-radius: 12px 12px 0 0;
}

.language-option:last-child {
    border-radius: 0 0 12px 12px;
}

.flag {
    font-size: 1.2rem;
}

/* RTL Support */
html[dir="rtl"] {
    text-align: right;
}

html[dir="rtl"] .hero-content {
    direction: rtl;
}

html[dir="rtl"] .hero-buttons {
    flex-direction: row-reverse;
}

html[dir="rtl"] .skills-languages-grid {
    direction: rtl;
}

html[dir="rtl"] .contact-methods {
    direction: rtl;
}

html[dir="rtl"] .form-group label {
    left: auto;
    right: 1rem;
}

html[dir="rtl"] .form-group input:focus + label,
html[dir="rtl"] .form-group input:not(:placeholder-shown) + label,
html[dir="rtl"] .form-group textarea:focus + label,
html[dir="rtl"] .form-group textarea:not(:placeholder-shown) + label,
html[dir="rtl"] .form-group select:focus + label,
html[dir="rtl"] .form-group select:not([value=""]) + label {
    left: auto;
    right: 0.5rem;
    transform-origin: right top;
}

html[dir="rtl"] .skill-item {
    direction: rtl;
}

html[dir="rtl"] .skill-header {
    flex-direction: row-reverse;
}

html[dir="rtl"] .skill-progress {
    left: auto;
    right: 0;
}

html[dir="rtl"] .language-dropdown {
    left: 0;
    right: auto;
}

html[dir="rtl"] .language-option {
    text-align: right;
}

body.arabic-font {
    font-family: 'Noto Sans Arabic', 'Inter', sans-serif;
}

/* Responsive Language Switcher */
@media (max-width: 768px) {
    .language-switcher {
        margin-left: auto;
    }
    
    .language-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .language-dropdown {
        right: -1rem; /* Aligns to the right of the container */
        width: 140px;
    }

    html[dir="rtl"] .language-dropdown {
        left: -1rem; /* Aligns to the left of the container in RTL */
        right: auto;
    }
}
