/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Prevent tap highlight on iOS Safari */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* Prevent text selection on non-editable elements (iOS Safari) */
body {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow text selection on input fields and textareas */
input,
textarea,
[contenteditable="true"] {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

:root {
    --primary-color: #2980b9;
    --secondary-color: #27ae60;
    --accent-color: #c0392b;
    --text-color: #2c3e50;
    --text-light: #5d6d7e;
    --bg-color: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-card: #ffffff;
    --border-color: #dfe6e9;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

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

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

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

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color);
}

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

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

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

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

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: var(--primary-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1001;
    transition: var(--transition);
}

.theme-toggle:hover {
    background-color: #2980b9;
    transform: scale(1.1);
}

/* Hero Section */
/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 80px 0 40px;
    background: radial-gradient(circle at top right, #f5f7fa 0%, #c3cfe2 100%);
    position: relative;
    overflow: hidden;
}

/* Add a subtle Pattern to Hero */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%239C92AC' fill-opacity='0.15'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.greeting {
    display: block;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.name {
    display: block;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.typing-text {
    display: block;
    color: var(--secondary-color);
    min-height: 1.2em;
}

.hero-subtitle {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: var(--text-light);
}

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

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

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

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(41, 128, 185, 0.3);
}

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

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(41, 128, 185, 0.3);
}

/* Hero social links - inline horizontal layout */
.hero-content>a.social-link {
    display: inline-flex;
    margin-right: 0.75rem;
}

.hero-content>a.social-link:last-of-type {
    margin-right: 0;
}

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

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(52, 152, 219, 0.1);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: var(--transition);
}

.social-link:hover {
    background-color: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

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

.profile-image {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow-lg);
    border: 4px solid var(--bg-card);
    transition: var(--transition);
    /* Ensure image is strictly centered if container is larger */
    display: block;
    margin: 0 auto;
}

.profile-image:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Section Styles */
section {
    padding: 80px 0;
    position: relative;
    overflow: hidden;
    /* For background decorations */
}

/* Add exciting background to sections */
.section-bg-decoration {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(41, 128, 185, 0.05) 0%, rgba(255, 255, 255, 0) 70%);
    z-index: 0;
    pointer-events: none;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 4rem;
    color: var(--text-color);
    position: relative;
    z-index: 1;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* About Section */
.about {
    background-color: var(--bg-secondary);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 1;
}

.about-text p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--text-light);
}

.personal-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
    text-align: left;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--bg-card);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

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

/* Timeline */
.timeline {
    position: relative;
    max-width: 1000px;
    /* Increased width */
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    /* Thicker line */
    height: 100%;
    background-color: var(--border-color);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 4rem;
    width: 100%;
    min-height: 150px;
    /* Ensure space for logos */
}

/* Timeline Content Box */
.timeline-content {
    position: relative;
    background-color: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.06);
    width: calc(50% - 40px);
    /* Responsive width allowing 40px gap from center */
    transition: var(--transition);
    z-index: 2;
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
}

/* Timeline Logo (Background Element) */
.timeline-logo {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: calc(50% - 40px);
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
    animation-delay: 0.2s;
    height: 100%;
    /* Use height to vertical align */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-50%) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}

/* Style for logo images */
.timeline-logo img {
    max-width: 200px;
    /* Limit size */
    max-height: 150px;
    object-fit: contain;
    opacity: 0.8;
    /* Subtle opacity */
    filter: grayscale(20%);
    /* Slight blending */
    transition: var(--transition);
}

.timeline-item:hover .timeline-logo img {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.05);
}

.timeline-logo i {
    font-size: 8rem;
    /* Fallback for icons if any left */
    color: var(--primary-color);
    opacity: 0.1;
}

/* Odd Items (Left Content, Right Logo) */
.timeline-item:nth-child(odd) .timeline-content {
    left: 0;
    text-align: right;
    border-right: 4px solid var(--primary-color);
    /* Accent */
}

.timeline-item:nth-child(odd) .timeline-logo {
    left: 50%;
    margin-left: 40px;
    justify-content: flex-start;
    /* Place closer to center? */
    padding-left: 40px;
}

/* Even Items (Right Content, Left Logo) */
.timeline-item:nth-child(even) .timeline-content {
    left: 50%;
    margin-left: 40px;
    /* Offset from center */
    border-left: 4px solid var(--primary-color);
    /* Accent */
}

.timeline-item:nth-child(even) .timeline-logo {
    left: 0;
    justify-content: flex-end;
    padding-right: 40px;
}

/* Adjust lists inside timeline */
.timeline-item:nth-child(odd) .timeline-content ul {
    text-align: right;
}

.timeline-item:nth-child(odd) .timeline-content ul li {
    padding-right: 1.5rem;
    padding-left: 0;
}

.timeline-item:nth-child(odd) .timeline-content ul li::before {
    left: auto;
    right: 0;
}

.timeline-dot {
    position: absolute;
    top: 2rem;
    /* Align with top of box approx */
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--bg-color);
    border: 4px solid var(--primary-color);
    z-index: 3;
    box-shadow: 0 0 0 4px rgba(41, 128, 185, 0.2);
}

.timeline-date {
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.timeline-content h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 700;
}

.timeline-content h4 {
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 1rem;
    font-style: italic;
}

.timeline-content ul {
    list-style: none;
    text-align: left;
}

.timeline-content ul li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-light);
    line-height: 1.5;
}

.timeline-content ul li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

/* Skills Section */
.skills {
    background-color: var(--bg-secondary);
}

.skills-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    background-color: transparent;
    border-radius: 25px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.filter-btn.active,
.filter-btn:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.skills-category {
    margin-bottom: 3rem;
}

.skills-category h3 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

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

.skill-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.skill-name {
    font-weight: 600;
    color: var(--text-color);
}

.skill-level {
    color: var(--primary-color);
    font-weight: 500;
}

.skill-bar {
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

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

.skill-details {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Projects Section */
.projects-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

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

.project-card {
    background-color: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.project-image {
    height: 200px;
    background-color: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.project-placeholder {
    font-size: 3rem;
    color: var(--text-light);
}

.project-content {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.project-description {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

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

.tech-tag {
    padding: 4px 8px;
    background-color: rgba(52, 152, 219, 0.1);
    color: var(--primary-color);
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.project-link:hover {
    color: #2980b9;
}

/* Contact Section */
.contact {
    background-color: var(--bg-secondary);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: 900px;
    margin: 0 auto;
}

.contact-info h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.contact-info p {
    margin-bottom: 2rem;
    color: var(--text-light);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

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

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

.contact-item a:hover {
    color: var(--primary-color);
}

.contact-social {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.contact-form {
    background-color: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

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

/* Footer */
.footer {
    background-color: var(--text-color);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

/* Responsive Design */
/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--bg-color);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow-lg);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-toggle {
        display: flex;
        margin-right: 50px;
        /* Space for theme toggle */
    }

    .theme-toggle {
        position: fixed;
        top: 18px;
        right: 15px;
        width: 36px;
        height: 36px;
    }

    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
        gap: 1rem;
    }

    /* Hero social links horizontal on mobile */
    .hero-content>a.social-link {
        display: inline-flex;
        margin-right: 1rem;
    }

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

    .profile-image {
        width: 250px;
        height: 250px;
    }

    .timeline::before {
        left: 30px;
    }

    .timeline-item:nth-child(odd) .timeline-content,
    .timeline-item:nth-child(even) .timeline-content {
        left: 60px;
        width: calc(100% - 80px);
        /* Adjust width to fit */
        text-align: left;
        padding: 2rem;
        /* Keep padding consistent */
        margin-left: 0;
        /* Reset margin */
        border: none;
        border-left: 4px solid var(--primary-color);
        /* Consistent border for mobile */
    }

    /* Reset specific odd/even overrides */
    .timeline-item:nth-child(odd) .timeline-content ul,
    .timeline-item:nth-child(even) .timeline-content ul {
        text-align: left !important;
    }

    .timeline-item:nth-child(odd) .timeline-content ul li,
    .timeline-item:nth-child(even) .timeline-content ul li {
        padding-left: 1.5rem;
        padding-right: 0;
    }

    .timeline-item:nth-child(odd) .timeline-content ul li::before,
    .timeline-item:nth-child(even) .timeline-content ul li::before {
        left: 0;
        right: auto;
    }

    /* Hide huge logos on mobile */
    .timeline-logo {
        display: none;
    }

    .timeline-dot {
        left: 30px;
    }

    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .nav-container {
        padding: 1rem 15px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .greeting {
        font-size: 1.2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
        padding: 14px 24px;
    }

    /* Social links row on very small screens */
    .hero-content>a.social-link {
        margin-right: 0.75rem;
        margin-bottom: 0;
    }

    .profile-image {
        width: 200px;
        height: 200px;
    }
}

/* Utility Classes */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--bg-card);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    text-align: center;
    position: relative;
    animation: slideInUp 0.3s ease;
}

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

.modal-content p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.8rem;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
}

.modal-close:hover {
    color: var(--accent-color);
}

.recaptcha-container,
.recaptcha-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
    overflow: visible;
}

.recaptcha-wrapper {
    margin-top: 0.5rem;
}

/* Fix reCAPTCHA container sizing */
.g-recaptcha {
    display: flex;
    justify-content: center;
}

/* Modal button */
.modal-content .btn {
    width: 100%;
    justify-content: center;
}

.modal-content .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Mobile reCAPTCHA improvements */
@media (max-width: 480px) {
    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }

    .recaptcha-container,
    .recaptcha-wrapper {
        transform: scale(0.9);
        transform-origin: center center;
        overflow: visible;
        -webkit-overflow-scrolling: touch;
    }

    /* Ensure the g-recaptcha div allows touch */
    .g-recaptcha {
        transform-origin: center center;
    }

    /* Make sure reCAPTCHA challenge popup works */
    .g-recaptcha>div {
        margin: 0 auto;
    }
}

/* Small devices */
@media (max-width: 400px) {

    .recaptcha-container,
    .recaptcha-wrapper {
        transform: scale(0.85);
        transform-origin: center center;
    }
}

/* Extra small devices - reCAPTCHA needs more scaling */
@media (max-width: 360px) {

    .recaptcha-container,
    .recaptcha-wrapper {
        transform: scale(0.77);
        transform-origin: center center;
    }

    .modal-content {
        padding: 1rem;
        margin: 0.5rem;
    }
}

/* Ensure reCAPTCHA iframe is touchable on mobile */
.recaptcha-container,
.recaptcha-wrapper,
.g-recaptcha,
.g-recaptcha>div,
.g-recaptcha iframe {
    pointer-events: auto !important;
    touch-action: auto !important;
    -webkit-touch-callout: default !important;
    -webkit-user-select: auto !important;
    user-select: auto !important;
}

/* Fix z-index for reCAPTCHA challenge popup */
body>div[style*="z-index"] {
    z-index: 9999999 !important;
}