/* Marketing Email Generator - Main Stylesheet */
/* Optimized for performance and SEO */

:root {
    --primary-color: #8B5CF6;
    --primary-dark: #7C3AED;
    --secondary-color: #764ba2;
    --success-color: #10B981;
    --success-dark: #059669;
    --error-color: #DC2626;
    --text-primary: #333333;
    --text-secondary: #666666;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --border-color: #e1e5e9;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-accent: linear-gradient(45deg, #FFD700, #FFA500);
    --gradient-button: linear-gradient(45deg, #8B5CF6, #7C3AED);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --border-radius-lg: 20px;
    --transition: all 0.3s ease;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--gradient-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 0;
    animation: fadeInDown 0.8s ease;
}

.badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: pulse 2s infinite;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    color: white;
    margin-bottom: 20px;
    line-height: 1.1;
}

.highlight {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding: 0 8px;
}

.subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin: 0 auto;
}

/* Breadcrumb Navigation */
.breadcrumb {
    margin-top: 20px;
}

.breadcrumb ol {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.8);
}

.breadcrumb li::after {
    content: "›";
    margin-left: 10px;
}

.breadcrumb li:last-child::after {
    content: "";
}

.breadcrumb a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb a:hover {
    color: white;
}

/* Main Content Grid */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 40px;
    animation: fadeInUp 0.8s ease;
}

/* Form and Result Sections */
.form-section, 
.result-section {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
}

.form-section h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.form-section p {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 1.1rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 1rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: var(--transition);
    background: var(--bg-secondary);
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

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

/* Buttons */
.submit-btn {
    width: 100%;
    background: var(--gradient-button);
    color: white;
    border: none;
    padding: 18px 30px;
    border-radius: var(--border-radius);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Result Section */
.result-section {
    background: var(--bg-secondary);
}

.result-section h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.email-output {
    background: var(--bg-primary);
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    padding: 25px;
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    max-height: 500px;
    overflow-y: auto;
    box-shadow: inset var(--shadow-sm);
}

.copy-btn {
    margin-top: 15px;
    background: var(--success-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.copy-btn:hover {
    background: var(--success-dark);
    transform: translateY(-1px);
}

/* Message Styles */
.error-message,
.success-message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
    animation: slideInLeft 0.5s ease;
}

.error-message {
    background: #FEE2E2;
    border: 1px solid #FECACA;
    color: var(--error-color);
}

.success-message {
    background: #D1FAE5;
    border: 1px solid #A7F3D0;
    color: #065F46;
}

/* Features Section */
.features {
    margin-top: 60px;
    text-align: center;
    animation: fadeIn 1s ease;
}

.features h2 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 40px;
    font-weight: 700;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
}

.feature-card h3 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.feature-card p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
}

/* SEO Content Section */
.seo-content {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 40px;
    margin-top: 40px;
    margin-bottom: 0;
    box-shadow: var(--shadow-md);
}

.seo-content h2 {
    color: var(--text-primary);
    font-size: 2rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.seo-content p {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Loading Animation */
.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.loading.active {
    display: block;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* AdSense Container Styles */
.ad-container {
    margin: 30px auto;
    text-align: center;
    min-height: 90px;
    background: #f9f9f9;
    border-radius: 8px;
    padding: 10px;
    position: relative;
    clear: both;
    overflow: hidden;
}

.ad-container::before {
    content: "Advertisement";
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: #999;
    background: white;
    padding: 0 5px;
    z-index: 1;
}

/* Ensure ads don't overflow */
.ad-container ins {
    max-width: 100% !important;
    height: auto !important;
}

.ad-header {
    max-width: 970px;
    margin: 30px auto 40px;
    min-height: 90px;
}

.ad-middle {
    max-width: 728px;
    margin: 50px auto;
    min-height: 90px;
}

.ad-sidebar {
    max-width: 300px;
    min-height: 250px;
}

.ad-footer {
    max-width: 970px;
    margin: 30px auto 20px;
    background: transparent;
    min-height: 90px;
}

.ad-in-article {
    max-width: 336px;
    margin: 40px auto;
    min-height: 280px;
}

.ad-matched-content {
    max-width: 1200px;
    margin: 50px auto;
    min-height: 200px;
}

.ad-in-feed {
    margin: 30px 0;
    min-height: 100px;
}

/* AdSense Wrapper and Container Styles */
.ad-wrapper {
    width: 100%;
    clear: both;
    position: relative;
    z-index: 10;
    margin: 0;
    padding: 20px 0;
}

.ad-container {
    margin: 0 auto;
    text-align: center;
    min-height: 90px;
    background: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    position: relative;
    clear: both;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ad-container::before {
    content: "Advertisement";
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: #999;
    background: white;
    padding: 0 8px;
    z-index: 1;
}

/* Ensure ads don't overflow */
.ad-container ins {
    max-width: 100% !important;
    height: auto !important;
}

/* Specific ad placements */
.ad-header {
    max-width: 970px;
    margin: 0 auto;
    min-height: 90px;
}

.ad-middle {
    max-width: 728px;
    margin: 0 auto;
    min-height: 90px;
}

.ad-sidebar {
    max-width: 300px;
    margin: 0 auto;
    min-height: 250px;
}

.ad-footer {
    max-width: 970px;
    margin: 0 auto;
    background: transparent;
    min-height: 90px;
}

.ad-in-article {
    max-width: 336px;
    margin: 0 auto;
    min-height: 280px;
}

.ad-matched-content {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 200px;
}

.ad-in-feed {
    margin: 0 auto;
    min-height: 100px;
}

/* Ad spacing between sections */
.header + .ad-wrapper {
    margin-top: 20px;
    margin-bottom: 30px;
}

.main-content + .ad-wrapper {
    margin-top: 40px;
    margin-bottom: 40px;
}

.features + .ad-wrapper {
    margin-top: 30px;
    margin-bottom: 30px;
}

/* Prevent ad overlap with content */
.adsbygoogle {
    display: block !important;
    width: 100%;
}

/* Footer Styles - Simple Dark Footer */
.site-footer {
    background: #1f2937;
    color: white;
    margin-top: auto;
    padding: 0;
    clear: both;
    width: 100%;
}

/* Footer Ad Wrapper */
.footer-ad-wrapper {
    background: #f9fafb;
    padding: 20px 0;
    border-bottom: 1px solid #e5e7eb;
}

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

.footer-ad-wrapper .ad-container {
    background: transparent;
    margin: 0 auto;
}

/* Footer Container */
.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 30px;
    text-align: center;
}

/* Footer Navigation - Horizontal Layout Centered */
.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 20px;
    text-align: center;
}

.footer-nav a {
    color: white !important;
    text-decoration: none;
    font-size: 15px;
    transition: color 0.3s ease;
    padding: 5px 10px;
    display: inline-block;
}

.footer-nav a:hover {
    opacity: 0.8;
  	text-decoration: underline;
  	color: white !important;
}

/* Separator between links */
.footer-nav a:not(:last-child)::after {
    content: "";
    display: inline-block;
    width: 1px;
    height: 12px;
    background: rgba(255, 255, 255, 0.3);
    margin-left: 20px;
    vertical-align: middle;
}

/* Footer Copyright */
.footer-copyright {
    text-align: center;
  	color: white !important;
}

.footer-copyright p {
    color: white !important;
    font-size: 14px;
    margin: 0;
    text-align: center;
}

/* Scrollbar Styles */
.email-output::-webkit-scrollbar {
    width: 8px;
}

.email-output::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.email-output::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.email-output::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Accessibility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus Visible */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .header,
    .features,
    .seo-content,
    .submit-btn,
    .copy-btn {
        display: none;
    }
    
    .main-content {
        grid-template-columns: 1fr;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        padding: 15px;
    }
    
    .footer-nav {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .form-section, 
    .result-section {
        padding: 25px;
        border-radius: 16px;
    }

    .header {
        padding: 20px 0;
    }

    h1 {
        font-size: 2.5rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .feature-card {
        padding: 25px;
    }
    
    .breadcrumb ol {
        font-size: 0.9rem;
    }
    
    /* Footer Mobile Styles - Keep Centered */
	@media (max-width: 768px) {
	    .footer-nav {
	        flex-direction: column;
	        gap: 10px;
	        padding-bottom: 25px;
	    }
    
    .footer-nav a {
        display: block;
        padding: 8px 0;
        width: 100%;
        text-align: center;
    }
    
    /* Remove separators on mobile */
    .footer-nav a:not(:last-child)::after {
        display: none;
    }
    
    /* Ad Mobile Styles */
    .ad-wrapper {
        padding: 15px 0;
    }
    
    .ad-container {
        margin: 0 10px;
        padding: 10px;
    }
    
    .ad-header,
    .ad-middle,
    .ad-footer,
    .ad-in-article {
        max-width: 100%;
        min-height: 60px;
    }
}

@media (max-width: 480px) {
    .form-section, 
    .result-section {
        padding: 20px;
    }

    h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .form-group input,
    .form-group textarea {
        padding: 12px;
        font-size: 14px;
    }

    .submit-btn {
        padding: 15px 25px;
        font-size: 16px;
    }
    
    .seo-content {
        padding: 25px;
    }
    
    .seo-content h2 {
        font-size: 1.5rem;
    }
    
    .email-output {
        padding: 15px;
        font-size: 12px;
    }
    
    /* Footer Mobile Styles */
    .footer-container {
        padding: 30px 15px 20px;
        text-align: center;
    }
    
    .footer-nav {
        gap: 8px;
        padding-bottom: 20px;
    }
    
    .footer-nav a {
        font-size: 14px;
        padding: 10px 0;
        text-align: center;
    }
    
    .footer-copyright {
        text-align: center;
    }
    
    .footer-copyright p {
        font-size: 13px;
        text-align: center;
    }
}
  
  /* Daily Limit Counter Styles */
.limit-counter {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.generations-remaining {
    margin: 0;
    font-size: 1rem;
}

.generations-remaining strong {
    font-size: 1.2rem;
    color: #FFD700;
}

/* Disabled form styles */
.form-disabled {
    opacity: 0.6;
    pointer-events: none;
}

.form-disabled .form-group input,
.form-disabled .form-group textarea {
    background: #f5f5f5;
    cursor: not-allowed;
}

.submit-btn:disabled {
    background: #999;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Upgrade prompt */
.upgrade-prompt {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    background: #f0f9ff;
    border-radius: 8px;
    border: 2px solid #3b82f6;
}

.upgrade-prompt p {
    margin: 0;
    color: #1e40af;
    font-weight: 500;
}

.upgrade-link {
    color: #3b82f6;
    font-weight: bold;
    text-decoration: underline;
}

.upgrade-link:hover {
    color: #2563eb;
}

/* Limit reached message */
.error-message.limit-reached {
    background: #fef2f2;
    border: 2px solid #ef4444;
    color: #991b1b;
    padding: 20px;
    border-radius: 10px;
    font-size: 1.1rem;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .form-group input,
    .form-group textarea {
        border-width: 3px;
    }
    
    .submit-btn,
    .copy-btn {
        border: 2px solid currentColor;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed */
}