/* ============================================
   Modern Portfolio - Professional Design System
   Color Scheme: Premium Light + Royal Blue + Gold Accent
   ============================================ */

:root {
    --primary-color: #1A73E8;
    --secondary-color: #1A73E8;
    --accent-color: #D4AF37;
    --dark-bg: #0D0D0D;
    --light-bg: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --white: #ffffff;
    --gold-accent: #D4AF37;
    --gradient-primary: linear-gradient(135deg, #1A73E8 0%, #0D47A1 100%);
    --gradient-accent: linear-gradient(135deg, #D4AF37 0%, #B8941F 100%);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--light-bg);
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

main {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Global text wrapping fixes */
p, span, div, h1, h2, h3, h4, h5, h6, a, li, td, th, label, input, textarea, button {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
}

/* Prevent text overflow in containers */
.container, .container-fluid, .row, [class*="col-"] {
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Fix for long URLs and email addresses */
a, .project-link {
    word-break: break-all;
    overflow-wrap: anywhere;
}

/* Ensure text in cards doesn't overflow */
.card-modern, .project-card, .service-card, .contact-info, .contact-form {
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow: hidden;
}

/* Fix for long text in badges and tags */
.highlight-badge, .skill-tag, .tech-badge {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    display: inline-block;
    max-width: 100%;
}

/* ============================================
   Navigation - Modern & Animated
   ============================================ */

.navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
    padding: 0.5rem 0;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    transition: transform 0.3s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.nav-link {
    color: var(--text-primary) !important;
    font-weight: 500;
    margin: 0 0.5rem;
    position: relative;
    transition: color 0.3s ease;
    padding: 0.5rem 1rem !important;
    white-space: nowrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient-accent);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}


/* ============================================
   Hero Section - Animated
   ============================================ */

.hero-section {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    position: relative;
    overflow: hidden;
    padding: 4rem 0;
    width: 100%;
    max-width: 100%;
}

.hero-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: float 20s infinite linear;
}

@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-50px, -50px) rotate(360deg); }
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--white);
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-title {
    font-family: 'Poppins', sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 1rem;
    animation: fadeInUp 0.5s ease-out 0.2s both;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    opacity: 0.95;
    animation: fadeInUp 1s ease-out 0.4s both;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
}

.hero-intro {
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto 2rem;
    line-height: 1.8;
    opacity: 0.9;
    animation: fadeInUp 1s ease-out 0.6s both;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    padding: 0 1rem;
}

.hero-highlights {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
    animation: fadeInUp 1s ease-out 0.8s both;
}

.highlight-badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    font-weight: 500;
}

.highlight-badge:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

/* ============================================
   Buttons - Modern & Animated
   ============================================ */

.btn-primary-custom {
    background: var(--gradient-primary);
    border: none;
    color: var(--white);
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    text-decoration: none;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.btn-primary-custom::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.3), transparent);
    transition: left 0.5s;
}

.btn-primary-custom:hover::before {
    left: 100%;
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
    color: var(--white);
    background: linear-gradient(135deg, #1A73E8 0%, #0D47A1 100%);
}

.btn-outline-custom {
    background: transparent;
    border: 2px solid var(--white);
    color: var(--white);
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-outline-custom:hover {
    background: var(--white);
    color: var(--primary-color);
    transform: translateY(-2px);
    border-color: var(--gold-accent);
}

/* ============================================
   Section Styling
   ============================================ */

.section {
    padding: 100px 0;
}

.section-title {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-align: center;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
    padding: 0 1rem;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 780px;
    margin: 0 auto 3rem;
    line-height: 1.8;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    padding: 0 1rem;
}

/* ============================================
   Cards - Modern & Animated
   ============================================ */

.card-modern {
    background: var(--white);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    height: 100%;
    position: relative;
    overflow: hidden;
}

.card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-accent);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.card-modern:hover::before {
    transform: scaleX(1);
}

.card-modern:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    background: var(--white);
    border-color: rgba(26, 115, 232, 0.2);
}

.card-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin-bottom: 1rem;
    color: var(--primary-color);
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
}

.card-text {
    color: var(--text-secondary);
    line-height: 1.8;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
}

/* ============================================
   Skills Section
   ============================================ */

.skill-item {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border-left: 4px solid var(--secondary-color);
}

.skill-item:hover {
    transform: translateX(10px);
    box-shadow: var(--shadow-md);
    border-left-color: var(--accent-color);
}

.skill-category {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--light-bg);
}

.skill-tag {
    display: inline-block;
    background: rgba(26, 115, 232, 0.1);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    margin: 0.5rem 0.5rem 0.5rem 0;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(26, 115, 232, 0.2);
}

.skill-tag:hover {
    transform: translateY(-2px);
    background: rgba(26, 115, 232, 0.3);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

/* ============================================
   Project Cards
   ============================================ */

.project-card {
    background: var(--white);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(26, 115, 232, 0.2);
}

.project-header {
    background: var(--gradient-primary);
    color: var(--white);
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.project-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
}

.project-role {
    font-size: 0.9rem;
    opacity: 0.9;
}

.project-body {
    padding: 1.5rem;
    flex-grow: 1;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tech-badge {
    background: rgba(26, 115, 232, 0.15);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(26, 115, 232, 0.3);
    display: inline-block;
}

.project-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.project-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.project-link:hover {
    color: var(--accent-color);
    transform: translateX(5px);
}

/* ============================================
   Services Section
   ============================================ */

.service-card {
    text-align: center;
    padding: 2rem;
    background: var(--white);
    border-radius: 15px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    height: 100%;
}

.service-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.service-list {
    list-style: none;
    text-align: left;
    margin-top: 1rem;
}

.service-list li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: 1.5rem;
}

.service-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

/* ============================================
   Contact Section
   ============================================ */

.contact-section {
    background: var(--gradient-primary);
    color: var(--white);
    padding: 5rem 0;
}

.contact-info {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.contact-item > div:last-child {
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.contact-item a {
    word-break: break-all;
    overflow-wrap: anywhere;
}

.contact-icon {
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

.contact-form {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow-xl);
}

.form-control-custom {
    border: 2px solid var(--light-bg);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.form-control-custom:focus {
    border-color: var(--secondary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.alert {
    border-radius: 10px;
    border: none;
    padding: 1rem 1.5rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
}

.text-danger {
    color: #dc3545 !important;
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #dc3545;
}

/* Validation styles - only show when form is validated */
.was-validated .form-control:invalid,
.was-validated .form-control.is-invalid,
.form-control.is-invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 3.6 .4.4.4-.4m0 4.8-.4-.4-.4.4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.was-validated .form-control:valid,
.was-validated .form-control.is-valid,
.form-control.is-valid {
    border-color: #28a745;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Hide invalid feedback by default */
.invalid-feedback {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #dc3545;
}

.valid-feedback {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #28a745;
}

/* Show invalid feedback only when form is validated and field is invalid */
.was-validated .form-control:invalid ~ .invalid-feedback,
.was-validated .form-control.is-invalid ~ .invalid-feedback,
.form-control.is-invalid ~ .invalid-feedback {
    display: block;
}

/* Show valid feedback only when form is validated and field is valid */
.was-validated .form-control:valid ~ .valid-feedback,
.form-control.is-valid ~ .valid-feedback {
    display: block;
}

/* Hide server-side validation spans by default, show only when there's an error */
span[asp-validation-for] {
    display: none;
}

span[asp-validation-for].text-danger:not(:empty),
span.text-danger.invalid-feedback:not(:empty) {
    display: block !important;
}

/* ============================================
   Footer
   ============================================ */

.footer {
    background: var(--dark-bg);
    color: var(--white);
    padding: 2rem 0;
    text-align: center;
}

.footer a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: var(--accent-color);
}

/* ============================================
   Animations
   ============================================ */

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.animate-on-scroll {
    opacity: 0;
    transition: all 0.5s ease-out;
    transform: translateY(20px);
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
    animation: fadeInUp 0.5s ease-out;
}

.testimonial-card {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.testimonial-content {
    flex-grow: 1;
    margin-bottom: 1.5rem;
}

.testimonial-author {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding-top: 1rem;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.about-highlights,
.experience-areas {
    margin-bottom: 1.5rem;
}

/* ============================================
   Responsive Design - Comprehensive Breakpoints
   ============================================ */

/* Base Mobile First - Extra Small Devices (phones, < 576px) */
@media (max-width: 575.98px) {
    html {
        font-size: 14px;
    }

    body {
        padding-top: 60px;
    }

    /* Navigation */
    .navbar {
        padding: 0.5rem 0;
    }

    .navbar-brand {
        font-size: 1rem;
        padding: 0.25rem 0;
    }

    .navbar-toggler {
        padding: 0.25rem 0.5rem;
        font-size: 1rem;
    }

    .nav-link {
        padding: 0.75rem 1rem !important;
        margin: 0;
        text-align: center;
    }

    /* Hero Section */
    .hero-section {
        min-height: 70vh;
        padding: 2rem 1rem;
    }

    .hero-title {
        font-size: 1.75rem;
        margin-bottom: 0.75rem;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1rem;
        line-height: 1.4;
    }

    .hero-intro {
        font-size: 0.9rem;
        margin: 0 auto 1.5rem;
        padding: 0 1rem;
        line-height: 1.6;
    }

    .hero-highlights {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        margin-top: 1.5rem;
        padding: 0 1rem;
    }

    .highlight-badge {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        text-align: center;
    }

    /* Buttons */
    .btn-primary-custom,
    .btn-outline-custom {
        padding: 0.625rem 1.5rem;
        font-size: 0.9rem;
        width: 100%;
        margin: 0.25rem 0;
        display: block;
        text-align: center;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
        padding: 0 1rem;
    }

    .hero-buttons .me-3 {
        margin-right: 0 !important;
    }

    /* Sections */
    .section {
        padding: 2.5rem 0;
    }

    .section-title {
        font-size: 1.75rem;
        margin-bottom: 0.75rem;
        padding: 0 1rem;
    }

    .section-subtitle {
        font-size: 0.95rem;
        padding: 0 1rem;
        margin-bottom: 2rem;
    }

    /* Cards */
    .card-modern {
        padding: 1.25rem;
        margin-bottom: 1rem;
    }

    .card-title {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }

    .card-text {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    /* Skills */
    .skill-item {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }

    .skill-category {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }

    .skill-tag {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
        margin: 0.4rem 0.4rem 0.4rem 0;
    }

    /* Projects */
    .project-card {
        margin-bottom: 1.5rem;
    }

    .project-header {
        padding: 1rem;
    }

    .project-title {
        font-size: 1.25rem;
    }

    .project-role {
        font-size: 0.85rem;
    }

    .project-body {
        padding: 1rem;
    }

    .project-tech {
        gap: 0.4rem;
    }

    .tech-badge {
        font-size: 0.75rem;
        padding: 0.2rem 0.6rem;
    }

    /* Services */
    .service-card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .service-icon {
        font-size: 2.5rem;
    }

    .service-list {
        font-size: 0.9rem;
    }

    /* Contact */
    .contact-section {
        padding: 2.5rem 0;
    }

    .contact-info {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .contact-item {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
        margin-bottom: 1.25rem;
    }

    .contact-icon {
        width: 45px;
        height: 45px;
        font-size: 1.25rem;
    }

    .contact-form {
        padding: 1.5rem;
    }

    .form-control-custom {
        padding: 0.625rem 0.875rem;
        font-size: 0.9rem;
    }

    .form-label {
        font-size: 0.9rem;
    }

    /* Container adjustments */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Row adjustments */
.row {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    gap: 30px;
}

.row > * {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

    /* Prevent horizontal overflow */
    * {
        max-width: 100%;
    }

    /* Fix for Bootstrap columns */
    [class*="col-"] {
        width: 100%;
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Ensure all text wraps properly */
    h1, h2, h3, h4, h5, h6, p, span, div, a, li {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }

    /* Fix for long URLs and emails */
    a[href^="http"], a[href^="mailto"] {
        word-break: break-all;
        overflow-wrap: anywhere;
        display: inline-block;
        max-width: 100%;
    }

    /* Fix container padding */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Small Devices (tablets portrait, ≥ 576px) */
@media (min-width: 576px) and (max-width: 767.98px) {
    html {
        font-size: 15px;
    }

    body {
        padding-top: 70px;
    }

    /* Ensure text wrapping */
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    /* Fix long text */
    a[href^="http"], a[href^="mailto"] {
        word-break: break-all;
        overflow-wrap: anywhere;
    }

    /* Navigation */
    .navbar-brand {
        font-size: 1.15rem;
    }

    /* Hero Section */
    .hero-section {
        min-height: 75vh;
        padding: 3rem 1.5rem;
    }

    .hero-title {
        font-size: 2.25rem;
    }

    .hero-subtitle {
        font-size: 1.15rem;
    }

    .hero-intro {
        font-size: 1rem;
        padding: 0 1.5rem;
    }

    .hero-highlights {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .highlight-badge {
        padding: 0.625rem 1.25rem;
        font-size: 0.9rem;
    }

    /* Buttons */
    .btn-primary-custom,
    .btn-outline-custom {
        padding: 0.7rem 1.75rem;
        font-size: 0.95rem;
        display: inline-block;
        width: auto;
    }

    .hero-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Sections */
    .section {
        padding: 3.5rem 0;
    }

    .section-title {
        font-size: 2.15rem;
    }

    .section-subtitle {
        font-size: 1.05rem;
    }

    /* Cards */
    .card-modern {
        padding: 1.75rem;
    }

    /* Contact */
    .contact-section {
        padding: 3.5rem 0;
    }

    .contact-info {
        padding: 1.75rem;
    }

    .contact-form {
        padding: 1.75rem;
    }
}

/* Medium Devices (tablets landscape, ≥ 768px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    html {
        font-size: 15px;
    }

    /* Ensure text wrapping */
    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }

    /* Hero Section */
    .hero-section {
        min-height: 80vh;
        padding: 3.5rem 2rem;
    }

    .hero-title {
        font-size: 2.75rem;
    }

    .hero-subtitle {
        font-size: 1.3rem;
    }

    .hero-intro {
        font-size: 1.05rem;
    }

    /* Sections */
    .section {
        padding: 4rem 0;
    }

    .section-title {
        font-size: 2.35rem;
    }

    /* Navigation */
    .nav-link {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.95rem;
    }
}

/* Large Devices (desktops, ≥ 992px) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    html {
        font-size: 16px;
    }

    .hero-section {
        min-height: 85vh;
    }

    .hero-title {
        font-size: 3.25rem;
    }

    .hero-subtitle {
        font-size: 1.4rem;
    }

    .section {
        padding: 4.5rem 0;
    }

    .section-title {
        font-size: 2.4rem;
    }
}

/* Extra Large Devices (large desktops, ≥ 1200px) */
@media (min-width: 1200px) {
    html {
        font-size: 16px;
    }

    .hero-section {
        min-height: 90vh;
    }

    .hero-title {
        font-size: 3.5rem;
    }

    .hero-subtitle {
        font-size: 1.5rem;
    }

    .section {
        padding: 5rem 0;
    }

    .section-title {
        font-size: 2.5rem;
    }

    .container {
        max-width: 1140px;
    }
}

/* Extra Extra Large Devices (≥ 1400px) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/* Additional responsive fixes for all screen sizes */
@media (max-width: 1399.98px) {
    /* Ensure containers don't overflow */
    .container {
        width: 100%;
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Fix for very long words */
    * {
        overflow-wrap: break-word;
        word-wrap: break-word;
    }
}

/* Landscape Orientation Fixes */
@media (orientation: landscape) and (max-height: 500px) {
    .hero-section {
        min-height: 100vh;
        padding: 2rem 0;
    }

    .hero-title {
        font-size: 2rem;
        margin-bottom: 0.5rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .hero-intro {
        font-size: 0.95rem;
        margin-bottom: 1rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .hero-highlights {
        margin-top: 1rem;
        gap: 0.75rem;
    }
}

/* Fix for very wide screens to prevent text from being too spread out */
@media (min-width: 1920px) {
    .container {
        max-width: 1400px;
    }
    
    .hero-intro {
        max-width: 900px;
    }
    
    .section-subtitle {
        max-width: 900px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn-primary-custom,
    .btn-outline-custom {
        min-height: 44px;
        min-width: 44px;
    }

    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .card-modern:hover,
    .project-card:hover,
    .service-card:hover {
        transform: none;
    }

    .skill-item:hover {
        transform: none;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .footer,
    .btn-primary-custom,
    .btn-outline-custom {
        display: none;
    }

    .section {
        page-break-inside: avoid;
        padding: 1rem 0;
    }
}

/* ============================================
   Utility Classes
   ============================================ */

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: var(--gradient-primary);
}

.bg-gradient-accent {
    background: var(--gradient-accent);
}

.bg-light {
    background-color: #f1f5f9 !important;
}

.shadow-custom {
    box-shadow: var(--shadow-lg);
}

/* ============================================
   Utility Classes
   ============================================ */

.mt-5 {
    margin-top: 3rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.mt-4 {
    margin-top: 1.5rem !important;
}

.mt-3 {
    margin-top: 1rem !important;
}

.mt-2 {
    margin-top: 0.5rem !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.text-center {
    text-align: center !important;
}

.text-start {
    text-align: left !important;
}

.text-white {
    color: var(--white) !important;
}

.d-grid {
    display: grid !important;
}

.me-3 {
    margin-right: 1rem !important;
}

/* ============================================
   Floating Contact Button (Desktop Only)
   ============================================ */

.floating-contact-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #1A73E8 0%, #0D47A1 100%);
    color: #ffffff !important;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    animation: floatPulse 3s ease-in-out infinite;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.floating-contact-btn span {
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.floating-contact-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    color: #ffffff !important;
    background: linear-gradient(135deg, #1A73E8 0%, #0D47A1 100%);
}

.floating-contact-btn:hover span {
    color: #ffffff !important;
}

.floating-contact-btn span {
    display: inline-block;
}

@keyframes floatPulse {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Hide floating button on mobile devices */
@media (max-width: 991.98px) {
    .floating-contact-btn {
        display: none !important;
    }
}

/* Additional fixes for text overflow prevention */
table {
    width: 100%;
    table-layout: auto;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

table td, table th {
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Fix for pre and code blocks */
pre, code {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    max-width: 100%;
    overflow-x: auto;
}

/* Ensure buttons don't overflow */
button, .btn, .btn-primary-custom, .btn-outline-custom {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    max-width: 100%;
}

/* Fix for navbar on very small screens */
@media (max-width: 400px) {
    .navbar-brand {
        font-size: 0.9rem;
    }
    
    .nav-link {
        font-size: 0.85rem;
        padding: 0.5rem 0.5rem !important;
    }
}
