/* ===================================
   Encrypted Pastebin - Elaine.is Style
   =================================== */

/* CSS Variables & Reset */
:root {
    /* Core Palette - Darker & Richer */
    --bg-primary: #09090b;
    --bg-secondary: #121217;
    --bg-card: rgba(24, 24, 32, 0.7);
    --bg-card-hover: rgba(32, 32, 42, 0.8);

    /* Lavender & Purple Accents */
    --accent-primary: #8b5cf6;
    --accent-secondary: #a78bfa;
    --accent-glow: rgba(139, 92, 246, 0.15);
    --accent-glow-strong: rgba(139, 92, 246, 0.4);

    /* Text Colors */
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;

    /* Status Colors */
    --color-success: #10b981;
    --color-error: #ef4444;

    /* Syntax Highlighting */
    --hl-keyword: #c678dd;
    --hl-string: #98c379;
    --hl-number: #d19a66;
    --hl-comment: #5c6370;
    --hl-function: #61afef;
    --hl-operator: #56b6c2;
    --hl-tag: #e06c75;
    --hl-attribute: #d19a66;
    --hl-property: #e5c07b;
    --hl-punctuation: #abb2bf;
    --hl-boolean: #d19a66;
    --hl-null: #d19a66;

    /* Spacing & Radii */
    --border-radius: 12px;
    --border-radius-sm: 8px;

    /* Fonts */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Menlo', 'Monaco', 'Consolas', monospace;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Background Glow Effect */
.background-glow {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* ===================================
   App Layout - No Scroll Design
   =================================== */
.app-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    /* Dynamic viewport height for mobile */
    overflow: hidden;
}

.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
    overflow: hidden;
}

/* ===================================
   Header
   =================================== */
.app-header {
    text-align: center;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.app-title {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-secondary) 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.app-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===================================
   View States
   =================================== */
.view {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    min-height: 0;
}

.hidden {
    display: none !important;
}

/* ===================================
   Textarea - Expands to fill space
   =================================== */
#paste-input {
    width: 100%;
    flex: 1;
    min-height: 80px;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.5;
    resize: none;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#paste-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

#paste-input::placeholder {
    color: var(--text-muted);
}

/* ===================================
   Paste Output
   =================================== */
.paste-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-shrink: 0;
}

.language-badge {
    font-size: 10px;
    color: var(--accent-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    background: var(--accent-glow);
    border-radius: 99px;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

#paste-output {
    width: 100%;
    flex: 1;
    min-height: 80px;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.5;
    overflow: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
}

.highlighted {
    margin: 0;
    padding: 0;
}

/* Syntax Highlighting */
.token-keyword {
    color: var(--hl-keyword);
}

.token-string {
    color: var(--hl-string);
}

.token-number {
    color: var(--hl-number);
}

.token-comment {
    color: var(--hl-comment);
    font-style: italic;
}

.token-function {
    color: var(--hl-function);
}

.token-operator {
    color: var(--hl-operator);
}

.token-tag {
    color: var(--hl-tag);
}

.token-attribute {
    color: var(--hl-attribute);
}

.token-property {
    color: var(--hl-property);
}

.token-punctuation {
    color: var(--hl-punctuation);
}

.token-boolean {
    color: var(--hl-boolean);
}

.token-null {
    color: var(--hl-null);
}

.token-selector {
    color: var(--hl-tag);
}

.token-value {
    color: var(--hl-string);
}

/* ===================================
   Buttons
   =================================== */
.actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-shrink: 0;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

button:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-glow);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#create-btn {
    background: linear-gradient(135deg, var(--accent-primary), #7c3aed);
    color: white;
    box-shadow: 0 4px 12px var(--accent-glow-strong);
}

#create-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--accent-glow-strong);
}

#create-btn:active:not(:disabled) {
    transform: translateY(0);
}

#copy-btn,
#new-btn,
#error-new-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

#copy-btn:hover,
#new-btn:hover,
#error-new-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

/* ===================================
   Loading State
   =================================== */
#loading-view {
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#loading-view p {
    color: var(--text-secondary);
    font-size: 13px;
}

/* ===================================
   Error State
   =================================== */
.error-text {
    color: var(--color-error);
    text-align: center;
    padding: 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--border-radius-sm);
    font-size: 13px;
}

/* ===================================
   Toast Notification
   =================================== */
.toast {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 12px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.toast.show {
    opacity: 1;
}

.toast.success {
    border-color: var(--color-success);
}

.toast.error {
    border-color: var(--color-error);
}

/* ===================================
   reCAPTCHA Notice
   =================================== */
.captcha-notice {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    flex-shrink: 0;
}

.captcha-notice a {
    color: var(--text-secondary);
    text-decoration: none;
}

.captcha-notice a:hover {
    text-decoration: underline;
}

.grecaptcha-badge {
    visibility: hidden !important;
}

/* ===================================
   Footer - Single Line
   =================================== */
.app-footer {
    text-align: center;
    padding: 12px 16px;
    color: var(--text-muted);
    font-size: 11px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    white-space: nowrap;
}

.app-footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

.app-footer a:hover {
    color: var(--accent-secondary);
}

/* ===================================
   Scrollbar
   =================================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Selection */
::selection {
    background-color: var(--accent-primary);
    color: white;
}

/* ===================================
   Mobile Responsive - No Scroll
   =================================== */
@media (max-width: 600px) {
    .container {
        padding: 12px;
        justify-content: flex-start;
        padding-top: 20px;
    }

    .app-header {
        margin-bottom: 12px;
    }

    .app-title {
        font-size: 1.25rem;
    }

    .app-subtitle {
        font-size: 0.7rem;
    }

    #paste-input,
    #paste-output {
        min-height: 60px;
        padding: 12px;
        font-size: 12px;
    }

    .view {
        gap: 10px;
    }

    button {
        padding: 10px 14px;
        font-size: 12px;
    }

    .actions {
        gap: 8px;
    }

    .toast {
        bottom: 50px;
        font-size: 11px;
    }

    .app-footer {
        padding: 10px 12px;
        font-size: 10px;
    }

    .captcha-notice {
        font-size: 9px;
    }
}

@media (max-width: 380px) {
    .app-title {
        font-size: 1.1rem;
    }

    #paste-input,
    #paste-output {
        min-height: 50px;
        font-size: 11px;
        padding: 10px;
    }

    button {
        padding: 8px 12px;
        font-size: 11px;
    }
}

/* Extra small height screens */
@media (max-height: 600px) {
    .container {
        padding-top: 10px;
    }

    .app-header {
        margin-bottom: 8px;
    }

    #paste-input,
    #paste-output {
        min-height: 40px;
    }

    .view {
        gap: 8px;
    }

    .app-footer {
        padding: 8px;
    }
}