:root {
    --bg-dark: #0f172a;
    --text-light: #ffffff;
    --accent: #3b82f6;
    --glass: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

/* Background Animations */
.background-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: #a855f7;
    top: -20%;
    left: -10%;
    animation: float 10s ease-in-out infinite;
}

.orb-2 {
    width: 600px;
    height: 600px;
    background: #3b82f6;
    bottom: -20%;
    right: -10%;
    animation: float 12s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, 50px); }
}

/* Login Screen */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: opacity 0.5s ease;
}

.login-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3rem;
    border-radius: 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.input-group {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    margin-top: 1rem;
}

.input-group input {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.input-group input:focus {
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.4);
}

.input-group button {
    padding: 0.75rem 1.25rem;
}

.disclaimer {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.5rem;
}

/* App Nav */
.app-nav {
    position: absolute;
    top: 2rem;
    right: 2rem;
    left: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 50;
}

.user-greeting {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.avatar {
    width: 2rem;
    height: 2rem;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    color: white;
}

#userNameDisplay {
    font-weight: 500;
    color: white;
}

.settings-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(45deg);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    display: none;
    opacity: 0;
}

.modal-content {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 1.5rem;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

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

.modal-header h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    margin: 0;
}

.description-text {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.description-text code {
    background: rgba(255,255,255,0.1);
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    font-family: monospace;
    color: #e2e8f0;
}

.close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.5rem;
}

.close-btn:hover {
    color: white;
}

/* Layout */
.container {
    width: 100%;
    max-width: 900px;
    padding: 4rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.875rem;
    color: #bfdbfe;
}

h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    font-weight: 800;
}

.gradient-text {
    background: linear-gradient(to right, #ffffff, #bfdbfe);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.subtitle {
    font-size: 1.125rem;
    color: #94a3b8;
    max-width: 600px;
    line-height: 1.6;
}

/* Input Card */
.input-card {
    width: 100%;
    max-width: 700px;
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    padding: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.input-card:focus-within {
    transform: scale(1.01);
    border-color: rgba(255, 255, 255, 0.2);
}

textarea {
    width: 100%;
    height: 120px;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.125rem;
    padding: 1rem;
    resize: none;
    outline: none;
    font-family: inherit;
}

textarea::placeholder {
    color: #64748b;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--border);
    margin-top: 0.5rem;
}

.hint {
    font-size: 0.75rem;
    color: #64748b;
}

button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

button:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

button svg {
    width: 18px;
    height: 18px;
}

/* Preview */
.preview-container {
    width: 100%;
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    margin-top: 2rem;
    animation: slideUp 0.5s ease-out;
}

.hidden {
    display: none;
}

.preview-header {
    background: #f1f5f9;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e2e8f0;
}

.header-controls {
    display: flex;
    gap: 4px;
    background: #e2e8f0;
    padding: 2px;
    border-radius: 6px;
}

.view-btn {
    background: transparent;
    color: #64748b;
    border: none;
    padding: 4px 12px;
    font-size: 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

.view-btn.active {
    background: white;
    color: #0f172a;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.content-wrapper {
    position: relative;
    width: 100%;
    height: 600px; /* Taller preview */
    background: #1e293b; 
}

iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

#codeView {
    width: 100%;
    height: 100%;
}

#codeArea {
    width: 100%;
    height: 100%;
    background: #1e293b;
    color: #a5b4fc;
    border: none;
    padding: 1.5rem;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.875rem;
    resize: none;
    outline: none;
    line-height: 1.5;
}

/* Footer Styling */
footer {
    margin-top: 3rem;
    text-align: center;
    color: #64748b;
    font-size: 0.875rem;
}

.creator-link {
    color: #bfdbfe;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    border-bottom: 1px dashed rgba(191, 219, 254, 0.3);
}

.creator-link:hover {
    color: white;
    border-bottom-style: solid;
}

.fade-in-delay-2 {
    animation: fadeIn 0.8s ease-out 0.4s forwards;
    opacity: 0;
    transform: translateY(20px);
}

/* Animations */
.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

.fade-in-delay {
    animation: fadeIn 0.8s ease-out 0.2s forwards;
    opacity: 0;
    transform: translateY(20px);
}

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

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