/* Local font-face overrides (place your font files in public/fonts/)
     Expected files: /fonts/Geologica.woff2, /fonts/Geologica.woff,
                                     /fonts/Inter-Var.woff2, /fonts/Inter-Var.woff */
@font-face {
    font-family: 'Geologica Light';
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url('/fonts/Geologica-Light.woff2') format('woff2'),
        url('/fonts/Geologica-Light.woff') format('woff')
}

@font-face {
    font-family: 'Geologica Medium';
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url('/fonts/Geologica-Medium.woff2') format('woff2'),
        url('/fonts/Geologica-Medium.woff') format('woff')
}

/* Smooth theme transition: applied only to a small set of high-level elements
   to avoid expensive transitions on every single node (tables, lists, etc.). */
body.theme-transition .lk-menu,
body.theme-transition .page-header,
body.theme-transition .auth-header-inner,
body.theme-transition .card,
body.theme-transition table,
body.theme-transition pre {
    transition: background-color .28s ease, color .28s ease, border-color .28s ease, box-shadow .28s ease, opacity .28s ease;
}

html,
body {
    height: 100%
}

body {
    margin: 0px;
    padding: 0px;
    font-family: 'Geologica Light', sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 100;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1 {
    font-size: 1.8rem;
    margin: 0 0 12px 0
}

/*--- menu and header styles ---*/
.menu {
    width: 180px;
    /* background: #2c3e50; */
    color: white;
    display: flex;
    flex-direction: column;
    padding: 0;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.15);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.card {
    padding: 20px;
}

.main-content {
    margin-left: 180px;
    flex: 1;
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg);
    scrollbar-gutter: stable;
}

.admin-sidebar {
    width: 180px;
    /* background: #2c3e50; */
    color: white;
    display: flex;
    flex-direction: column;
    padding: 0;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.15);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-menu {
    list-style: none;
    flex: 1;
    padding: 7px 0;
}

.sidebar-menu li
 {
    margin: 0;
    padding: 0;
}

.sidebar-header {
    /* background: linear-gradient(135deg, #888 0%, #666 100%); */
    /* padding: 20px; */
    font-weight: 700;
    letter-spacing: 0.5px;
    text-align: center;
    font-size: 26px;
}

.sidebar-header h2 {
    font-size: 26px;
    color: var(--text);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.menu-text {
    font-size: 14px;
    font-weight: 500;
}

.menu-item.active {
    background: var(--panel);
    color: var(--text-active);
    border-left-color: var(--muted);
    padding-left: 18px;

}
.menu-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 15px 20px;
    color: var(--text);
    text-decoration: none;
    border-left: 4px solid transparent;
    position: relative;
}

.menu-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--muted);
}

.menu-icon {
    font-size: 16px;
    min-width: 20px;
    text-align: center;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Header previously inlined in auth.html */
.auth-header {
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
}
.auth-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 30px 42px;
    box-sizing: border-box;
}
.auth-header h1 {
    margin: 0; /* match previous inline margin:0 */
}

/* Generic page header and action helpers for non-auth pages */
.page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    box-sizing: border-box;
    justify-content: space-between;
}

.header-lk {
    padding: 22px 32px;
}

.page-header h1 { margin: 0; }

/* Small actions area for headers (used inside .auth-header-inner) */
.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* LK menu */

.lk-actions { display:flex; gap:8px; align-items:center;justify-content: center;margin-bottom: 20px; }


/* Helper: add top padding to pages that need space for absolute header */
.with-header-padding { padding-top: 120px; }

#fpCanvas {
    display: none
}

#loader {
    padding: 14px 12px;
    background: var(--panel);
    border: 1px solid var(--border);
    display: none;
    margin-bottom: 12px;
    color: var(--muted);
}

#result {
    margin: 8px 0 12px 0
}

pre#details {
    background: var(--accent);
    color: var(--text);
    padding: 8px;
    /* border: 1px solid var(--border); */
    display: none;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--bg);
    border-radius: 8px;
}

a {
    color: var(--text)
}

button {
    border: none;
    border-radius: 8px;
    box-sizing: border-box;
    cursor: pointer;
    display: inline-block;
    outline: none;
    padding: 0;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    text-size-adjust: none;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
    touch-action: manipulation;
    transition-duration: .1s, .15s, .15s, .15s, .15s, .15s, .15s;
    transition-property: all, padding, margin, font-size, line-height, height, width;
    transition-timing-function: cubic-bezier(.45, 0, .55, 1), cubic-bezier(.81, 0, .04, 1), cubic-bezier(.81, 0, .04, 1), cubic-bezier(.81, 0, .04, 1), cubic-bezier(.81, 0, .04, 1), cubic-bezier(.81, 0, .04, 1), cubic-bezier(.81, 0, .04, 1);
    -webkit-user-select: none;
    user-select: none;
    transition: all 0.3s ease-in-out;
}

#themeToggle {

    font-size: 14px;
    font-weight: 300;
    height: 32px;
    width: 32px;

    letter-spacing: -.02em;
    line-height: 17px;
    padding: 6px 8px;

    background-color: var(--hover);
    color: #fff;
}

#reload, .reload {

    font-size: 14px;
    font-weight: 300;
    height: 31px;

    letter-spacing: -.02em;
    line-height: 17px;
    padding: 6px 8px;

    background-color: var(--hover);
    color: #fff;
    margin-top: 6px;
}

#reload:hover, .reload:hover, #themeToggle:hover {
    background-color: var(--muted);
    
}

.delete-domain {
    font-size: 14px;
    font-weight: 300;
    height: 31px;
    letter-spacing: -.02em;
    line-height: 17px;
    padding: 6px 8px;
    background-color: var(--hover);
    color: #fff;
    width: 100%;
}
.delete-domain:hover {
    background-color: var(--muted);
}


/* page-specific helpers */
#result {
    font-size: 110%;
    padding: 8px 0
}

/* clicks table styles */
table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.8rem;
    line-height: 20px;
}

thead th {
    border-color: var(--panel);
    background: var(--panel);
}

th {
    
    font-size: 1rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

tr:hover {
    background: var(--border);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

th,
td {
    border: 1px solid var(--panel);
    padding: 6px;
    text-align: left;
    white-space: nowrap;
}

.controls {
    margin-top: 8px;
    display: flex;
    gap: 12px;
    align-items: end;

}

#limit {
    width: 62px
}

/* form input styles */
.ds-textfield {
    -webkit-appearance: none;
    border: 1px solid #cbcdd6;
    border-radius: 8px;
    box-sizing: border-box;
    display: inline-block;
    outline: none;
    padding: 6px 8px;
    /* touch-action: manipulation; */
    width: 100%;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
    /* background-color: #fff; */
    color: #2b2f33;
    font-family: inherit;
    font-size: 16px;
    font-weight: 300;
    letter-spacing: -.02em;
    line-height: 17px;
    transition: all .3s;
}

.ds-textfield:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.3);
}

/*form*/

#registerForm, #loginForm {
    max-width: 300px;
    margin: auto;
    flex-direction: column;
    text-align: center;
    /* border: solid 1px var(--border); */
    border-radius: 8px;
    padding: 26px;
}

#registerForm label, #loginForm label {
    display: block;
    text-align: left;
    font-size: 0.75rem;
}

/* Domains page helper classes (migrated from inline styles) */
.msg-box { padding:8px; margin-bottom:12px;display: none;}
.mb-12 { margin-bottom:12px; }
.cf-label { display:block; margin-bottom:6px; font-size:13px; }
.ip-box { padding:8px; border:1px solid #eee; margin-bottom:12px; font-size:13px; }
.domain-cell { width:25%; min-width:25%; max-width:25%; overflow-x: auto; overflow-y: visible; white-space: nowrap; text-overflow: ellipsis; }
.status-cell { width:10%; min-width:10%; max-width:10%; }
.progress-wrap { margin-top:8px; max-width:100%; width:100%; }
.progress { background:#eee; border:1px solid #ddd; height:10px; width:100%; position:relative; }
.progress .bar {
    background: var(--accent, #4caf50);
    height: 100%;
    width: 0%;
    transition: width 0.4s;
    display: block;

}
.progress-label { font-size:11px; color:#666; text-align:center; margin-top:4px; }
.status-issued { color:var(--accent); }
.status-none { color:#666; }
.status-error { color: var(--error); }
.bind-ok-icon { color:var(--accent); font-size:18px; line-height:1; }
.bind-fail-icon { color: var(--error); font-size:18px; line-height:1; }
.bind-info { font-size:11px; color:#666; display:flex; align-items:center; gap: 3px;}
.td-row { display: flex; flex-direction: row; gap: 3px; }
.bind-cell { width: 22%; min-width: 22%; max-width: 22%; }
.center { text-align:center; }
.inline-form { display:inline; }

#registerForm input, #loginForm input {
    /* margin-bottom: 12px; */
    text-align: center;
    font-size: 1rem;
}

#registerBtn, #loginBtn, #logoutBtn, .captcha-modal__cancel, .captcha-modal__ok {
    /* margin-top: 12px; */
    font-size: 14px;
    font-weight: 300;

    letter-spacing: -.02em;
    line-height: 17px;
    padding: 16px 28px;

    background-color: var(--hover);
    color: #fff;

    border-radius: 8px;
}

#registerBtn:hover, #loginBtn:hover, #logoutBtn:hover, .captcha-modal__cancel:hover, .captcha-modal__ok:hover {
    background-color: var(--muted);
    
}

/* Auth sliding container */
.auth-container {
    max-width: 420px;
    margin: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 90%;
}
.auth-switch {
    display: inline-flex;
    gap: 6px;
    margin-bottom: 12px;
}
.auth-toggle {
    padding: 8px 14px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.auth-toggle[aria-pressed="true"] {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.auth-viewport {
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: transparent;
}
.auth-strip {
    display: flex;
    width: 200%;
    transform: translateX(0%);
    transition: transform 600ms cubic-bezier(.2,.8,.2,1);
    align-items: center;
}
.auth-panel {
    width: 50%;
    padding: 18px;
    box-sizing: border-box;
}
.auth-panel .card {
    border: none;
    padding: 0;
    box-shadow: none;
}

@media (max-width: 640px) {
    .auth-container { padding: 12px; }
    .auth-strip { width: 200%; }
    .auth-panel { width: 100%; }
}

/* Captcha modal styles (used by client-side auth modal) */
.captcha-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.captcha-modal__box {
    background: var(--panel);
    padding: 24px;
    border-radius: 8px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 6px 24px rgba(0,0,0,0.25);
    box-sizing: border-box;
}

.captcha-modal__input { width: 100%; padding: 8px; margin-bottom: 12px; margin-top: 12px; box-sizing: border-box; border: 1px solid var(--border); border-radius: 6px; }
.captcha-modal__input.is-error { border-color: #e53e3e; box-shadow: 0 0 0 3px rgba(229,62,62,0.06); }
.captcha-modal__actions { text-align: right; }
.captcha-modal__ok { margin-left: 8px; }
.captcha-modal__cancel { margin-right: 8px; }

/* Responsive: make table horizontally scrollable on small screens */
@media (max-width: 640px) {
    .main-content { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table { min-width: 900px; }
    th, td { white-space: nowrap; }
    .table-container {overflow-x: auto; -webkit-overflow-scrolling: touch;}
}