:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(148, 163, 184, 0.1);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    background-image: radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%), radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.15) 0px, transparent 50%);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

.screen {
    display: none;
    height: 100%;
    width: 100%;
}

.screen.active {
    display: flex;
}

/* Login */
#login-section {
    align-items: center;
    justify-content: center;
}

.login-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    padding: 2.5rem;
    border-radius: 1rem;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.logo {
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.input-group {
    text-align: left;
    margin-bottom: 1.25rem;
}

.input-group label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-main);
    font-size: 0.95rem;
}

input:focus {
    outline: none;
    border-color: var(--primary);
}

.error-msg {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 1rem;
}

/* Converter */
#converter-section {
    flex-direction: column;
}

header {
    height: 64px;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 1.1rem;
}

.actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.workspace {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.editor-pane {
    border-right: 1px solid var(--border);
}

.pane-header {
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(30, 41, 59, 0.3);
    border-bottom: 1px solid var(--border);
}

.badge {
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

.editor-container,
.preview-container {
    flex: 1;
    position: relative;
}

textarea,
iframe {
    width: 100%;
    height: 100%;
    border: none;
}

textarea {
    background: rgba(15, 23, 42, 0.3);
    color: var(--text-main);
    padding: 1.5rem;
    resize: none;
    font-family: monospace;
}

iframe {
    background: white;
}

/* Footer */
footer {
    padding: 0.5rem;
    text-align: center;
    background: rgba(15, 23, 42, 0.9);
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Buttons */
.btn-primary {
    padding: 0.75rem 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-secondary {
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    cursor: pointer;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
}

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

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    background: #1e293b;
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.1rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-body h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    margin-top: 1rem;
}

.modal-body h3:first-child {
    margin-top: 0;
}

.add-user-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.add-user-form input {
    flex: 1;
}

.user-list-container {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 0.75rem;
    text-align: left;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
}

th {
    background: rgba(15, 23, 42, 0.5);
    color: var(--text-muted);
    font-weight: 500;
}

tr:last-child td {
    border-bottom: none;
}

.status-msg {
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    min-height: 1rem;
}

/* Format Selector */
.format-selector {
    display: flex;
    background: rgba(15, 23, 42, 0.5);
    padding: 0.25rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    margin-right: 0.5rem;
}

.format-selector label {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    padding: 0.35rem 0.75rem;
    border-radius: 0.35rem;
    transition: all 0.2s;
}

.format-selector input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.format-selector span {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    z-index: 2;
}

.format-selector label:has(input:checked) {
    background: var(--primary);
}

.format-selector label:has(input:checked) span {
    color: white;
}

.format-selector label:hover:not(:has(input:checked)) {
    background: rgba(255, 255, 255, 0.05);
}