/* ==========================================
   COLD EMAIL GENERATOR - REDESIGNED
   Email-Themed Modern Design
   ========================================== */

/* CSS VARIABLES */
:root {
    --color-bg-primary: #0a0e1a;
    --color-bg-secondary: #121827;
    --color-surface: #1e2638;
    --color-primary: #ef4444;
    --color-secondary: #f59e0b;
    --color-blue: #60a5fa;
    --color-purple: #a78bfa;
    --color-green: #10b981;
    --color-text-primary: #ffffff;
    --color-text-secondary: #e2e8f0;
    --color-text-tertiary: #94a3b8;
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    overflow-x: hidden;
    line-height: 1.6;
    min-height: 100vh;
}

/* ==========================================
   ANIMATED EMAIL BACKGROUND
   ========================================== */

.email-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: linear-gradient(135deg, #0a0e1a 0%, #121827 50%, #1e2638 100%);
}

.floating-email {
    position: absolute;
    width: 40px;
    height: 30px;
    border: 2px solid rgba(96, 165, 250, 0.2);
    border-radius: 4px;
    opacity: 0.3;
    animation: floatEmail 20s infinite ease-in-out;
}

.floating-email::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 15px solid rgba(96, 165, 250, 0.2);
}

.floating-email:nth-child(1) {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.floating-email:nth-child(2) {
    top: 60%;
    left: 80%;
    animation-delay: 4s;
    transform: rotate(45deg);
}

.floating-email:nth-child(3) {
    top: 30%;
    left: 50%;
    animation-delay: 8s;
}

.floating-email:nth-child(4) {
    top: 80%;
    left: 20%;
    animation-delay: 12s;
    transform: rotate(-30deg);
}

.floating-email:nth-child(5) {
    top: 50%;
    left: 70%;
    animation-delay: 16s;
}

@keyframes floatEmail {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-30px) rotate(10deg);
        opacity: 0.6;
    }
}

/* ==========================================
   HEADER
   ========================================== */

.app-header {
    padding: 1.5rem 2rem;
    background: rgba(10, 14, 26, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(96, 165, 250, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-blue);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

.back-button:hover {
    background: rgba(96, 165, 250, 0.1);
    transform: translateX(-5px);
}

.app-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.app-title i {
    font-size: 1.75rem;
    color: var(--color-secondary);
}

.app-title h1 {
    font-size: 1.5rem;
    font-family: var(--font-display);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================
   MAIN CONTAINER
   ========================================== */

.main-container {
    padding: 3rem 2rem;
    min-height: calc(100vh - 100px);
}

.app-container {
    max-width: 900px;
    margin: 0 auto;
}

/* ==========================================
   HERO SECTION
   ========================================== */

.hero-section {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInUp 0.8s ease-out;
}

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

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: rgba(96, 165, 250, 0.1);
    border: 1px solid rgba(96, 165, 250, 0.3);
    border-radius: 9999px;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    color: var(--color-blue);
}

.hero-badge i {
    font-size: 1.1rem;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-family: var(--font-display);
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--color-text-tertiary);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.8;
}

/* ==========================================
   FORM CONTAINER
   ========================================== */

.form-container {
    background: rgba(30, 38, 56, 0.6);
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: 1.5rem;
    padding: 2.5rem;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin-bottom: 3rem;
}

.input-section {
    margin-bottom: 2.5rem;
}

.input-section:last-of-type {
    margin-bottom: 0;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.section-header i {
    font-size: 1.25rem;
    color: var(--color-blue);
}

.section-header h3 {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    font-weight: 600;
}

/* ==========================================
   UPLOAD AREA
   ========================================== */

.upload-area {
    border: 2px dashed rgba(96, 165, 250, 0.3);
    border-radius: 1rem;
    padding: 2.5rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: rgba(10, 14, 26, 0.5);
}

.upload-area:hover {
    border-color: var(--color-blue);
    background: rgba(96, 165, 250, 0.05);
}

.upload-area.drag-over {
    border-color: var(--color-green);
    background: rgba(16, 185, 129, 0.1);
}

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

.upload-icon {
    font-size: 3rem;
    color: var(--color-blue);
    margin-bottom: 0.5rem;
}

.upload-text {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.upload-hint {
    font-size: 0.9rem;
    color: var(--color-text-tertiary);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(96, 165, 250, 0.1);
    border-radius: 0.75rem;
}

.file-icon {
    font-size: 2rem;
    color: var(--color-primary);
}

.file-name {
    flex: 1;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.remove-file {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(239, 68, 68, 0.2);
    color: var(--color-primary);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.remove-file:hover {
    background: var(--color-primary);
    color: white;
    transform: rotate(90deg);
}

/* ==========================================
   URL INPUT
   ========================================== */

.url-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1.25rem;
    color: var(--color-text-tertiary);
    font-size: 1.1rem;
}

.url-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3.5rem;
    background: rgba(10, 14, 26, 0.5);
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: 0.75rem;
    color: var(--color-text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.url-input::placeholder {
    color: var(--color-text-tertiary);
}

.url-input:focus {
    outline: none;
    border-color: var(--color-blue);
    background: rgba(10, 14, 26, 0.8);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

.url-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    align-items: center;
}

.example-label {
    font-size: 0.85rem;
    color: var(--color-text-tertiary);
}

.example-site {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    background: rgba(96, 165, 250, 0.1);
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: 9999px;
    color: var(--color-blue);
}

/* ==========================================
   ACTION SECTION
   ========================================== */

.action-section {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(96, 165, 250, 0.1);
}

.generate-btn {
    padding: 1.25rem 3rem;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: white;
    border: none;
    border-radius: 9999px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.3);
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(239, 68, 68, 0.4);
}

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

.generate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.action-hint {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--color-text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* ==========================================
   LOADING STATE
   ========================================== */

.loading-container {
    text-align: center;
    padding: 4rem 2rem;
    background: rgba(30, 38, 56, 0.6);
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: 1.5rem;
    backdrop-filter: blur(20px);
    margin-bottom: 3rem;
}

.loading-spinner {
    margin-bottom: 2rem;
}

.spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto;
    border: 4px solid rgba(96, 165, 250, 0.2);
    border-top-color: var(--color-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.25rem;
    color: var(--color-text-secondary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.loading-subtext {
    font-size: 1rem;
    color: var(--color-text-tertiary);
}

/* ==========================================
   RESULT CONTAINER
   ========================================== */

.result-container {
    background: rgba(30, 38, 56, 0.6);
    border: 1px solid rgba(96, 165, 250, 0.2);
    border-radius: 1.5rem;
    backdrop-filter: blur(20px);
    overflow: hidden;
    margin-bottom: 3rem;
    animation: fadeInUp 0.6s ease-out;
}

.result-header {
    padding: 1.5rem 2rem;
    background: rgba(16, 185, 129, 0.1);
    border-bottom: 1px solid rgba(96, 165, 250, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.result-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.result-title i {
    font-size: 1.5rem;
    color: var(--color-green);
}

.result-title h3 {
    font-size: 1.25rem;
    color: var(--color-text-primary);
}

.result-actions {
    display: flex;
    gap: 0.75rem;
}

.action-btn {
    padding: 0.5rem 1.25rem;
    background: rgba(96, 165, 250, 0.1);
    border: 1px solid rgba(96, 165, 250, 0.3);
    border-radius: 0.5rem;
    color: var(--color-blue);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
}

.action-btn:hover {
    background: rgba(96, 165, 250, 0.2);
    border-color: var(--color-blue);
    transform: translateY(-2px);
}

.email-preview {
    padding: 2rem;
    background: rgba(10, 14, 26, 0.5);
    color: var(--color-text-secondary);
    line-height: 1.8;
    font-size: 1rem;
    white-space: pre-wrap;
    max-height: 500px;
    overflow-y: auto;
}

.result-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid rgba(96, 165, 250, 0.1);
    text-align: center;
}

.generate-another-btn {
    padding: 0.75rem 2rem;
    background: transparent;
    border: 2px solid var(--color-blue);
    border-radius: 9999px;
    color: var(--color-blue);
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
}

.generate-another-btn:hover {
    background: rgba(96, 165, 250, 0.1);
    transform: translateY(-2px);
}

/* ==========================================
   FEATURES SECTION
   ========================================== */

.features-section {
    padding: 2rem;
    background: rgba(30, 38, 56, 0.4);
    border: 1px solid rgba(96, 165, 250, 0.1);
    border-radius: 1.5rem;
    backdrop-filter: blur(20px);
}

.features-title {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--color-text-primary);
}

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

.feature-item {
    text-align: center;
}

.feature-item i {
    font-size: 2.5rem;
    color: var(--color-blue);
    margin-bottom: 1rem;
}

.feature-item h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--color-text-secondary);
}

.feature-item p {
    font-size: 0.9rem;
    color: var(--color-text-tertiary);
}

/* ==========================================
   FOOTER
   ========================================== */

.app-footer {
    padding: 2rem;
    text-align: center;
    border-top: 1px solid rgba(96, 165, 250, 0.1);
    background: rgba(10, 14, 26, 0.8);
}

.app-footer p {
    color: var(--color-text-tertiary);
    margin-bottom: 1rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--color-blue);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--color-text-primary);
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }

    .app-title h1 {
        font-size: 1.25rem;
    }

    .form-container {
        padding: 1.5rem;
    }

    .generate-btn {
        width: 100%;
        justify-content: center;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .result-actions {
        width: 100%;
        justify-content: stretch;
    }

    .action-btn {
        flex: 1;
        justify-content: center;
    }

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