/* =============================================
   CIRCUITBURST — STYLESHEET (v3.0)
   Cyberpunk / Matrix green on deep-space dark
   ============================================= */

/* ---- RESET / BASE ---- */
*, *::before, *::after { box-sizing: border-box; }

body {
    background-color: #0d1117;
    color: #00ff41;
    font-family: 'Courier New', Courier, monospace;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    margin: 0;
    min-height: 100vh;
}

/* ---- UTILITY ---- */
.hidden { display: none !important; }

/* ---- HEADER ---- */
header {
    text-align: center;
    border-bottom: 2px solid #00ff41;
    width: 100%;
    max-width: 680px;
    margin-bottom: 30px;
    padding-bottom: 10px;
    letter-spacing: 4px;
}

#header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

h1 {
    margin: 0;
    font-size: 2rem;
    text-shadow: 0 0 10px #00ff41;
    letter-spacing: 4px;
}

#user-info {
    font-size: 0.85rem;
    color: #00ff41;
    opacity: 0.8;
}

#connection-status {
    font-size: 0.75rem;
    color: #8b949e;
    margin-top: 6px;
    letter-spacing: 1px;
}

/* ---- SECTION CARDS ---- */
#auth-zone,
#app-zone {
    background: #161b22;
    border: 1px solid #30363d;
    padding: 25px;
    border-radius: 8px;
    width: 100%;
    max-width: 680px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

#auth-zone h2 {
    color: #00ff41;
    margin-top: 0;
}

/* ---- FORMS / INPUTS ---- */
label {
    display: block;
    font-size: 0.72rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 14px;
    color: #8b949e;
}

input, textarea {
    background-color: #0d1117;
    border: 1px solid #30363d;
    color: #00ff41;
    padding: 11px 12px;
    margin: 6px 0 0;
    width: 100%;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    border-radius: 4px;
    transition: border-color 0.2s;
    resize: vertical;
}

input:focus, textarea:focus {
    outline: none;
    border-color: #00ff41;
    box-shadow: 0 0 8px rgba(0, 255, 65, 0.25);
}

/* ---- BUTTONS ---- */
button {
    background-color: #00ff41;
    color: #0d1117;
    border: none;
    padding: 13px 20px;
    width: 100%;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    font-size: 0.95rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
    transition: background-color 0.2s, box-shadow 0.2s;
    margin-top: 10px;
}

button:hover,
button:focus-visible {
    background-color: #ffffff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    outline: none;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#signup-btn {
    background-color: transparent;
    border: 1px solid #00ff41;
    color: #00ff41;
    font-size: 0.8rem;
}

#signup-btn:hover,
#signup-btn:focus-visible {
    background-color: transparent;
    border-color: #ffffff;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

/* ---- TAB NAV ---- */
#tab-nav {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.tab-btn {
    flex: 1;
    min-width: 80px;
    background-color: transparent;
    border: 1px solid #30363d;
    color: #8b949e;
    font-size: 0.8rem;
    padding: 10px 14px;
    margin-top: 0;
    transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.tab-btn:hover,
.tab-btn:focus-visible {
    background-color: transparent;
    border-color: #00ff41;
    color: #00ff41;
    box-shadow: 0 0 8px rgba(0, 255, 65, 0.3);
}

.tab-btn.active {
    border-color: #00ff41;
    color: #00ff41;
    background-color: rgba(0, 255, 65, 0.07);
}

.tab-btn.pro-tab { border-color: #f0a500; color: #f0a500; }
.tab-btn.pro-tab:hover,
.tab-btn.pro-tab:focus-visible,
.tab-btn.pro-tab.active {
    background-color: rgba(240, 165, 0, 0.1);
    box-shadow: 0 0 8px rgba(240, 165, 0, 0.4);
    color: #f0a500;
}

#logout-btn {
    background-color: transparent;
    border: 1px solid #8b949e;
    color: #8b949e;
    font-size: 0.75rem;
    padding: 10px 16px;
    margin-top: 0;
    margin-left: auto;
    width: auto;
}

#logout-btn:hover,
#logout-btn:focus-visible {
    background-color: transparent;
    border-color: #ff4444;
    color: #ff4444;
    box-shadow: 0 0 8px rgba(255, 68, 68, 0.4);
}

/* ---- FEED / POST FORM ---- */
#post-form {
    margin-bottom: 20px;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 14px;
    background: #0d1117;
}

#post-content {
    width: 100%;
    margin-top: 0;
    border: none;
    background: transparent;
    padding: 0;
    font-size: 0.95rem;
    color: #c9d1d9;
}

#post-content:focus {
    border: none;
    box-shadow: none;
}

#post-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

#char-count {
    font-size: 0.7rem;
    color: #8b949e;
}

#post-btn {
    width: auto;
    padding: 9px 20px;
    margin-top: 0;
    font-size: 0.8rem;
}

/* ---- POST CARDS ---- */
.post-card {
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 14px;
    margin-bottom: 12px;
    background: #0d1117;
    transition: border-color 0.2s;
}

.post-card:hover { border-color: #444d56; }

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.post-author {
    font-weight: bold;
    color: #00ff41;
    font-size: 0.85rem;
}

.post-time {
    font-size: 0.7rem;
    color: #8b949e;
}

.post-body {
    color: #c9d1d9;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.5;
}

.delete-post-btn {
    background: transparent;
    border: none;
    color: #8b949e;
    font-size: 0.7rem;
    padding: 4px 0;
    margin-top: 8px;
    width: auto;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
}

.delete-post-btn:hover,
.delete-post-btn:focus-visible {
    color: #ff4444;
    background: transparent;
    box-shadow: none;
}

/* ---- INFO / ERROR TEXT ---- */
.info-text {
    color: #8b949e;
    font-size: 0.85rem;
    text-align: center;
    padding: 20px 0;
}

.error-text {
    color: #ff4444;
    font-size: 0.85rem;
    text-align: center;
    padding: 20px 0;
}

/* ---- DIRECT MESSAGES ---- */
#dm-compose {
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 20px;
    background: #0d1117;
}

#dm-compose h3 {
    margin: 0 0 10px;
    font-size: 0.9rem;
    color: #00ff41;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#dm-send-btn {
    padding: 11px 20px;
    margin-top: 12px;
}

#dm-compose-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
}

#dm-char-count {
    font-size: 0.7rem;
    color: #8b949e;
}

.message-card {
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 10px;
    background: #0d1117;
}

.message-card.sent { border-left: 3px solid #00ff41; }
.message-card.received { border-left: 3px solid #58a6ff; }

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.message-direction {
    font-size: 0.8rem;
    font-weight: bold;
}

.message-card.sent .message-direction { color: #00ff41; }
.message-card.received .message-direction { color: #58a6ff; }

.message-time {
    font-size: 0.7rem;
    color: #8b949e;
}

.message-body {
    color: #c9d1d9;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.5;
}

/* ---- PRO SUBSCRIPTION ---- */
#pro-card {
    text-align: center;
    padding: 30px 20px;
    border: 1px solid #f0a500;
    border-radius: 8px;
    background: linear-gradient(135deg, #0d1117 0%, #1a1200 100%);
    box-shadow: 0 0 24px rgba(240, 165, 0, 0.2);
}

#pro-badge, .pro-badge {
    display: inline-block;
    background: #f0a500;
    color: #0d1117;
    font-weight: bold;
    font-size: 0.8rem;
    padding: 4px 14px;
    border-radius: 20px;
    letter-spacing: 2px;
    margin-bottom: 14px;
}

#pro-card h3 {
    margin: 0 0 6px;
    font-size: 1.5rem;
    color: #f0a500;
    text-shadow: 0 0 10px rgba(240, 165, 0, 0.5);
}

.pro-price {
    font-size: 2rem;
    font-weight: bold;
    color: #ffffff;
    margin: 10px 0 20px;
}

.pro-features {
    list-style: none;
    padding: 0;
    margin: 0 auto 24px;
    max-width: 320px;
    text-align: left;
}

.pro-features li {
    color: #c9d1d9;
    font-size: 0.9rem;
    padding: 6px 0;
    border-bottom: 1px solid #21262d;
}

.pro-features li:last-child { border-bottom: none; }

#pro-subscribe-btn {
    background-color: #f0a500;
    color: #0d1117;
    max-width: 320px;
    font-size: 1rem;
    padding: 15px;
    margin: 0 auto 12px;
    display: block;
}

#pro-subscribe-btn:hover,
#pro-subscribe-btn:focus-visible {
    background-color: #ffcb47;
    box-shadow: 0 0 20px rgba(240, 165, 0, 0.6);
}

.pro-note {
    font-size: 0.75rem;
    color: #8b949e;
    margin: 0;
}

.pro-refresh-btn {
    background: none;
    border: none;
    color: #58a6ff;
    cursor: pointer;
    font-size: inherit;
    padding: 0;
    text-decoration: underline;
}

.pro-refresh-btn:hover,
.pro-refresh-btn:focus-visible {
    color: #79c0ff;
}

.pro-refresh-btn:disabled {
    cursor: default;
    color: #8b949e;
    text-decoration: none;
}

/* ---- PRO BADGE (header + post cards) ---- */
#user-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pro-badge-header {
    display: inline-block;
    background: #f0a500;
    color: #0d1117;
    font-weight: bold;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 12px;
    letter-spacing: 1px;
    vertical-align: middle;
}

.post-pro-badge {
    display: inline-block;
    background: #f0a500;
    color: #0d1117;
    font-size: 0.6rem;
    padding: 1px 5px;
    border-radius: 10px;
    vertical-align: middle;
    margin-left: 4px;
}

/* ---- UNREAD MESSAGE BADGE ---- */
.msg-badge {
    display: inline-block;
    background: #ff4444;
    color: #ffffff;
    font-size: 0.6rem;
    font-weight: bold;
    padding: 1px 5px;
    border-radius: 10px;
    letter-spacing: 0;
    text-transform: none;
    vertical-align: middle;
    margin-left: 4px;
    min-width: 18px;
    text-align: center;
}

/* ---- AD SLOT (shown only for free users) ---- */
.ad-slot {
    border: 1px dashed #30363d;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 14px;
    background: #0d1117;
    color: #8b949e;
    font-size: 0.75rem;
    text-align: center;
    letter-spacing: 1px;
}

/* ---- CHANNELS TAB ---- */
.channels-locked {
    text-align: center;
    padding: 40px 20px;
    border: 1px dashed #f0a500;
    border-radius: 8px;
    background: rgba(240, 165, 0, 0.04);
}

.channels-lock-icon {
    font-size: 2.5rem;
    margin: 0 0 12px;
}

.channels-locked h3 {
    color: #f0a500;
    margin: 0 0 10px;
    font-size: 1.1rem;
}

.channels-locked p {
    color: #8b949e;
    font-size: 0.9rem;
    margin: 0 0 18px;
}

#channels-upgrade-btn {
    background-color: #f0a500;
    color: #0d1117;
    max-width: 260px;
    margin: 0 auto;
    display: block;
    padding: 12px 20px;
}

#channels-upgrade-btn:hover,
#channels-upgrade-btn:focus-visible {
    background-color: #ffcb47;
    box-shadow: 0 0 16px rgba(240, 165, 0, 0.5);
}

#channel-nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.channel-btn {
    flex: none;
    background: transparent;
    border: 1px solid #30363d;
    color: #8b949e;
    font-size: 0.78rem;
    padding: 7px 14px;
    margin-top: 0;
    width: auto;
    text-transform: none;
    letter-spacing: 0;
    transition: border-color 0.2s, color 0.2s;
}

.channel-btn:hover,
.channel-btn:focus-visible {
    background: transparent;
    border-color: #f0a500;
    color: #f0a500;
    box-shadow: 0 0 6px rgba(240, 165, 0, 0.3);
}

.channel-btn.active {
    border-color: #f0a500;
    color: #f0a500;
    background: rgba(240, 165, 0, 0.07);
}

#channel-post-form {
    margin-bottom: 16px;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 14px;
    background: #0d1117;
}

#channel-post-content {
    width: 100%;
    margin-top: 0;
    border: none;
    background: transparent;
    padding: 0;
    font-size: 0.95rem;
    color: #c9d1d9;
}

#channel-post-content:focus {
    border: none;
    box-shadow: none;
}

#channel-post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

#channel-char-count {
    font-size: 0.7rem;
    color: #8b949e;
}

#channel-post-btn {
    width: auto;
    padding: 9px 20px;
    margin-top: 0;
    font-size: 0.8rem;
    background-color: #f0a500;
    color: #0d1117;
}

#channel-post-btn:hover,
#channel-post-btn:focus-visible {
    background-color: #ffcb47;
    box-shadow: 0 0 16px rgba(240, 165, 0, 0.5);
}

/* ---- PRO ACTIVE CARD (shown to existing Pro members) ---- */
#pro-active-card {
    text-align: center;
    padding: 30px 20px;
    border: 1px solid #f0a500;
    border-radius: 8px;
    background: linear-gradient(135deg, #0d1117 0%, #1a1200 100%);
    box-shadow: 0 0 24px rgba(240, 165, 0, 0.2);
    margin-bottom: 14px;
}

#pro-active-card h3 {
    margin: 10px 0 6px;
    font-size: 1.4rem;
    color: #f0a500;
    text-shadow: 0 0 10px rgba(240, 165, 0, 0.5);
}

.pro-active-msg {
    color: #8b949e;
    font-size: 0.88rem;
    margin: 0 0 18px;
}

/* ---- PRO SUPPORT LINK ---- */
#pro-support {
    margin: 18px 0 10px;
    padding: 14px;
    border: 1px solid rgba(240, 165, 0, 0.3);
    border-radius: 6px;
    background: rgba(240, 165, 0, 0.05);
}

.pro-support-label {
    font-size: 0.8rem;
    color: #8b949e;
    margin: 0 0 8px;
}

.pro-support-link {
    display: inline-block;
    color: #f0a500;
    font-size: 0.9rem;
    font-weight: bold;
    text-decoration: none;
    letter-spacing: 0.5px;
    transition: color 0.2s;
}

.pro-support-link:hover,
.pro-support-link:focus-visible {
    color: #ffcb47;
    text-decoration: underline;
}

.pro-portal-link {
    color: #f0a500;
    text-decoration: underline;
}

.pro-portal-link:hover { color: #ffcb47; }

/* ---- NOTIFICATION PERMISSION BANNER ---- */
.notif-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 0.85rem;
    color: #8b949e;
}

.notif-banner.hidden {
    display: none;
}

#notif-enable-btn {
    flex-shrink: 0;
    font-size: 0.8rem;
    padding: 5px 10px;
    background: #238636;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#notif-enable-btn:hover {
    background: #2ea043;
}

#notif-enable-btn.hidden {
    display: none;
}

/* ---- IN-APP MESSAGE TOAST ---- */

.msg-toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: #1a1a2e;
    border: 1px solid #00ff41;
    color: #00ff41;
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    font-size: 0.9rem;
    box-shadow: 0 0 12px rgba(0, 255, 65, 0.4);
    z-index: 1000;
    max-width: 320px;
    transition: opacity 0.3s ease;
}

.msg-toast.hidden {
    display: none;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 480px) {
    h1 { font-size: 1.4rem; }
    #tab-nav { gap: 4px; }
    .tab-btn { font-size: 0.72rem; padding: 8px 10px; }
    #logout-btn { margin-left: 0; width: 100%; }
}
