:root {
    --primary-color: #0d6efd;
    --primary-gradient: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* Phase 1: Breakpoints */
    --bp-tablet: 768px;
    --bp-laptop: 1024px;
    --bp-desktop: 1440px;
}

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

html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    position: relative;
    font-size: clamp(0.875rem, 2vw, 1rem);
}

.page-background {
    position: absolute;
    top: -100px;
    left: -100px;
    right: -100px;
    height: 400px;
    background: radial-gradient(circle at 50% -20%, rgba(13, 110, 253, 0.15), transparent 70%);
    z-index: -1;
}

.navbar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

@media (min-width: 768px) {
    .nav-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 1rem 2rem;
    }
    .nav-header {
        width: auto;
    }
}

.logo {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
}

.mobile-menu-btn {
    display: block;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
}

@media (min-width: 768px) {
    .mobile-menu-btn {
        display: none;
    }
}

.nav-links {
    display: none; /* Hidden by default on mobile */
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    width: 100%;
    margin-top: 1rem;
}

.nav-links.show {
    display: flex !important;
}

@media (min-width: 768px) {
    .nav-links {
        display: flex;
        flex-direction: row;
        width: auto;
        margin-top: 0;
    }
}

button {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.2s ease;
}

button:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    box-shadow: 0 4px 14px 0 rgba(13, 110, 253, 0.39);
    width: 100%;
}

@media (min-width: 768px) {
    .btn-primary {
        width: auto;
        padding: 0.625rem 1.25rem;
    }
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    width: 100%;
}

@media (min-width: 768px) {
    .btn-secondary {
        width: auto;
        padding: 0.5rem 1rem;
    }
}

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

.btn-text {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.75rem 0.5rem;
    font-size: 0.875rem;
}

@media (min-width: 768px) {
    .btn-text {
        padding: 0.5rem;
    }
}

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

.main-content {
    max-width: 1200px;
    margin: 1rem auto;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .main-content {
        margin: 2rem auto;
        padding: 0 2rem;
    }
}

.grid-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    width: 100%;
}

@media (min-width: 1024px) {
    .grid-layout {
        grid-template-columns: 1fr 2fr;
        gap: 2rem;
    }
}

.card {
    background: var(--card-bg);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
    padding: 1.25rem;
    border: 1px solid rgba(0,0,0,0.05);
}

@media (min-width: 768px) {
    .card {
        border-radius: 1rem;
        padding: 1.5rem;
    }
}

.card h2 {
    font-size: clamp(1.125rem, 2.5vw, 1.25rem);
    margin-bottom: 1.25rem;
    font-weight: 600;
}

.form-group {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 0;
}

@media (min-width: 768px) {
    .form-row {
        flex-direction: row;
        gap: 1rem;
    }
}

.flex-1 {
    flex: 1;
}

label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

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

@media (min-width: 768px) {
    input[type="text"], textarea, select {
        padding: 0.75rem 1rem;
    }
}

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

input:focus, textarea:focus, select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
    outline: none;
}

input:focus-visible, textarea:focus-visible, select:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: -1px;
}

input[type="color"] {
    width: 100%;
    height: 44px;
    padding: 0.2rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
}

@media (min-width: 768px) {
    input[type="color"] {
        height: 42px;
    }
}

.preview-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
}

.preview-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

@media (min-width: 768px) {
    .preview-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0;
    }
}

.preview-container {
    flex: 1;
    background: #111827;
    border-radius: 0.5rem;
    padding: 1rem;
    overflow: auto;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
}

@media (min-width: 768px) {
    .preview-container {
        padding: 1.5rem;
        min-height: 300px;
    }
}

pre {
    font-family: 'Courier New', Courier, monospace;
    font-size: clamp(12px, 1.5vw, 14px);
    line-height: 1.2;
    white-space: pre;
}

.preview-actions {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .preview-actions {
        flex-direction: row;
        width: auto;
    }
}

/* Custom Scrollbar for Preview */
.preview-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.preview-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.preview-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.preview-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 1000;
    pointer-events: none;
}

.toast {
    background: var(--text-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.error {
    background: #dc3545;
}

.toast.success {
    background: #198754;
}

/* Landing Page Additions */
.hero-section {
    padding: 4rem 1rem;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.5s ease;
}

.hero-section.hidden {
    display: none;
}

.hero-content {
    max-width: 800px;
}

.hero-content h1 {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-content .highlight {
    color: var(--primary-color);
}

.hero-content p {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.btn-large {
    font-size: 1.125rem;
    padding: 1rem 2rem;
}

.features-section {
    background: white;
    padding: 4rem 1rem;
    margin-top: 4rem;
    border-top: 1px solid var(--border-color);
}

.features-container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    margin-bottom: 3rem;
    font-weight: 700;
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.feature-card {
    background: var(--bg-color);
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.site-footer {
    background: #111827;
    color: white;
    padding: 3rem 1rem;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

@media (min-width: 768px) {
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
    }
}

.footer-logo {
    font-weight: 700;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
}

.footer-copyright {
    color: #6b7280;
    font-size: 0.875rem;
}
