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

/* Lock root elements to fixed screen height */
html, body {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background-color: #181A1B;
    color: #C8C3BC;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

h2 {
    color: #C8C3BC;
    margin-bottom: 15px;
}

.hidden {
    display: none !important;
}

/* -------------------------------------------------- */
/* Auth Section                                       */
/* -------------------------------------------------- */
#auth-section {
width: 100%;
max-width: 400px;
background: #131516;
border: 1px solid #393D40;
padding: 24px;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#auth-section input {
width: 100%;
margin-bottom: 12px;
}

#auth-section button {
width: 48%;
margin-right: 2%;
}

#auth-section button:last-of-type {
margin-right: 0;
}

/* -------------------------------------------------- */
/* Main DNA Tracker Container                         */
/* -------------------------------------------------- */
#dna-section {
width: 100%;
max-width: 1100px;
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
}

.dashboard-layout {
    display: flex;
    gap: 20px;
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.quotes-feed {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Controls & Search Bar */
.controls-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

#search-input {
flex: 1;
}

.stat-badge {
    background: #2B2D2F;
    border: 1px solid #393D40;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    color: #C8C3BC;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

/* Chrome / Safari / Edge hide number spin arrows */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox hide number spin arrows */
input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Scrollable Sequence Feed Container */
#quote-box {
flex: 1;
min-height: 0;
border: 1px solid #393D40;
border-radius: 8px;
background: #131516;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
padding: 12px;
margin-bottom: 10px;
display: flex;
flex-direction: column;
}

#dna-container {
display: flex;
flex-direction: column;
gap: 8px;
}

/* Sequence Input Bar */
.input-container {
    display: flex;
    gap: 8px;
    width: 100%;
    flex-shrink: 0;
    background: #131516;
    border: 1px solid #393D40;
    padding: 10px;
    border-radius: 8px;
}

#dna-seq {
width: 130px;
text-transform: uppercase;
font-family: monospace;
font-size: 1.1em;
font-weight: bold;
letter-spacing: 2px;
}

#dna-status {
width: 130px;
}

#dna-desc {
width: 100%;
}

/* -------------------------------------------------- */
/* Sidebar & Analytics                                */
/* -------------------------------------------------- */
.sidebar-stats {
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-card {
    background: #131516;
    border: 1px solid #393D40;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.stat-card h3 {
    font-size: 0.95rem;
    color: #C8C3BC;
    margin-bottom: 8px;
    text-align: center;
}

.stat-card p {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 12px;
}

.chart-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    flex: 1;
    min-height: 220px;
    height: 250px;
    overflow: hidden;
}

.chart-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

/* -------------------------------------------------- */
/* DNA Cards & Item Display                          */
/* -------------------------------------------------- */
.quote-card {
    border-bottom: 1px solid #2B2D2F;
    padding: 12px 4px;
}

.quote-card:last-child {
    border-bottom: none;
}

.quote-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75em;
    color: #888;
    margin-top: 6px;
}

.delete-btn {
    padding: 4px 8px;
    font-size: 12px;
    background: #8b0000;
    color: white;
    border: 1px solid #5a0000;
    border-radius: 4px;
    cursor: pointer;
}

.delete-btn:hover {
    background: #a00000;
}

.logout-btn {
    background: #3a2020;
    border-color: #5a2828;
}

.logout-btn:hover {
    background: #4a2828;
}

/* -------------------------------------------------- */
/* Form Inputs, Selects & Buttons                     */
/* -------------------------------------------------- */
input[type="text"],
input[type="password"],
input[type=number],
select {
    background: #2B2D2F;
    color: #C8C3BC;
    border: 1px solid #393D40;
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 16px; /* Prevents auto-zoom on iOS Safari */
    outline: none;
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
    border-color: #555A5E;
}

/* Custom Styled Select Dropdown */
select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23C8C3BC" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 18px;
    padding-right: 30px;
}

select option {
    background: #2B2D2F;
    color: #C8C3BC;
}

button {
    padding: 10px 16px;
    background: #2B2D2F;
    color: #C8C3BC;
    border: 1px solid #393D40;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

button:hover {
    background-color: #131516;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    body {
        padding: 8px;
    }

    #dna-section {
    max-width: 100%;
    }

    .dashboard-layout {
        flex-direction: column;
        overflow-y: auto;
    }

    .stat-badge,
    .sidebar-stats {
        display: none;
    }

    h2 {
        font-size: 1.2rem;
        margin-bottom: 8px;
    }

    #dna-seq {
    width: 100%;
    }

    #dna-status {
    width: 100%;
    }

    #page-input {
    display: none;
    }
}
