:root {
    /* Core Brand Palette */
    --primary: #0ea5a8;
    --primary-dark: #0f766e;
    --secondary: #0f172a;
    --accent: #f59e0b;
    --danger: #ef4444;
    --success-soft: #dcfce7;
    --gray-light: #f1f5f9;
    --gray-mid: #94a3b8;
    --gray-dark: #1f2937;
    --border-soft: rgba(15, 23, 42, 0.12);

    /* Aliases for legacy inline styles */
    --primary-color: var(--primary);
    --secondary-color: var(--secondary);

    /* Layout & Shadow */
    --shadow-sm: 0 6px 16px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 14px 34px rgba(15, 23, 42, 0.12);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.16);
    --nav-shadow: rgba(15, 23, 42, 0.12);

    /* Typography */
    --font-body: "Plus Jakarta Sans", "Segoe UI", "Helvetica Neue", sans-serif;
    --font-display: "Space Grotesk", "Plus Jakarta Sans", sans-serif;
}

/* Global Reset & Typography */
body {
    font-family: var(--font-body);
    color: var(--gray-dark);
    background: radial-gradient(1200px 600px at 10% -10%, #d7f7f7 0%, transparent 60%),
        radial-gradient(900px 500px at 90% 0%, #fff1d2 0%, transparent 55%),
        #f6f7fb;
    margin: 0;
    padding-top: 72px;
    letter-spacing: 0.01em;
}

body.bg-light {
    background: radial-gradient(1200px 600px at 10% -10%, #d7f7f7 0%, transparent 60%),
        radial-gradient(900px 500px at 90% 0%, #fff1d2 0%, transparent 55%),
        #f6f7fb;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--secondary);
}

a {
    color: var(--primary);
    transition: color 0.2s ease, opacity 0.2s ease;
    text-decoration: none;
    font-weight: 600;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

.page-reveal {
    animation: rise-in 0.6s ease both;
}

@keyframes rise-in {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Common Layout Components */
.main-window {
    width: 100%;
    background: #fff;
    padding: 1.5rem;
    border-radius: 1.25rem;
    margin: 0.5rem;
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
}

.main-window:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
    color: var(--primary);
}

/* Under Construction */
.under-construction {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.75rem;
}

.under-construction__title {
    font-size: clamp(2.5rem, 4vw, 4rem);
    margin: 0;
    color: var(--secondary);
}

.under-construction__media {
    width: min(100%, 520px);
    border-radius: 1.25rem;
    overflow: hidden;
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-md);
    background: #fff;
}

.under-construction__media iframe {
    width: 100%;
    height: 360px;
    border: 0;
}

@media (min-width: 992px) {
    .under-construction__media iframe {
        height: 420px;
    }
}

/* QR Code System */
.qr-code-generator {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

#qrcode {
    width: 128px;
    height: 128px;
    margin: 1rem auto;
    text-align: center;
}

.qr-input-group {
    display: flex;
    gap: 0.5rem;
}

.qr-url { flex: 4; }
.qr-size { flex: 1; }

.qr-url, .qr-size {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    transition: border-color 0.2s;
}

.qr-url:focus, .qr-size:focus {
    border-color: var(--primary);
    outline: none;
}

.generate-qr-code {
    display: block;
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    background: linear-gradient(135deg, var(--danger), #f97316);
    color: #fff;
    transition: opacity 0.2s;
}

.generate-qr-code:hover {
    opacity: 0.9;
}

/* Navigation & Share Bars */
.navbar-share .nav-item {
    margin: 0 0.25rem;
    border-radius: 0.75rem;
    padding: 0.25rem;
    background: var(--gray-light);
    box-shadow: var(--shadow-sm);
}

.navbar-share .dropdown-item {
    border-radius: 0.375rem;
    transition: background-color 0.2s;
}

/* Custom UI Elements */
.swal-overlay {
    background-color: rgba(13, 148, 136, 0.2);
}

.my-button-class {
    background: linear-gradient(135deg, var(--danger), #f97316);
    color: white;
    border-radius: 0.75rem;
    font-weight: 600;
    border: none;
    padding: 0.5rem 1rem;
}

#imgGithub { width: 32px; height: 32px; object-fit: cover; border-radius: 50%; }
#imgGoogle { width: 32px; height: 32px; object-fit: cover; border-radius: 50%; }

.navbar-profile-img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2);
}

/* Tooltip System */
.tooltip_custom {
    position: relative;
    display: inline-block;
    border-bottom: 1px dotted var(--gray-mid);
}

.tooltip_custom .tooltiptext {
    visibility: hidden;
    background-color: #fff;
    color: var(--gray-dark);
    text-align: left;
    border-radius: 0.75rem;
    padding: 0.75rem;
    position: absolute;
    z-index: 100;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    min-width: 150px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-soft);
}

.tooltip_custom .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #fff transparent transparent transparent;
}

.tooltip_custom:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Modern Table Enhancements */
caption {
    background: linear-gradient(135deg, #38bdf8, #0ea5a8);
    color: #fff;
    caption-side: top;
    text-align: center;
    padding: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    border-radius: 0.75rem 0.75rem 0 0;
}

/* Modern Navbar */
.nav-modern {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.nav-modern .nav-link {
    color: var(--secondary);
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
}

.nav-modern .nav-link:hover,
.nav-modern .nav-link:focus {
    background: rgba(14, 165, 168, 0.12);
    color: var(--primary-dark);
}

.nav-modern .dropdown-menu {
    border-radius: 0.85rem;
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-md);
}

.nav-spacer {
    height: 0.75rem;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), #38bdf8);
    border: none;
    box-shadow: 0 10px 24px rgba(14, 165, 168, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.btn-outline-secondary,
.btn-outline-dark {
    border-radius: 999px;
    border-color: var(--border-soft);
}

/* Cards */
.card {
    border-radius: 1.25rem;
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-sm);
}

.card.shadow-lg,
.card.shadow-sm,
.card.shadow {
    box-shadow: var(--shadow-md);
}

/* Inputs */
.form-control,
.form-select,
.input-group-text {
    border-radius: 0.85rem;
    border-color: var(--border-soft);
}

.form-label {
    font-weight: 600;
    color: var(--secondary);
}

.form-label.small,
.text-muted.small {
    letter-spacing: 0.02em;
}

.form-control,
.form-select,
textarea.form-control {
    background: rgba(255, 255, 255, 0.92);
}

.form-control[readonly],
.form-control:disabled,
.form-select:disabled {
    background: #f8fafc;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(14, 165, 168, 0.2);
}

/* Tables */
.table {
    border-radius: 1rem;
    overflow: hidden;
}

/* Helpers */
.border-end-md {
    border-right: 1px solid var(--border-soft);
    padding-right: 1.5rem;
}

.op-2 {
    opacity: 0.25;
}

.text-xs {
    font-size: 0.7rem;
}

.section-heading {
    font-weight: 700;
    color: var(--secondary);
}

/* Pills */
.nav-pills .nav-link {
    border-radius: 999px;
}

/* Ad Slots */
.ad-rail {
    position: sticky;
    top: 96px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.ad-slot {
    background: rgba(255, 255, 255, 0.92);
    border: 1px dashed var(--border-soft);
    border-radius: 1rem;
    padding: 0.5rem;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.ad-slot--tall {
    min-height: 600px;
}

.ad-slot--inline {
    min-height: 280px;
}

.ad-slot .row {
    margin: 0;
}

.ad-slot .col-sm-6 {
    padding: 0.35rem;
}

@media (max-width: 991px) {
    .ad-rail {
        position: static;
        margin-top: 1rem;
        gap: 1rem;
    }

    .ad-slot {
        min-height: 240px;
        padding: 0.35rem;
    }

    .ad-slot--tall {
        min-height: 300px;
    }

    .ad-slot--inline {
        min-height: 240px;
    }
}

@media (max-width: 767px) {
    .border-end-md {
        border-right: 0;
        padding-right: 0;
    }
}
