@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono&display=swap');

:root {
    --bg-darkest: #05070a;
    --bg-card: #0d1117;
    --bg-nav: rgba(13, 17, 23, 0.8);
    --accent-blue: #6c47ff;
    --accent-glow: rgba(108, 71, 255, 0.3);
    --text-main: #edeff2;
    --text-dim: #9ba1a6;
    --border-color: rgba(255, 255, 255, 0.05);
    --success: #00ff88;
    --danger: #ff4d4d;
    --warning: #ffc107;
    color-scheme: dark;
}

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

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

/* Altcha Widget Styling */
altcha-widget {
    --altcha-max-width: 100%;
    --altcha-border-width: 1px;
    --altcha-border-radius: 8px;
    --altcha-color-base: transparent;
    --altcha-color-border: var(--border-color);
    --altcha-color-text: var(--text-main);
    --altcha-color-border-focus: var(--accent-blue);
    --altcha-color-footer-bg: transparent;
    --altcha-color-error-text: var(--danger);
    display: block;
}

altcha-widget div {
    margin-bottom: 0 !important;
}

altcha-widget .altcha-main {
    padding: 1.2rem 1.5rem !important;
    gap: 1rem !important;
    display: flex !important;
    align-items: center !important;
}

altcha-widget .altcha-checkbox {
    width: 24px !important;
    height: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
}

altcha-widget input[type="checkbox"] {
    width: 24px !important;
    height: 24px !important;
    background-color: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 4px !important;
    margin: 0 !important;
    cursor: pointer;
    accent-color: var(--accent-blue);
}

altcha-widget .altcha-label {
    font-size: 0.95rem !important;
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
    line-height: 1 !important;
}

altcha-widget:focus-within input[type="checkbox"] {
    border-color: var(--accent-blue) !important;
}

/* obfuscated text input — replaces type=password to avoid browser save-password prompts */
.obfuscated-secret {
    -webkit-text-security: disc;
    font-family: inherit !important;
    letter-spacing: 2px;
}

/* fix for the "white background" issue during modal active state */
body.modal-active {
    background-color: #020408 !important;
    overflow: hidden;
}

body.modal-active::before {
    content: '';
    position: fixed;
    inset: 0;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 500; /* Above content (0), below header (1000) and modals (9999) */
    pointer-events: none;
}

body.modal-active .container,
body.modal-active .admin-sidebar,
body.modal-active .admin-main,
body.modal-active .auth-card {
    pointer-events: none;
    user-select: none;
}

/* role colors */
.role-admin {
    color: #ff4d4d !important;
    font-weight: 700;
}

.role-support {
    color: #ffaa00 !important;
    font-weight: 600;
}

.role-customer {
    color: #00d4ff !important;
    font-weight: 600;
}

.role-user {
    color: #fff !important;
}

* {
    box-sizing: border-box;
    transition: background 0.2s ease, border 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.manage-user-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    column-gap: 2rem;
    row-gap: 0;
}

select,
option {
    transition: none !important;
}

html {
    background-color: #020408 !important;
}

body {
    background-color: #020408 !important;
    color: var(--text-main);
    font-family: 'Inter', -apple-system, sans-serif;
    margin: 0;
    line-height: 1.6;
    background-image:
        radial-gradient(circle at 50% 0%, rgba(108, 71, 255, 0.15), transparent 40%),
        radial-gradient(circle at 100% 0%, rgba(108, 71, 255, 0.05), transparent 30%) !important;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    scrollbar-gutter: stable;
    overflow-x: hidden;
    max-width: 100vw;
}

/* animate only the content, not the sticky header or fixed sidebar wrappers */
main,
.container:not(header .container),
.admin-main,
.auth-card {
    animation: pageFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* glassmorphism navigation */
header {
    background-color: transparent;
    /* remove background, keep only blur */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.2rem 5%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 6000; /* Above the blur (5000) */
}

.logo {
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: -0.5px;
    text-decoration: none !important;
    color: #fff !important;
    display: flex;
    align-items: center;
}

.logo:hover {
    text-decoration: none !important;
}

.logo img {
    height: 40px;
    width: 40px;
    border-radius: 8px;
    object-fit: cover;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a,
.nav-links button {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
    background: none;
    border: none;
    padding: 0.3rem 0;
    cursor: pointer;
    position: relative;
    display: inline-flex;
    align-items: center;
    line-height: 1.2;
}

.nav-links a:hover,
.nav-links button:hover {
    color: #fff;
    text-decoration: none;
}

/* underline only for standard links, not buttons */
.nav-links a:not(.btn-nav):not(.btn-primary)::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-blue);
    transition: width 0.3s ease;
}

.nav-links a:not(.btn-nav):not(.btn-primary):hover::after {
    width: 100%;
}

.nav-links .btn-nav {
    background: var(--accent-blue);
    color: #fff !important;
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-family: inherit;
    box-shadow: 0 4px 14px 0 rgba(108, 71, 255, 0.25);
}

.nav-links .btn-nav:hover {
    background: #5a38e0;
    box-shadow: 0 6px 20px rgba(108, 71, 255, 0.4);
    transform: translateY(-1px);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
    transition: filter 0.3s ease, transform 0.3s ease;
    backdrop-filter: blur(0px);
}

.flex-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
}

/* modern card design */
.card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
    opacity: 0.3;
}

h1,
h2,
h3 {
    margin-top: 0;
    letter-spacing: -0.5px;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #fff;
    text-decoration: underline;
}

/* sleek inputs */
input,
select,
textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: #fff;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    margin-top: 0.5rem;
    color-scheme: dark;
    transition: all 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent-blue);
    background-color: rgba(255, 255, 255, 0.03);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

select option {
    background-color: #161b22;
    color: #fff;
}

/* buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    text-align: center;
    font-size: 0.95rem;
    text-decoration: none;
    white-space: nowrap;
    transition: none !important;
}

.btn-primary {
    background-color: var(--accent-blue);
    color: #fff;
    box-shadow: 0 4px 14px 0 rgba(108, 71, 255, 0.3);
}

.btn-primary:hover {
    background-color: #5a38e0;
    box-shadow: 0 6px 20px rgba(108, 71, 255, 0.4);
    transform: translateY(-1px);
}

.btn-discord {
    background-color: #5865F2;
    color: #fff !important;
    gap: 0.75rem;
}

.btn-discord:hover {
    background-color: #4752C4;
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.4);
    transform: translateY(-1px);
}

.btn-discord svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.btn-outline {
    background: transparent;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-main);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
    transform: translateY(-1px);
}

.btn-small {
    height: 38px;
    padding: 0 1.2rem;
    font-size: 0.85rem;
    border-radius: 6px;
}

.btn-danger {
    background-color: var(--danger);
    color: #fff;
}

/* smooth avatar loading */
.avatar-container {
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.avatar-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    margin-top: 1rem;
}

/* rich content support */
.rich-content h1,
.rich-content h2,
.rich-content h3 {
    color: #fff;
    margin: 1.5rem 0 1rem 0;
}

.rich-content p {
    margin-bottom: 1rem;
    color: var(--text-dim);
}

.rich-content ul,
.rich-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.rich-content li {
    margin-bottom: 0.5rem;
    color: var(--text-dim);
}

.rich-content pre {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.rich-content details {
    background: transparent;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    overflow: hidden;
}

.rich-content details:hover {
    border-color: rgba(108, 71, 255, 0.3);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.rich-content details[open] {
    border-color: var(--accent-blue);
    background: rgba(108, 71, 255, 0.05);
}

.rich-content summary {
    cursor: pointer;
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
    outline: none;
    list-style: none; /* Hide default arrow */
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.2s ease;
    margin-bottom: 0;
}

.rich-content summary::-webkit-details-marker {
    display: none;
}

.rich-content summary::after {
    content: '+';
    color: var(--accent-blue);
    font-size: 1.5rem;
    font-weight: 300;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(108, 71, 255, 0.1);
    line-height: 1;
}

.rich-content details[open] summary::after {
    content: '−';
    transform: rotate(180deg);
}

.rich-content details > *:not(summary) {
    margin-top: 1rem;
    margin-bottom: 0;
    animation: detailsFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes detailsFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rich-content hr {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 2rem 0;
}

.rich-content img {
    max-width: 100%;
    border-radius: 12px;
}

th {
    color: var(--text-dim);
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    padding: 0 1rem;
    text-align: center;
}

th:first-child,
td:first-child {
    text-align: left;
}

td {
    padding: 1.2rem 1rem;
    background-color: transparent;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    vertical-align: middle;
}

td:first-child {
    border-left: 1px solid var(--border-color);
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

td:last-child {
    border-right: 1px solid var(--border-color);
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

code {
    font-family: 'JetBrains Mono', monospace;
    background: rgba(108, 71, 255, 0.1);
    color: var(--accent-blue);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

/* alerts */
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.card-placeholder {
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 4rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.card-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
    opacity: 0.3;
}

.card-placeholder i,
.card-placeholder .icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.card-placeholder p {
    margin: 0;
    max-width: 400px;
    line-height: 1.6;
}

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-success {
    background: rgba(0, 255, 136, 0.1);
    color: var(--success);
    border: 1px solid rgba(0, 255, 136, 0.2);
}

.alert-danger {
    background: rgba(255, 77, 77, 0.1);
    color: var(--danger);
    border: 1px solid rgba(255, 77, 77, 0.2);
}

.hero {
    text-align: center;
    padding: 5rem 1rem;
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.hero p {
    color: var(--text-dim);
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

/* profile settings */
.profile-settings-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 4rem;
}

.profile-avatar-column {
    text-align: center;
    border-right: 1px solid var(--border-color);
    padding-right: 4rem;
}

.profile-input-group {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.profile-input-group input {
    flex: 1;
    margin-top: 0;
}

.profile-input-group button {
    padding: 0.8rem 1.5rem;
    align-self: flex-start;
    min-height: 42px;
}


/* admin dashboard layout */

.admin-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.admin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

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

.admin-search-form {
    display: flex;
    gap: 0.5rem;
    margin: 0;
    align-items: stretch;
    flex-wrap: wrap;
}

.admin-search-input {
    padding: 0 1.2rem;
    border-radius: 8px;
    width: 280px;
    max-width: 100%;
    height: 42px;
    margin: 0;
    box-sizing: border-box;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(520px, 1fr));
    gap: 3.5rem;
    margin-top: 3rem;
    justify-content: center;
}

@media (max-width: 1300px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
        gap: 2.5rem;
    }
}

@media (max-width: 992px) {
    .product-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.dashboard-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.oauth-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.security-settings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 1fr;
    gap: 2rem;
    margin-top: 2rem;
    align-items: stretch;
}

@media (max-width: 1200px) {
    .security-settings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.recent-activity-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    margin-top: 3rem;
    border-top: 1px solid var(--border-color);
    padding-top: 5rem;
}

.admin-layout {
    display: flex;
    opacity: 0;
}

.admin-layout.ready {
    opacity: 1;
}

.admin-sidebar {
    width: 280px;
    background: transparent;
    border-right: none;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Desktop Stationary Sidebar */
@media (min-width: 769px) {
    .admin-sidebar {
        position: fixed;
        top: 64px;
        left: 0;
        bottom: 0;
        width: 280px;
        z-index: 100;
        overflow-y: auto;
    }
    .admin-main {
        margin-left: 280px;
    }
}
/* kys */
/* dynamic footer for admin and dashbord */
@media (min-width: 769px) and (max-width: 1760px) {
    /* apply offset only if sidebar overlaps centered content (1200px + 2*280px = 1760px) */
    .admin-layout ~ .site-footer {
        padding-left: 280px;
    }
}

.admin-sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.8rem 1.2rem;
    color: var(--text-dim);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
}

.admin-sidebar-link:hover,
.admin-sidebar-link.active {
    background: rgba(108, 71, 255, 0.1);
    color: var(--accent-blue);
}

.admin-main {
    flex: 1;
    padding: 3rem;
    background: transparent;
}

.admin-section {
    display: none;
    opacity: 0;
    transform: translateY(8px);
}

.admin-section.active {
    display: block;
    animation: adminFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.page-fade-in {
    opacity: 0;
    transform: translateY(10px);
    animation: adminFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes adminFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* product grid & cards */

.product-card {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-blue);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.product-card .card-content {
    flex: 1;
}

.product-card .description {
    color: var(--text-dim);
    font-size: 0.95rem;
    margin: 1rem 0;
    min-height: 3em;
}

.product-card .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.price-tag {
    font-weight: 800;
    font-size: 1.75rem;
    color: #fff;
}

.button-group {
    display: flex;
    gap: 0.75rem;
}

.btn-stripe {
    background: rgba(103, 114, 229, 0.1);
    border: 1px solid #6772e5;
    color: #fff;
}

.btn-stripe:hover {
    background: #6772e5;
    transform: translateY(-2px);
}

/* payment selection modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: rgba(255, 255, 255, 0.01);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 1.5rem 2rem;
    width: 95%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@media screen and (max-width: 768px) {
    .modal-content {
        padding: 1.25rem;
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }
}

.modal-title {
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.2;
}

@media screen and (max-width: 768px) {
    .modal-title {
        font-size: 1.3rem;
    }
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
        backdrop-filter: blur(0px);
        -webkit-backdrop-filter: blur(0px);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    cursor: pointer;
    color: var(--text-dim);
    font-size: 1.2rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.payment-options-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.payment-opt {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    text-align: left;
    width: 100%;
}

.payment-opt:hover {
    border-color: var(--accent-blue);
    background: rgba(108, 71, 255, 0.05);
}

.payment-opt img {
    width: 32px;
    height: 32px;
}

.payment-opt .opt-text {
    flex: 1;
}

.payment-opt .opt-title {
    display: block;
    font-weight: 600;
    color: #fff;
}

.payment-opt .opt-sub {
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* admin plan management refinement */
.plans-container {
    background: transparent;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.plan-header-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr 100px;
    gap: 1rem;
    padding: 0 1rem 0.75rem 1rem;
    color: var(--text-dim);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.plan-item-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr 100px;
    gap: 1rem;
    padding: 1rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    align-items: center;
}

.plan-item-row:hover {
    border-color: rgba(108, 71, 255, 0.3);
    background: rgba(255, 255, 255, 0.04);
}

/* 1. Modify the form to ensure the wrapper spans the correct column */
.plan-add-form {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr 100px;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    align-items: flex-end;
}

/* Update the wrapper to align properly in the grid */
.price-input-wrapper {
    position: relative;
    display: flex;
    /* Keeps the $ and input on one line */
    align-items: center;
    width: 100%;
    /* Ensure it doesn't create extra height */
    margin: 0;
    padding: 0;
}

/* Ensure the symbol is vertically centered within the wrapper */
.currency-symbol {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    /* Perfectly centers the $ vertically */
    color: var(--text-dim);
    font-size: 0.85rem;
    pointer-events: none;
    z-index: 5;
}

/* Ensure the input itself matches the height of the others */
.price-input-wrapper .plan-input {
    margin: 0 !important;
    /* Removes any top/bottom margin causing it to jump up */
    padding-left: 1.5rem !important;
    display: block;
}

/* forms */
form div {
    margin-bottom: 1.25rem;
}

.auth-card {
    max-width: 450px;
    margin: 8rem auto;
    padding: 3rem;
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    color: var(--text-dim);
    font-size: 0.95rem;
}



/* footer */
.site-footer {
    background: transparent;
    padding: 5rem 0 3rem 0;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    gap: 4rem;
    flex-wrap: wrap;
}

.footer-brand {
    max-width: 350px;
}

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

.brand-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
}

.footer-logo {
    height: 48px;
    width: 48px;
    border-radius: 10px;
    object-fit: cover;
}

.footer-brand h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    color: #fff;
}

.footer-tagline {
    color: var(--text-dim);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-top: 1.5rem;
}

.footer-links {
    display: flex;
    gap: 5rem;
    flex-wrap: wrap;
}

.link-group h4 {
    color: #fff;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.link-group a {
    display: block;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
    transition: color 0.2s ease;
}

.link-group a:hover {
    color: var(--accent-blue);
    text-decoration: none;
}

.footer-bottom {
    margin-top: 5rem;
    padding-top: 2rem;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.85rem;
}

/* base element extraction from index.html */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* mobile menu button - hidden by default on desktop */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
    /* above mobile menu */
}

.mobile-menu-btn:hover {
    color: #fff;
}

/* ========================================================================= */
/* media queries for mobile responsiveness                                   */
/* ========================================================================= */

@media (max-width: 900px) {

    /* header & navigation */
    .mobile-menu-btn {
        display: block;
    }

    /* wrap header inner content to allow stacking of alerts */
    header>div:first-child {
        flex-wrap: wrap;
    }

    header .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(5, 7, 10, 0.6);
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        flex-direction: column;
        padding: 1.5rem 2rem;
        gap: 0.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
        height: 100vh;
        z-index: 1001;
    }

    header .nav-links.active {
        display: flex;
    }

    header .nav-links a,
    header .nav-links button {
        width: 100%;
        text-align: left;
        padding: 1rem 1.5rem;
        justify-content: flex-start;
        font-size: 1.05rem;
        border-radius: 8px;
        color: #fff !important;
        font-weight: 500;
    }

    header .nav-links a:not(.btn-nav):hover,
    header .nav-links button:not(.btn-nav):hover {
        background: rgba(255, 255, 255, 0.05);
        text-decoration: none;
    }

    header .nav-links a:not(.btn-nav):not(.btn-primary)::after {
        display: none !important;
    }

    .nav-links .btn-nav {
        text-align: center;
        justify-content: center;
        margin-top: 0.5rem;
    }
}

@media (max-width: 768px) {

    /* global adjustments */
    .container {
        padding: 0 1.5rem;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .card {
        padding: 1.5rem;
        max-width: 100vw;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
    }

    /* hero section */
    .hero {
        padding: 6rem 1rem 4rem 1rem !important;
        /* override inline styles on index.html */
    }

    section[style*="padding: 12rem"] {
        padding: 6rem 1rem 4rem 1rem !important;
    }

    section[style*="padding: 2rem 0 10rem"] {
        padding: 2rem 0 4rem 0 !important;
    }

    .hero h1,
    h1[style*="font-size: 4.5rem"] {
        font-size: 2.8rem !important;
        margin-bottom: 1rem;
    }

    .hero p,
    p[style*="font-size: 1.25rem"] {
        font-size: 1rem !important;
        padding: 0 1rem;
        margin-bottom: 2rem !important;
    }

    div[style*="margin-bottom: 3.5rem"] h2 {
        font-size: 2.2rem !important;
    }

    /* grids */
    .features-grid,
    .product-grid,
    .oauth-grid,
    .profile-settings-grid,
    .security-settings-grid,
    .recent-activity-grid,
    .settings-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    .profile-avatar-column {
        border-right: none !important;
        border-bottom: 1px solid var(--border-color);
        padding-right: 0 !important;
        padding-bottom: 2rem;
    }

    .profile-input-group {
        flex-direction: column;
        width: 100%;
    }

    .profile-input-group input {
        width: 100%;
        box-sizing: border-box;
    }

    .profile-input-group button {
        width: 100%;
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .feature-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.5rem;
    }

    .feature-card[style*="grid-column"] {
        grid-column: 1 / -1 !important;
    }

    /* admin layout */
    .admin-layout {
        flex-direction: column;
        max-width: 100vw;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .dashboard-header-flex,
    .admin-header-flex {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 1.5rem;
        gap: 1rem;
    }

    .admin-actions-group {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .admin-actions-group>* {
        width: 100%;
    }

    .admin-actions-group select,
    .admin-actions-group button {
        width: 100% !important;
    }

    .admin-search-form {
        flex-direction: column;
        width: 100%;
    }

    .admin-search-input {
        width: 100% !important;
    }

    .admin-main {
        padding: 2rem 1.25rem !important;
        /* standardize padding on mobile */
        max-width: 100vw;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .admin-sidebar {
        width: 100%;
        padding: 1rem 1.5rem;
        flex-direction: row;
        overflow-x: auto;
        border-bottom: 1px solid var(--border-color);
        border-right: none;
        box-sizing: border-box;
        justify-content: flex-start;
        align-items: center;
        gap: 0.5rem;
    }

    .admin-sidebar>div[style*="text-align: center"],
    .admin-sidebar-header {
        display: none !important;
    }

    .admin-sidebar-link {
        white-space: nowrap;
        padding: 0.5rem 1.2rem;
        margin: 0;
        border-radius: 100px;
        background: rgba(255, 255, 255, 0.03);
    }

    .admin-sidebar-link.active {
        background: var(--accent-blue);
        color: #fff;
    }

    .admin-sidebar-submenu {
        display: none;
        flex-direction: row;
        gap: 0.5rem;
        padding: 0 !important;
        margin: 0 !important;
    }

    .admin-sidebar-submenu[style*="display: block"] {
        display: flex !important;
    }

    .admin-sidebar-submenu .admin-sidebar-link {
        border-left: none !important;
        font-size: 0.85rem !important;
    }

    .admin-main {
        padding: 2rem 1.25rem !important;
        max-width: 100vw;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    /* forms & auth */
    .auth-card {
        margin: 2rem auto;
        padding: 2rem 1.5rem;
        width: 100%;
        max-width: calc(100vw - 2.5rem);
    }

    /* tables */
    .table-responsive-wrapper {
        margin: 1rem -1.5rem;
        padding: 0 1.5rem;
        width: auto;
        box-sizing: border-box;
    }

    /* convert logs, users & licenses tables into cards */
    .logs-table,
    .logs-table tbody,
    .logs-table tr,
    .logs-table td,
    .users-table,
    .users-table tbody,
    .users-table tr,
    .users-table td,
    .licenses-table,
    .licenses-table tbody,
    .licenses-table tr,
    .licenses-table td,
    .recent-logins-table,
    .recent-logins-table tbody,
    .recent-logins-table tr,
    .recent-logins-table td {
        display: block;
        width: 100%;
    }

    .logs-table thead,
    .users-table thead,
    .licenses-table thead,
    .recent-logins-table thead {
        display: none;
        /* hide standard headers */
    }

    .logs-table tr,
    .users-table tr,
    .licenses-table tr,
    .recent-logins-table tr {
        margin-bottom: 1.5rem;
        border: 1px solid var(--border-color);
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.02);
        overflow: hidden;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }

    .logs-table td,
    .users-table td,
    .licenses-table td,
    .recent-logins-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        padding: 0.9rem 1.25rem;
        border: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        word-break: break-word;
    }

    .logs-table td:last-child,
    .users-table td:last-child,
    .licenses-table td:last-child,
    .recent-logins-table td:last-child {
        border-bottom: none;
    }

    /* use pseudo-element for mobile labels */
    .logs-table td::before,
    .users-table td::before,
    .licenses-table td::before,
    .recent-logins-table td::before {
        content: attr(data-label);
        font-weight: 600;
        text-transform: uppercase;
        font-size: 0.75rem;
        color: var(--text-dim);
        text-align: left;
        margin-right: 1rem;
        flex-shrink: 0;
    }

    /* make manage button full-width on mobile */
    .licenses-table td:last-child .btn {
        width: 100%;
    }

    /* modals */
    .modal-content {
        padding: 1.25rem;
        max-height: 95vh;
        overflow-y: auto;
        width: 95%;
        margin: auto;
    }

    .payment-opt {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        gap: 1rem;
    }

    /* footer */
    .site-footer {
        padding: 3rem 0;
    }

    .footer-content {
        flex-direction: column;
        gap: 2.5rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 2rem;
    }

    .plan-header-grid,
    .plan-item-row,
    .plan-add-form {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .plan-header-grid {
        display: none;
        /* hide headers on mobile */
    }

    .plan-item-row {
        position: relative;
        padding-bottom: 3.5rem;
    }

    .plan-item-row button {
        position: absolute;
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
        width: calc(100% - 2rem);
    }

    .manage-user-grid {
        grid-template-columns: 1fr;
        row-gap: 1.5rem;
        /* tighter gap between identity & edit profile */
    }

    /* shrink identity box vertical padding */
    .manage-user-grid>div>div[style*="background: transparent"] {
        padding: 1.25rem 1rem !important;
    }

    /* shrink profile picture slightly */
    #manage-user-pfp-container {
        width: 80px !important;
        height: 80px !important;
        margin-bottom: 0.5rem !important;
    }

    /* compress user inputs */
    #modal-manage-user input {
        margin-bottom: 0.6rem !important;
        padding: 0.5rem !important;
    }

    /* compress row 2 (actions & restrictions) margin top */
    .manage-user-grid+div,
    #modal-manage-user>div>div>div:nth-child(4),
    #modal-manage-user>div>div>div:nth-child(5) {
        margin-top: 1rem !important;
    }
}

/* --- Custom Dropdown Search System --- */

/* 1. Container - necessary for the results to float correctly */
.custom-dropdown-container {
    position: relative;
    display: flex;
    flex-direction: column;
}

/* 2. The Floating Results Box */
.custom-dropdown-results {
    /* 1. Remove the large gap */
    margin-top: 0.25rem;
    /* Small 4px gap for a clean look */
    padding: 0.5rem;
    /* Tighter internal padding */

    /* 2. Set to absolute to float OVER the button below */
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;

    /* 3. Aesthetic & Scroll (remains the same) */
    background: rgba(13, 17, 23, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-height: 200px;
    overflow-y: auto;
    display: none;
    /* Hidden until populated */
}

/* Automatic show when content exists */
.custom-dropdown-results:not(:empty) {
    display: block;
    animation: modalSlideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 3. Custom Scrollbar Styling (Matches Site Theme) */
.custom-dropdown-results::-webkit-scrollbar {
    width: 6px;
}

.custom-dropdown-results::-webkit-scrollbar-track {
    background: transparent;
}

.custom-dropdown-results::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid transparent;
}

.custom-dropdown-results::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}

/* 4. Individual Entry Styling */
.dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 4px;
    gap: 1rem;
}

.dropdown-item:last-child {
    margin-bottom: 0;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

/* 5. Typography & Color Hierarchy */
.dropdown-item .user-email {
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.dropdown-item .user-id {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    /* Forced accent blue as requested */
    color: var(--accent-blue) !important;
    background: rgba(108, 71, 255, 0.12);
    padding: 0.2rem 0.6rem;
    border-radius: 5px;
    border: 1px solid rgba(108, 71, 255, 0.2);
    flex-shrink: 0;
}

/* Interactive States: Swap colors on hover for legibility */
.dropdown-item:hover .user-id {
    color: #fff !important;
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

/* Empty/No Results State */
.dropdown-no-results {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.9rem;
    font-style: italic;
}

/* Override the dropdown to push the modal height */
#user-dropdown-results.custom-dropdown-results {
    position: relative; /* Changed from absolute */
    top: 0;
    margin-top: 1rem;
    width: 100%;
    /* Ensure the modal doesn't get too tall */
    max-height: 220px;
    overflow-y: auto;
    /* Optional: add a subtle border to separate from the input above */
    border-top: 1px solid var(--border-color);
}

/* Ensure the modal itself can grow and eventually scroll */
.modal-content {
    height: auto; /* Allow growth */
    max-height: 90vh; /* Don't go off screen */
    overflow-y: auto; /* Scroll the modal if the dropdown is massive */
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease; /* Smooth height change */
}

#user-search-filter {
    margin-bottom: 0 !important;
}

@media (max-width: 768px) {
    .trusted-device-item {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }
    .trusted-device-meta {
        flex-direction: column;
        gap: 0.25rem !important;
        margin-top: 0.25rem;
    }
    .trusted-device-meta-bullet {
        display: none !important;
    }
    .trusted-device-item form {
        margin-left: 0 !important;
        width: 100%;
    }
    .trusted-device-item button {
        width: 100%;
        justify-content: center;
    }
    }

    /* Custom Switch Toggle */
    .switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    }

    .switch input {
    opacity: 0;
    width: 0;
    height: 0;
    }

    .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.05);
    transition: .3s;
    border: 1px solid var(--border-color);
    }

    .slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-dim);
    transition: .3s;
    }

    input:checked + .slider {
    background-color: rgba(108, 71, 255, 0.1);
    border-color: var(--accent-blue);
    }

    input:checked + .slider:before {
    transform: translateX(20px);
    background-color: var(--accent-blue);
    }

    .slider.round {
    border-radius: 34px;
    }

    .slider.round:before {
    border-radius: 50%;
    }
/* Small height optimizations for foldables/phones */
@media (max-height: 700px) {
    .modal-content {
        padding: 1rem !important;
        max-height: 98vh !important;
    }
    #btcpay-custom-qr {
        width: 160px !important;
        height: 160px !important;
    }
    .modal-overlay {
        padding: 10px !important;
    }
    .modal-title {
        margin-top: 0 !important;
        margin-bottom: 0.75rem !important;
        font-size: 1.1rem !important;
    }
    #btcpay-method-tabs {
        margin-bottom: 1rem !important;
    }
    #btcpay-custom-content > div {
        margin-bottom: 1rem !important;
    }
    #btcpay-custom-qr-container {
        margin-bottom: 1rem !important;
    }
}
