/* Premium Space/Glass Theme - ShareBin */
:root {
    /* Color Palette - Deep Space & Neon */
    --md-sys-color-primary: #a855f7;
    /* Violet Neon */
    --md-sys-color-on-primary: #ffffff;
    --md-sys-color-primary-container: #4c1d95;
    --md-sys-color-on-primary-container: #e9d5ff;

    --md-sys-color-secondary: #2dd4bf;
    /* Cyan/Teal Neon */
    --md-sys-color-on-secondary: #000000;
    --md-sys-color-secondary-container: #0f766e;
    --md-sys-color-on-secondary-container: #ccfbf1;

    --md-sys-color-surface: #0a0a0a;
    /* Almost Black */
    --md-sys-color-surface-1: #171717;
    /* Dark Grey */
    --md-sys-color-surface-2: #262626;
    /* Lighter Grey */
    --md-sys-color-surface-translucent: rgba(23, 23, 23, 0.7);
    /* For Glassmorphism */

    --md-sys-color-background: #000000;
    --md-sys-color-on-background: #e5e5e5;

    --md-sys-color-outline: #525252;
    --md-sys-color-outline-variant: #404040;

    --md-sys-color-success: #22c55e;
    --md-sys-color-error: #ef4444;

    /* Typography */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Effects */
    --glass-blur: blur(12px);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
    --shadow-glow: 0 0 15px rgba(168, 85, 247, 0.3);

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--md-sys-color-background);
    color: var(--md-sys-color-on-background);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(76, 29, 149, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(45, 212, 191, 0.1), transparent 25%);
    background-attachment: fixed;
}

/* Header - Modern App Bar */
header {
    background-color: var(--md-sys-color-surface-translucent);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--md-sys-color-on-background);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.brand i {
    color: var(--md-sys-color-primary);
    filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.5));
}

.brand span {
    background: linear-gradient(135deg, #fff 0%, #a5a5a5 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Layout */
main {
    flex: 1;
    width: 100%;
    max-width: 1000px;
    margin: 32px auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Buttons */
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    outline: none;
    font-family: var(--font-sans);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Primary Button - Glow Effect */
button.primary {
    background: linear-gradient(135deg, var(--md-sys-color-primary), #9333ea);
    color: white;
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.3);
    border: none;
}

button.primary:hover:not(:disabled) {
    box-shadow: 0 6px 16px rgba(147, 51, 234, 0.5);
    transform: translateY(-1px);
}

button.primary:active:not(:disabled) {
    transform: scale(0.98);
}

/* Secondary Button */
button.secondary {
    background-color: var(--md-sys-color-surface-2);
    color: var(--md-sys-color-on-background);
    border: 1px solid var(--md-sys-color-outline-variant);
}

button.secondary:hover:not(:disabled) {
    background-color: var(--md-sys-color-outline-variant);
    border-color: var(--md-sys-color-outline);
}

button.text {
    background: transparent;
    color: var(--md-sys-color-on-background);
    padding: 0 12px;
}

button.text:hover {
    color: var(--md-sys-color-primary);
}

/* Paste Header */
#paste-header {
    background: var(--md-sys-color-surface-1);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

/* Subtle gradient accent on header */
#paste-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--md-sys-color-primary), transparent);
}

/* Paste Title Input */
#paste-title-input {
    background: transparent;
    border: 1px solid transparent;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--md-sys-color-on-background);
    width: 100%;
    margin-right: 16px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

#paste-title-input:hover {
    border-color: var(--md-sys-color-outline-variant);
}

#paste-title-input:focus {
    border-color: var(--md-sys-color-primary);
    background: var(--md-sys-color-surface-2);
    box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.1);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 0;
    padding-left: 8px;
}

.tab {
    background: transparent;
    border: none;
    color: #a3a3a3;
    padding: 10px 20px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    position: relative;
}

.tab:hover {
    color: white;
}

.tab.active {
    background-color: var(--md-sys-color-surface-1);
    color: var(--md-sys-color-primary);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-bottom: none;
    z-index: 10;
}

/* Content Area */
.content-wrapper {
    position: relative;
    z-index: 5;
    box-shadow: var(--shadow-lg);
}

.editor-container,
.file-upload {
    background-color: var(--md-sys-color-surface-1);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 0 var(--radius-lg) var(--radius-lg) var(--radius-lg);
    /* Adjust border radius if first tab is active */
    overflow: hidden;
}

textarea#text-editor {
    width: 100%;
    height: 60vh;
    background-color: transparent;
    color: #d4d4d4;
    border: none;
    padding: 24px;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    outline: none;
}

textarea#text-editor::placeholder {
    color: #525252;
}

/* File Upload */
.file-upload {
    border-radius: var(--radius-lg);
    /* Override if needed when standalone */
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--md-sys-color-outline-variant);
    transition: all 0.2s;
}

.file-upload:hover,
.file-upload.drag-over {
    border-color: var(--md-sys-color-primary);
    background-color: rgba(168, 85, 247, 0.05);
}

.file-info {
    margin-top: 16px;
    padding: 16px;
    background: var(--md-sys-color-surface-2);
    border-radius: var(--radius-md);
    border: 1px solid var(--md-sys-color-outline-variant);
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Options */
.options-panel {
    background: var(--md-sys-color-surface-1);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.options-panel h4 {
    color: #a3a3a3;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}

/* Inputs */
.input-group {
    position: relative;
    width: 100%;
}

.input-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: #a3a3a3;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    background-color: var(--md-sys-color-surface-background);
    /* Falls back to black/dark */
    background: #000;
    border: 1px solid var(--md-sys-color-outline-variant);
    color: white;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    transition: all 0.2s;
}

input:focus,
select:focus {
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2);
    outline: none;
}

select.input-select {
    width: 100%;
    background-color: var(--md-sys-color-surface-background);
    /* Falls back to black/dark */
    background: #000;
    border: 1px solid var(--md-sys-color-outline-variant);
    color: white;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    transition: all 0.2s;
    appearance: none;
    /* Custom arrow? simple for now */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

/* Delete Button */
.icon-btn.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--md-sys-color-error);
    border: 1px solid transparent;
    width: 40px;
    padding: 0;
}

.icon-btn.danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--md-sys-color-error);
}

/* Open Input Special Style */
#open-paste-input {
    background: var(--md-sys-color-surface-2);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 20px;
    padding: 6px 16px;
    width: 140px;
    font-size: 0.9rem;
    text-align: center;
    transition: width 0.3s ease, border-color 0.3s;
}

#open-paste-input:focus {
    width: 200px;
    text-align: left;
    border-color: var(--md-sys-color-primary);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--md-sys-color-surface-1);
    border: 1px solid var(--md-sys-color-outline-variant);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-lg);
    padding: 32px !important;
    width: 90%;
    max-width: 400px;
    animation: modalSlide 0.3s ease-out;
}

@keyframes modalSlide {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-modal {
    float: right;
    font-size: 1.5rem;
    cursor: pointer;
    color: #a3a3a3;
}

.close-modal:hover {
    color: white;
}

/* Utilities */
.hidden {
    display: none !important;
}

.status {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--md-sys-color-surface-2);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    border: 1px solid var(--md-sys-color-outline-variant);
    box-shadow: var(--shadow-lg);
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.status.success {
    border-color: var(--md-sys-color-success);
    color: var(--md-sys-color-success);
}

.status.error {
    border-color: var(--md-sys-color-error);
    color: var(--md-sys-color-error);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    header {
        height: auto;
        flex-direction: column;
        padding: 12px 16px;
        gap: 12px;
    }

    .brand {
        width: 100%;
        justify-content: center;
    }

    .actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        /* Allow wrapping if too many items */
        gap: 8px;
    }

    /* Make open input take less space or move */
    .input-group:has(#open-paste-input) {
        display: none;
        /* Hide quick open on mobile to save space, rely on home/menu */
    }

    main {
        margin: 16px auto;
        padding: 0 12px;
        gap: 16px;
    }

    #paste-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px;
        gap: 12px;
    }

    #paste-title-display {
        font-size: 1.25rem;
        word-break: break-all;
    }

    /* Better Mobile Actions */
    .mobile-hidden {
        display: none !important;
    }

    button {
        padding: 0 12px;
        /* Smaller padding on mobile */
    }

    /* Adjust Options Grid */
    .options-panel div[style*="grid"] {
        grid-template-columns: 1fr !important;
    }
}