:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg: #0f172a;
    --card-bg: #1e293b;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --success: #10b981;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

/* Base App Layout */
.container {
    max-width: 650px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary);
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

.logo i {
    font-size: 1.75rem;
}

/* Typography & Layout Utility Classes */
h2, h3 { font-weight: 600; margin-bottom: 1rem; }
.hidden { display: none !important; }
.card { background: var(--card-bg); border-radius: 12px; padding: 1.5rem; border: 1px solid var(--border); }
.row { display: flex; gap: 1rem; }
.control-group { flex: 1; display: flex; flex-direction: column; gap: 0.5rem;}

/* Controls & Inputs */
label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

textarea, select, input[type="password"] {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

textarea:focus, select:focus, input[type="password"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Buttons */
button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    transition: all 0.2s;
}

.primary-btn {
    background-color: var(--primary);
    color: white;
    font-weight: 600;
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    width: 100%;
    font-size: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.primary-btn:hover { background-color: var(--primary-hover); transform: translateY(-1px); }
.primary-btn:active { transform: translateY(0); }

.icon-btn {
    color: var(--text-muted);
    font-size: 1.25rem;
    padding: 0.5rem;
    border-radius: 6px;
}

.icon-btn:hover { background-color: var(--border); color: var(--text); }

.generate-btn { margin-top: 1.5rem; }

/* Modal Settings */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    background: var(--card-bg);
    width: 90%;
    max-width: 400px;
    border-radius: 12px;
    border: 1px solid var(--border);
    animation: zoomIn 0.2s ease-out;
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1.25rem; border-bottom: 1px solid var(--border); }
.modal-header h2 { margin: 0; font-size: 1.125rem; }
.modal-body { padding: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; }
.modal-body .help-text { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }
.modal-footer { padding: 1.25rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; }

/* Results */
.results-section { margin-top: 2rem; }
.replies-container { display: flex; flex-direction: column; gap: 1rem; }

.reply-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    transition: transform 0.2s, box-shadow 0.2s;
    animation: fadeIn 0.3s ease-out forwards;
    opacity: 0;
}

.reply-card:nth-child(1) { animation-delay: 0.1s; }
.reply-card:nth-child(2) { animation-delay: 0.2s; }
.reply-card:nth-child(3) { animation-delay: 0.3s; }

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

.reply-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

.reply-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.reply-type {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.reply-content {
    font-size: 1rem;
    white-space: pre-wrap;
    margin-bottom: 1rem;
}

.copy-btn {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    background: rgba(255,255,255,0.05);
}

.copy-btn:hover { background: rgba(255,255,255,0.1); color: var(--text); }
.copy-btn.copied { color: var(--success); }

/* Loading Spinner */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem 0;
    color: var(--text-muted);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Ad Layout Styles */
.main-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.main-wrapper .container {
    max-width: 650px;
    margin: 0;
    padding: 0;
    flex: 1;
}

.sidebar-ad-section {
    width: 300px;
    min-height: 1px; /* Grows when ad loads */
    display: flex;
    justify-content: center;
    align-items: center;
    position: sticky;
    top: 2rem;
    flex-shrink: 0;
    margin-top: 5.5rem; /* Aligning slightly down from the header */
}

.ad-banner-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
}

.ad-banner-placeholder i {
    font-size: 3rem;
    color: var(--border);
}

.ad-banner-placeholder p {
    font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .main-wrapper {
        flex-direction: column;
        align-items: center;
    }
    .left-ad {
        order: -1; /* Show above main content on mobile/tablet */
    }
    .sidebar-ad-section {
        width: 100%;
        max-width: 650px;
        min-height: 1px;
        position: relative;
        top: 0;
        margin-top: 1rem;
    }
}

@media (max-width: 480px) {
    .container { padding: 1rem; }
    .card { padding: 1rem; }
}
