/* ============================================
   GetStarNews Site-Wide Polish
   Applied globally to improve baseline styling
   ============================================ */

/* ===== CSS Variables / Design Tokens ===== */
:root {
    --gsn-bg: #0a0e27;
    --gsn-bg-deep: #050b13;
    --gsn-surface: rgba(0, 8, 18, 0.85);
    --gsn-surface-elevated: rgba(0, 12, 24, 0.95);
    --gsn-surface-hover: rgba(0, 16, 32, 1);
    --gsn-border: rgba(126, 233, 255, 0.18);
    --gsn-border-hover: rgba(126, 233, 255, 0.35);
    --gsn-border-focus: rgba(0, 207, 255, 0.6);
    --gsn-accent: #00cfff;
    --gsn-accent-hover: #00b8e6;
    --gsn-accent-light: #7fe9ff;
    --gsn-success: #4ade80;
    --gsn-warning: #fbbf24;
    --gsn-danger: #f87171;
    --gsn-text: #e6f4ff;
    --gsn-text-muted: #b9d4e8;
    --gsn-text-dim: #8fa6ba;
    --gsn-gold: #f5c842;
    --gsn-radius: 8px;
    --gsn-radius-sm: 6px;
    --gsn-radius-lg: 12px;
    --gsn-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    --gsn-shadow-lg: 0 8px 32px rgba(0, 207, 255, 0.15);
    --gsn-transition: all 0.18s ease;
}

/* ===== Base Polish ===== */
body {
    color: var(--gsn-text);
}

body.has-site-chrome main:not(.portal-shell):not(.forum-shell):not(.profile-social):not(.profile-clean) {
    width: min(1240px, calc(100% - 28px));
    margin: 0 auto;
    padding: 24px 0 40px;
}

/* Better link hover everywhere */
a {
    transition: color 0.16s ease;
}

a:hover {
    color: var(--gsn-accent-light);
}

/* ===== Improved Headings ===== */
.container h1,
main h1.headline,
main h1:not(.profile-name):not(.profile-clean-name):not(.forum-op-title) {
    font-family: "Bebas Neue", system-ui, sans-serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.1;
    color: #fff;
    margin: 0 0 0.5em;
}

main h2:not(.card-title):not(.profile-section-title):not(.profile-clean-section-title):not(.forum-thread-title) {
    font-family: "Bebas Neue", system-ui, sans-serif;
    font-size: clamp(1.4rem, 3vw, 2rem);
    line-height: 1.2;
    color: #fff;
    margin: 0 0 0.6em;
    letter-spacing: 0.5px;
}

main h3 {
    font-size: 1.15rem;
    color: var(--gsn-text);
    margin: 0 0 0.5em;
    font-weight: 700;
}

/* ===== Cards (Generic) ===== */
.card,
article.card {
    background: var(--gsn-surface) !important;
    border: 1px solid var(--gsn-border);
    border-radius: var(--gsn-radius);
    overflow: hidden;
    transition: var(--gsn-transition);
}

.card:hover,
article.card:hover {
    background: var(--gsn-surface-hover) !important;
    border-color: var(--gsn-border-hover);
    transform: translateY(-2px);
    box-shadow: var(--gsn-shadow-lg);
}

.card-content {
    padding: 18px 20px;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    margin: 8px 0 10px;
    line-height: 1.3;
}

/* ===== Tags / Badges ===== */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--gsn-radius-sm);
    background: rgba(126, 233, 255, 0.12);
    border: 1px solid var(--gsn-border);
    color: var(--gsn-accent-light);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    text-decoration: none;
    transition: var(--gsn-transition);
}

.tag:hover {
    background: rgba(126, 233, 255, 0.22);
    border-color: var(--gsn-border-hover);
    color: var(--gsn-accent-light);
}

/* ===== Buttons ===== */
button,
.listen-btn,
.btn,
input[type="submit"],
input[type="button"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 18px;
    border: 1px solid var(--gsn-border);
    border-radius: var(--gsn-radius-sm);
    background: rgba(126, 233, 255, 0.1);
    color: var(--gsn-text);
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    text-decoration: none;
    transition: var(--gsn-transition);
}

button:hover,
.listen-btn:hover,
.btn:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
    background: rgba(126, 233, 255, 0.2);
    border-color: var(--gsn-border-hover);
    transform: translateY(-1px);
    color: var(--gsn-text);
}

button:active,
.listen-btn:active,
.btn:active {
    transform: translateY(0);
}

button:disabled,
.listen-btn:disabled,
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

button.primary,
.listen-btn.primary,
.btn-primary,
.btn--primary {
    background: var(--gsn-accent);
    border-color: var(--gsn-accent);
    color: #03101a;
}

button.primary:hover,
.listen-btn.primary:hover,
.btn-primary:hover,
.btn--primary:hover {
    background: var(--gsn-accent-hover);
    border-color: var(--gsn-accent-hover);
    color: #03101a;
}

button.danger,
.btn-danger {
    background: rgba(248, 113, 113, 0.15);
    border-color: rgba(248, 113, 113, 0.4);
    color: var(--gsn-danger);
}

button.success,
.btn-success {
    background: rgba(74, 222, 128, 0.15);
    border-color: rgba(74, 222, 128, 0.4);
    color: var(--gsn-success);
}

/* ===== Forms ===== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="tel"],
input[type="number"],
input[type="search"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    background: rgba(0, 4, 10, 0.85);
    border: 1px solid var(--gsn-border);
    border-radius: var(--gsn-radius-sm);
    color: var(--gsn-text);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    transition: var(--gsn-transition);
    box-sizing: border-box;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--gsn-border-focus);
    background: rgba(0, 4, 10, 1);
    box-shadow: 0 0 0 3px rgba(0, 207, 255, 0.12);
}

input::placeholder,
textarea::placeholder {
    color: var(--gsn-text-dim);
    opacity: 0.7;
}

select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237fe9ff' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

label {
    display: block;
    margin-bottom: 6px;
    color: var(--gsn-accent-light);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;
    accent-color: var(--gsn-accent);
    margin-right: 8px;
}

/* ===== Grid Layouts ===== */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.grid--2col {
    grid-template-columns: repeat(2, 1fr);
}

.grid--3col {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {
    .grid--2col,
    .grid--3col {
        grid-template-columns: 1fr;
    }
}

/* ===== Container ===== */
.container,
main.container {
    width: min(1240px, calc(100% - 28px));
    margin: 0 auto;
}

/* ===== Story Header ===== */
.story-header {
    padding: 24px 0;
    border-bottom: 1px solid var(--gsn-border);
    margin-bottom: 24px;
}

.story-header h1 {
    margin: 0 0 8px;
}

.story-header .excerpt,
.excerpt {
    color: var(--gsn-text-muted);
    font-size: 1.05rem;
    line-height: 1.6;
    margin: 0;
    max-width: 760px;
}

/* ===== Muted Text ===== */
.muted {
    color: var(--gsn-text-dim);
    font-size: 0.85rem;
}

/* ===== Hero Sections ===== */
.hero {
    padding: 40px 28px;
    background: linear-gradient(135deg, rgba(0, 207, 255, 0.08), rgba(79, 172, 254, 0.04));
    border-radius: var(--gsn-radius-lg);
    margin: 20px 0;
    border: 1px solid var(--gsn-border);
}

.headline {
    font-family: "Bebas Neue", system-ui, sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    line-height: 1.1;
    color: #fff;
    margin: 0;
}

/* ===== Quick Actions Bar ===== */
.quick-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding: 20px;
    background: var(--gsn-surface);
    border: 1px solid var(--gsn-border);
    border-radius: var(--gsn-radius);
    margin: 24px 0;
}

.quick-actions a {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    background: rgba(126, 233, 255, 0.08);
    border: 1px solid var(--gsn-border);
    border-radius: var(--gsn-radius-sm);
    color: var(--gsn-text);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--gsn-transition);
}

.quick-actions a:hover {
    background: rgba(126, 233, 255, 0.18);
    border-color: var(--gsn-border-hover);
    color: var(--gsn-text);
    transform: translateY(-1px);
}

/* ===== Tables ===== */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--gsn-surface);
    border: 1px solid var(--gsn-border);
    border-radius: var(--gsn-radius);
    overflow: hidden;
    margin: 16px 0;
}

th,
td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gsn-border);
}

th {
    background: rgba(126, 233, 255, 0.08);
    color: var(--gsn-accent-light);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:hover td {
    background: rgba(126, 233, 255, 0.04);
}

tr:last-child td {
    border-bottom: none;
}

/* ===== Lists ===== */
main ul:not(.site-chrome__nav):not(.profile-card-list):not(.profile-clean-card-list),
main ol {
    padding-left: 20px;
    line-height: 1.7;
}

main ul li,
main ol li {
    margin-bottom: 6px;
}

/* ===== Code & Pre ===== */
code {
    padding: 2px 6px;
    background: rgba(0, 207, 255, 0.1);
    border-radius: 4px;
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.9em;
    color: var(--gsn-accent-light);
}

pre {
    padding: 16px;
    background: rgba(0, 4, 10, 0.85);
    border: 1px solid var(--gsn-border);
    border-radius: var(--gsn-radius);
    overflow-x: auto;
    line-height: 1.5;
}

pre code {
    padding: 0;
    background: none;
}

/* ===== Blockquote ===== */
blockquote {
    margin: 20px 0;
    padding: 16px 24px;
    background: rgba(126, 233, 255, 0.05);
    border-left: 4px solid var(--gsn-accent);
    border-radius: 0 var(--gsn-radius) var(--gsn-radius) 0;
    color: var(--gsn-text-muted);
    font-style: italic;
}

/* ===== Alert / Notice boxes ===== */
.alert,
.notice {
    padding: 14px 18px;
    border-radius: var(--gsn-radius);
    background: rgba(126, 233, 255, 0.08);
    border: 1px solid var(--gsn-border);
    color: var(--gsn-text);
    margin: 16px 0;
}

.alert--success {
    background: rgba(74, 222, 128, 0.1);
    border-color: rgba(74, 222, 128, 0.3);
    color: var(--gsn-success);
}

.alert--warning {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.3);
    color: var(--gsn-warning);
}

.alert--danger,
.alert--error {
    background: rgba(248, 113, 113, 0.1);
    border-color: rgba(248, 113, 113, 0.3);
    color: var(--gsn-danger);
}

/* ===== Empty States ===== */
.empty-state {
    padding: 40px 24px;
    text-align: center;
    background: var(--gsn-surface);
    border: 1px dashed var(--gsn-border);
    border-radius: var(--gsn-radius);
    color: var(--gsn-text-dim);
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    margin: 32px 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination .page-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    padding: 0 10px;
    background: var(--gsn-surface);
    border: 1px solid var(--gsn-border);
    border-radius: var(--gsn-radius-sm);
    color: var(--gsn-text);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--gsn-transition);
}

.pagination a:hover {
    background: rgba(126, 233, 255, 0.15);
    border-color: var(--gsn-border-hover);
    color: var(--gsn-text);
}

.pagination .active,
.pagination a.active {
    background: var(--gsn-accent);
    border-color: var(--gsn-accent);
    color: #03101a;
}

/* ===== Definition Lists ===== */
dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 18px;
    margin: 16px 0;
}

dt {
    color: var(--gsn-accent-light);
    font-weight: 700;
    font-size: 0.85rem;
}

dd {
    margin: 0;
    color: var(--gsn-text);
}

/* ===== Generic Section/Panels ===== */
section.panel,
.panel {
    padding: 24px;
    background: var(--gsn-surface);
    border: 1px solid var(--gsn-border);
    border-radius: var(--gsn-radius);
    margin: 20px 0;
}

/* ===== Skip default browser styles overrides ===== */
hr {
    border: none;
    border-top: 1px solid var(--gsn-border);
    margin: 24px 0;
}

/* ===== Selection ===== */
::selection {
    background: rgba(0, 207, 255, 0.3);
    color: #fff;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 8, 18, 0.5);
}

::-webkit-scrollbar-thumb {
    background: rgba(126, 233, 255, 0.25);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(126, 233, 255, 0.4);
}

/* ===== Images ===== */
main img:not(.site-chrome__brand img):not(.profile-avatar-large img):not(.profile-clean-avatar img) {
    max-width: 100%;
    height: auto;
    border-radius: var(--gsn-radius-sm);
}

/* ===== Footer polish for site-footer ===== */
.site-footer a {
    transition: color 0.16s ease;
}

.site-footer a:hover {
    color: var(--gsn-accent-light) !important;
}

/* ===== Loading state ===== */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(126, 233, 255, 0.2);
    border-top-color: var(--gsn-accent);
    border-radius: 50%;
    animation: gsn-spin 0.6s linear infinite;
}

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

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
    .container,
    main.container {
        width: calc(100% - 24px);
    }

    .quick-actions {
        padding: 14px;
    }

    .quick-actions a {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .hero {
        padding: 24px 18px;
    }
}

@media (max-width: 480px) {
    button,
    .listen-btn,
    .btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }

    .card-content {
        padding: 14px 16px;
    }
}

/* ===== Print Styles ===== */
@media print {
    .site-chrome,
    .site-footer,
    .quick-actions,
    button,
    .listen-btn {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }
}

/* ===== Avatar Helper Class ===== */
.gsn-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--gsn-accent);
    color: #03101a;
    font-weight: 800;
    overflow: hidden;
    flex-shrink: 0;
}

.gsn-avatar--xs { width: 28px; height: 28px; font-size: .7rem; }
.gsn-avatar--sm { width: 42px; height: 42px; font-size: .95rem; }
.gsn-avatar--md { width: 60px; height: 60px; font-size: 1.3rem; }
.gsn-avatar--lg { width: 90px; height: 90px; font-size: 1.9rem; }
.gsn-avatar--xl { width: 130px; height: 130px; font-size: 2.6rem; }

/* ===== Badges (Numeric, Status) ===== */
.gsn-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.gsn-badge--accent {
    background: var(--gsn-accent);
    color: #03101a;
}

.gsn-badge--danger {
    background: #f87171;
    color: #fff;
}

.gsn-badge--gold {
    background: linear-gradient(135deg, #f5c842, #f59e0b);
    color: #03101a;
}

/* ===== Override stray gray inline backgrounds on legacy pages ===== */
/* Many older pages use #111, #1a1a2e, #1a1a1a etc. inline. Soften them. */

/* ===== Special: Forms with regional-shell, network-pages preserved ===== */
.regional-form-grid input[type="text"],
.regional-form-grid input[type="email"],
.regional-form-grid input[type="tel"],
.regional-form-grid input[type="url"],
.regional-form-grid select,
.regional-form-grid textarea {
    width: 100%;
    padding: 10px 14px;
    background: rgba(0, 4, 10, 0.85);
    border: 1px solid var(--gsn-border);
    border-radius: var(--gsn-radius-sm);
    color: var(--gsn-text);
    font-family: inherit;
    transition: var(--gsn-transition);
}

.regional-form-grid input:focus,
.regional-form-grid select:focus,
.regional-form-grid textarea:focus {
    outline: none;
    border-color: var(--gsn-border-focus);
    background: rgba(0, 4, 10, 1);
    box-shadow: 0 0 0 3px rgba(0, 207, 255, 0.12);
}

/* ===== Title/Section Eyebrows ===== */
.eyebrow {
    display: inline-block;
    color: var(--gsn-accent-light);
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

/* ===== Improve generic flex/grid utility for layout ===== */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-center {
    align-items: center;
    justify-content: center;
}

.flex-between {
    justify-content: space-between;
}

.gap-1 { gap: 6px; }
.gap-2 { gap: 12px; }
.gap-3 { gap: 18px; }
.gap-4 { gap: 24px; }

/* ===== Spacing Utilities ===== */
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 20px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 20px; }
.mb-4 { margin-bottom: 32px; }

/* ===== Truncate Text ===== */
.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== Visually Hidden ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
