/* NUCLEORA THIN CLIENT STYLES */

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

:root {
    --primary: #4F46E5;
    --primary-dark: #3730A3;
    --bg: #0F172A;
    --bg-light: #1E293B;
    --bg-lighter: #334155;
    --text: #F8FAFC;
    --text-muted: #94A3B8;
    --success: #10B981;
    --error: #EF4444;
    --border: #475569;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.screen {
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* AUTH */

#auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
}

.auth-box {
    background: var(--bg-light);
    padding: 3rem;
    border-radius: 1rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.auth-box h1 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 0.5rem;
}

.tagline {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.auth-form h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.auth-form input {
    width: 100%;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
}

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

.auth-form button {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.auth-form button:hover {
    background: var(--primary-dark);
}

.auth-link {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-muted);
}

.auth-link a {
    color: var(--primary);
    text-decoration: none;
}

.message {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    text-align: center;
}

.message.success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.message.error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

/* NAVBAR */

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 600;
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--text);
    background: var(--bg-lighter);
}

.nav-link.active {
    color: var(--primary);
    background: rgba(79, 70, 229, 0.1);
}

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

.nav-user span {
    color: var(--text-muted);
}

.btn-small {
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
}

.btn-small:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg-lighter);
}

.btn-secondary:hover {
    background: var(--border);
}

/* MAIN CONTENT */

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.tool-panel {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 1rem;
}

.tool-panel h2 {
    margin-bottom: 1.5rem;
}

.tool-form {
    max-width: 600px;
}

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

.tool-form textarea,
.tool-form select,
.tool-form input[type="number"] {
    width: 100%;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--bg);
    color: var(--text);
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.875rem;
}

.tool-form textarea:focus,
.tool-form select:focus {
    outline: none;
    border-color: var(--primary);
}

.options-row {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
}

.options-row label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    padding: 0.75rem 2rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

/* RESULTS */

.result-panel {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.result-panel h3 {
    margin-bottom: 1rem;
}

.result-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.result-stats strong {
    color: var(--success);
}

.result-panel textarea {
    width: 100%;
    padding: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text);
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.875rem;
}

.primer-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.primer-box {
    background: var(--bg);
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
}

.primer-box h4 {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.primer-box code {
    display: block;
    font-family: 'Monaco', 'Menlo', monospace;
    margin-bottom: 0.5rem;
    word-break: break-all;
}

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

.analysis-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.analysis-table td:first-child {
    width: 40%;
    color: var(--text-muted);
}

.analysis-table pre {
    font-size: 0.75rem;
    overflow-x: auto;
}

/* MODAL */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 1rem;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-content h2 {
    margin-bottom: 1.5rem;
}

.modal-content h3 {
    margin: 1.5rem 0 1rem;
    font-size: 1rem;
    color: var(--text-muted);
}

.account-info p {
    margin-bottom: 0.5rem;
}

.account-info strong {
    color: var(--text-muted);
}

#account-usage table,
#account-sessions table {
    width: 100%;
}

#account-usage td,
#account-sessions td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.change-password {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.change-password input {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--bg);
    color: var(--text);
}

.change-password button {
    padding: 0.75rem 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
}

/* LOADING */

.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--bg-lighter);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    margin-top: 1rem;
    color: var(--text-muted);
}

/* TIER UPGRADE BUTTON IN NAV */
.btn-upgrade-nav {
    background: linear-gradient(135deg, #8B5CF6, #6D28D9);
    color: white !important;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-upgrade-nav:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

/* Hide upgrade button for paid users */
.tier-pro ~ .btn-upgrade-nav,
.tier-laboratory ~ .btn-upgrade-nav,
.tier-enterprise ~ .btn-upgrade-nav,
.tier-admin ~ .btn-upgrade-nav {
    display: none;
}

/* RESPONSIVE */

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .primer-pair {
        grid-template-columns: 1fr;
    }
    
    .options-row {
        flex-direction: column;
        gap: 0.5rem;
    }
}
