html,
body {
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background: #f8fafc;
    color: #1e293b;
    overflow-x: hidden;
    position: relative;
}

html {
    scrollbar-gutter: stable;
}

body.modal-open {
    overflow: hidden;
    height: 100%;
}

.header {
    position: sticky;
    top: 0;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    height: auto;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}


.footer {
    background: white;
    border-top: 1px solid #e2e8f0;
}

.nav-link {
    position: relative;
}

#email-address {
    font-size: clamp(1rem, 3vw, 1.4rem);
}

@media (max-width: 640px) {
    #email-address {
        font-size: 1rem;
    }
}

.nav-link:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: #0891B2;
    transition: width 0.3s ease;
}

.nav-link:hover:after {
    width: 100%;
}

.email-generator {
    background: white;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.email-generator:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.email-input {
    border: 2px solid #e2e8f0;
    transition: all 0.2s ease;
}

.email-input:focus-within {
    border-color: #c7d2fe;
    box-shadow: 0 0 0 3px rgba(199, 210, 254, 0.3);
}

.btn-primary {
    background: #0891B2;
    color: white;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: #0891B2;
    transform: translateY(-1px);
}

.tab-active {
    border-bottom: 2px solid #0891B2;
    color: #0891B2;
    font-weight: 500;
}

.email-item {
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.email-item:hover {
    border-left-color: #0891B2;
    background: #f8fafc;
}

.email-item.unread {
    background: #f0f4ff;
}

.email-content {
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

/* Mobile Menu Styles */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1000;
    transform: translateX(0);
}

.mobile-menu.open {
    right: 0;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 640px) {

    /* Ensure padding doesn't cause overflow */
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    /* Fix for any potentially overflowing elements */
    .email-generator,
    .email-input,
    .email-generator-buttons {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Prevent text from causing overflow */
    #email-address,
    .nav-link {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: -1;
}

.modal-content {
    background: white;
    border-radius: 0.75rem;
    width: 90%;
    max-width: 28rem;
    padding: 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: translateY(0);
}

/* New Feature Section Styles */
.feature-card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    overflow: hidden;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 1.5rem;
}

/* FAQ Styles */
.faq-item {
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.faq-question {
    padding: 1.25rem 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 300px;
    padding-bottom: 1.25rem;
}

/* Blog Card Styles */
.blog-card {
    transition: all 0.3s ease;
    border-radius: 0.5rem;
    overflow: hidden;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Gradient Background */
.gradient-bg {
    background: linear-gradient(135deg, #0891B2 0%, #7c3aed 100%);
}

/* Section Padding */
.section-padding {
    padding: 5rem 0;
}

@media (max-width: 640px) {
    .email-generator-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }

    .email-generator-buttons button {
        width: 100%;
        max-width: none;
    }

    .inbox-tabs {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
    }

    .inbox-tabs::-webkit-scrollbar {
        display: none;
    }

    .inbox-tabs button {
        display: inline-block;
        white-space: nowrap;
    }

    .section-padding {
        padding: 3rem 0;
    }
}

/* New styles for hero section ads */
.hero-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding-top: 64px;
    /* match the header height */
}

.hero-with-ads {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.hero-content {
    flex: 1;
    max-width: 800px;
}

@media (max-width: 1024px) {
    .hero-ads {
        display: none;
    }
}

@media (max-width: 1024px) {
    .ad-container.vertical {
        height: 400px;
    }
}

.nav-link.active {
    color: #0891B2;
    font-weight: 500;
}

.nav-link.active:after {
    width: 100%;
}

/* New Footer Styles */
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.footer-links-title {
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1e293b;
}

.footer-link {
    display: block;
    margin-bottom: 0.5rem;
    color: #64748b;
    transition: color 0.2s;
}

.footer-link:hover {
    color: #0891B2;
}

.newsletter-input {
    border: 1px solid #cbd5e1;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    width: 100%;
    margin-bottom: 0.75rem;
}

.newsletter-btn {
    background: #0891B2;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    width: 100%;
    transition: background 0.2s;
}

.newsletter-btn:hover {
    background: #0891B2;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    transition: all 0.2s;
    margin-right: 0.5rem;
}

.social-icon:hover {
    background: #0891B2;
    color: white;
}

.adblock-notification {
    margin-bottom: 1.5rem;
}

.adblock-notification .flex {
    display: flex;
}

.adblock-notification .flex-shrink-0 {
    flex-shrink: 0;
}

.adblock-notification .ml-3 {
    margin-left: 0.75rem;
}

.adblock-notification .text-red-800 {
    color: #991b1b;
}

.adblock-notification .text-red-700 {
    color: #b91c1c;
}

.adblock-notification button {
    background-color: #dc2626;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.adblock-notification button:hover {
    background-color: #b91c1c;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 4px solid #cbd5e1;
    border-top-color: #0ea5e9;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 640px) {
    .hero-container {
        padding-top: 72px;
    }
}

@media (min-width: 641px) {
    .hero-container {
        padding-top: 88px;
    }
}

.header .flex {
    height: auto !important;
    min-height: 64px;
    align-items: center;
    justify-content: space-between;
}

.header img {
    width: auto !important;
    height: 48px;
    object-fit: contain;
}

#single-email {
    max-height: 600px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#single-email .email-content {
    overflow-x: auto;
    word-wrap: break-word;
}