/* Base Config & Colors */
:root {
    --primary: #7c3aed;
    --primary-hover: #6d28d9;
    --primary-light: #f5f3ff;
    --primary-glow: rgba(124, 58, 237, 0.15);
    --text-main: #1f2937;
    --text-muted: #4b5563;
    --bg-main: #ffffff;
    --bg-card: #f9fafb;
    --border-color: #e5e7eb;
    --success: #10b981;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-stack: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-stack);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-sm {
    max-width: 720px;
}

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

.text-gradient {
    background: linear-gradient(135deg, var(--primary), #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Header & Navigation */
.site-header {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-menu {
    display: flex;
    gap: 32px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 15px;
    transition: var(--transition);
    position: relative;
    padding: 4px 0;
}

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

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary);
    border-radius: 2px;
}

/* Hamburger Menu */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
}

.menu-toggle .bar {
    width: 100%;
    height: 2px;
    background-color: var(--text-main);
    transition: var(--transition);
}

/* Hero & Generator Dashboard */
.main-content {
    flex-grow: 1;
}

.hero-section {
    padding: 64px 0 40px;
}

.hero-title {
    font-size: 42px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.generator-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.02);
    text-align: left;
}

.input-group {
    margin-bottom: 24px;
}

.input-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

.form-input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-family: var(--font-stack);
    font-size: 15px;
    color: var(--text-main);
    background-color: var(--bg-main);
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.form-textarea {
    height: 100px;
    padding: 12px 16px;
    resize: none;
}

.read-only-input {
    background-color: #f3f4f6;
    color: #374151;
    font-family: monospace;
    font-size: 13px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 28px;
    font-family: var(--font-stack);
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    width: 100%;
}

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

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

.btn-secondary {
    background-color: #e5e7eb;
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: #d1d5db;
}

/* Results Formatting */
.result-section {
    padding: 40px 0 80px;
    border-top: 1px solid var(--border-color);
}

.id-hidden {
    display: none !important;
}

.result-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
    align-items: start;
}

.section-subtitle {
    font-size: 18px;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--text-main);
}

.preview-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background-color: #000000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.1);
}

.preview-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

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

.copy-input-wrapper .form-input {
    padding-right: 100px;
}

.btn-copy {
    position: absolute;
    right: 8px;
    height: 34px;
    padding: 0 14px;
    background-color: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

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

.textarea-wrapper .btn-copy-textarea {
    top: 8px;
}

.output-group {
    margin-bottom: 20px;
}

.action-buttons-group {
    margin-top: 28px;
}

/* Footer layout */
.site-footer {
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 24px 0;
    margin-top: auto;
    font-size: 14px;
    color: var(--text-muted);
}

/* Modals & Popups for Custom UI Elements */
.popup-success-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: #10b981;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

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

/* Responsive Breakpoints */
@media (max-width: 992px) {
    .result-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 32px;
    }
    .menu-toggle {
        display: flex;
    }
    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 72px;
        left: 0;
        width: 100%;
        background-color: var(--bg-main);
        border-bottom: 1px solid var(--border-color);
        padding: 24px;
        gap: 16px;
        box-shadow: 0 8px 16px rgba(0,0,0,0.05);
    }
    .nav-menu.active {
        display: flex;
    }
    .nav-link.active::after {
        display: none;
    }
}
