/* ─── Modern Glassmorphic UI ─── */
:root {
    --bg-color: #0d1117;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #e6edf3;
    --text-secondary: #7d8590;
    --accent: #58a6ff;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-color);
    background-image: 
        radial-gradient(ellipse at 10% 20%, rgba(88, 166, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 80%, rgba(255, 107, 107, 0.15) 0%, transparent 50%);
    background-size: cover;
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.glass-container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 950px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    display: flex;
    flex-direction: column;
    gap: 25px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: -webkit-linear-gradient(45deg, #58a6ff, #bc8cff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
    text-align: center;
}

header p {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 300;
    margin-bottom: 15px;
}

.header-actions {
    display: flex;
    justify-content: center;
}

.download-btn {
    display: inline-block;
    background: linear-gradient(90deg, #bb86fc, #8855cc);
    padding: 10px 24px;
    border-radius: 30px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(187, 134, 252, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(187, 134, 252, 0.6);
}

.vercel-warning {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #ff7b72;
    padding: 12px;
    border-radius: 12px;
    text-align: center;
    font-size: 0.95rem;
    margin-top: 15px;
}

.vercel-warning strong {
    display: block;
    font-size: 1.1em;
    margin-bottom: 4px;
}

.vercel-warning code {
    background: rgba(255,255,255,0.1);
    padding: 2px 5px;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
}

.hidden {
    display: none !important;
}

.split-view {
    display: flex;
    gap: 20px;
    height: 350px;
}

.textarea-wrapper, .demo-editor-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

textarea {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px;
    color: #a5d6ff;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    resize: none;
    outline: none;
    transition: all 0.3s ease;
}

textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(88, 166, 255, 0.2);
}

.demo-editor {
    flex: 1;
    background: #1e1e1e;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.demo-header {
    background: #2d2d2d;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid #333;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.red { background: #ff5f56; }
.yellow { background: #ffbd2e; }
.green { background: #27c93f; }

.demo-header .title {
    margin-left: 10px;
    color: #8b8b8b;
    font-size: 0.85rem;
    font-family: sans-serif;
}

.demo-body {
    padding: 15px;
    flex: 1;
    color: #d4d4d4;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    overflow-y: auto;
    white-space: pre-wrap;
}

.cursor-blink {
    animation: blink 1s step-end infinite;
    color: #fff;
    font-weight: bold;
}

@keyframes blink {
    50% { opacity: 0; }
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px 25px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
}

button {
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    color: white;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.primary-btn {
    background: linear-gradient(90deg, #238636, #2ea043);
    box-shadow: 0 4px 15px rgba(46, 160, 67, 0.4);
}
.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 160, 67, 0.6);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

button:disabled {
    background: #484f58;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.status-msg {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: #f2cc60;
    padding: 15px;
    background: rgba(242, 204, 96, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(242, 204, 96, 0.2);
    transition: opacity 0.3s;
}

.counting {
    animation: pulse 1s infinite;
    color: #ff7b72;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Responsiveness */
@media (max-width: 850px) {
    .split-view {
        flex-direction: column;
        height: auto;
    }
    textarea, .demo-editor {
        height: 250px;
    }
    .controls {
        flex-direction: column;
    }
    button {
        width: 100%;
    }
}
