/*!
Theme Name: 4adm.in Terminal
Theme URI: https://4adm.in
Author: 4adm.in
Author URI: https://4adm.in
Description: Современная тема в стиле терминала для портала администраторов
Version: 1.1.0
License: MIT
Text Domain: 4adm
Requires at least: 6.0
Requires PHP: 8.2
*/

/* ============================================
   Google Fonts - JetBrains Mono
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Inter:wght@400;500;600&display=swap');

/* ============================================
   Color Schemes
   ============================================ */

/* Default: Matrix — мягкий зелёный */
:root {
  --bg-body: #0c0e14;
  --bg-primary: #12151e;
  --bg-secondary: #181c28;
  --bg-card: #1e2233;
  --bg-hover: #252a3a;
  --bg-input: #0f1119;
  --text-primary: #c8d3da;
  --text-secondary: #8b95a5;
  --text-muted: #505868;
  --accent: #5af5c0;
  --accent-dim: #3bc89a;
  --accent-glow: rgba(90, 245, 192, 0.15);
  --accent-glow-strong: rgba(90, 245, 192, 0.3);
  --highlight: #7ee8fa;
  --border: #262c3a;
  --border-hover: #363e52;
  --tag-bg: rgba(90, 245, 192, 0.08);
  --tag-text: #5af5c0;
  --danger: #f47067;
  --warning: #e8b44a;
  --radius: 8px;
  --radius-sm: 4px;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'SF Mono', 'Consolas', monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: 0.2s ease;
}

/* Amber — тёплый янтарный */
[data-theme="amber"] {
  --bg-body: #110e08;
  --bg-primary: #181310;
  --bg-secondary: #201a14;
  --bg-card: #28211a;
  --bg-hover: #332a20;
  --bg-input: #120f09;
  --text-primary: #ddd0c0;
  --text-secondary: #a09080;
  --text-muted: #685848;
  --accent: #f0b866;
  --accent-dim: #d49a48;
  --accent-glow: rgba(240, 184, 102, 0.12);
  --accent-glow-strong: rgba(240, 184, 102, 0.25);
  --highlight: #f5d094;
  --border: #2e261c;
  --border-hover: #443828;
  --tag-bg: rgba(240, 184, 102, 0.08);
  --tag-text: #f0b866;
  --danger: #e07060;
  --warning: #f0b866;
}

/* Frost — холодный синий */
[data-theme="blue"] {
  --bg-body: #080c14;
  --bg-primary: #0e1320;
  --bg-secondary: #141a2c;
  --bg-card: #1a2238;
  --bg-hover: #202a44;
  --bg-input: #0a0e18;
  --text-primary: #c4d0e0;
  --text-secondary: #7888a0;
  --text-muted: #485068;
  --accent: #64b5f6;
  --accent-dim: #4a96d4;
  --accent-glow: rgba(100, 181, 246, 0.12);
  --accent-glow-strong: rgba(100, 181, 246, 0.25);
  --highlight: #90caf9;
  --border: #1e2840;
  --border-hover: #2e3a58;
  --tag-bg: rgba(100, 181, 246, 0.08);
  --tag-text: #64b5f6;
  --danger: #ef5350;
  --warning: #ffb74d;
}

/* ============================================
   Reset & Base
   ============================================ */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg-body);
  color: var(--text-primary);
  font-family: var(--font-mono);
  line-height: 1.7;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--highlight);
}

img {
  max-width: 100%;
  height: auto;
}

/* ============================================
   Header Bar — single fixed row
   ============================================ */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 54px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.8rem;
  z-index: 1000;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Branding — left side */
.site-branding {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.prompt-user {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}

.prompt-separator {
  color: var(--text-muted);
  font-weight: 400;
}

.prompt-path {
  color: var(--highlight);
  font-weight: 500;
  font-size: 0.95rem;
}

.prompt-cursor {
  display: inline-block;
  width: 8px;
  height: 17px;
  background: var(--accent);
  border-radius: 1px;
  margin-left: 4px;
  vertical-align: text-bottom;
  opacity: 0.9;
  animation: cursor-blink 1.2s ease-in-out infinite;
}

.site-title {
  display: none; /* hidden — replaced by prompt */
}

/* Navigation — center */
.main-navigation {
  display: flex;
  align-items: center;
}

.main-navigation ul {
  list-style: none;
  display: flex;
  gap: 0.25rem;
}

.main-navigation a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: all var(--transition);
}

.main-navigation a:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.main-navigation .current-menu-item a {
  color: var(--accent);
  background: var(--accent-glow);
}

/* Header Controls — right side */
.header-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

.theme-switcher,
.lang-switcher {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.theme-switcher button,
.lang-switcher button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  transition: all var(--transition);
}

.theme-switcher button:hover,
.lang-switcher button:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.theme-switcher button.active,
.lang-switcher button.active {
  color: var(--accent);
  background: var(--accent-glow);
}

/* ============================================
   Page Body
   ============================================ */

.site-content {
  margin-top: 54px;
  padding: 2rem;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  max-width: 1360px;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================
   Banner
   ============================================ */

.site-banner {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, var(--bg-card), var(--bg-secondary));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  margin-bottom: 0.5rem;
  position: relative;
  overflow: hidden;
}

.site-banner::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 40%;
  height: 100%;
  background: linear-gradient(135deg, transparent, var(--accent-glow));
  pointer-events: none;
}

.banner-content {
  position: relative;
  z-index: 1;
}

.banner-content h1 {
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  letter-spacing: -0.02em;
}

.banner-content p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.8;
  max-width: 600px;
}

/* ============================================
   Blog Posts
   ============================================ */

.posts-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.post {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem 1.8rem;
  transition: all var(--transition);
  position: relative;
}

.post::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius) 0 0 var(--radius);
  opacity: 0;
  transition: opacity var(--transition);
}

.post:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.post:hover::before {
  opacity: 1;
}

.post-title {
  font-family: var(--font-sans);
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.post-title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--transition);
}

.post-title a:hover {
  color: var(--accent);
}

.post-meta {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.post-meta a {
  color: var(--accent-dim);
}

.post-excerpt {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.8;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent);
  text-decoration: none;
  margin-top: 1.2rem;
  padding: 0.5rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--accent-glow);
  transition: all var(--transition);
}

.read-more::after {
  content: '→';
  transition: transform var(--transition);
}

.read-more:hover {
  background: var(--accent-glow-strong);
  border-color: var(--accent-dim);
  color: var(--highlight);
}

.read-more:hover::after {
  transform: translateX(3px);
}

/* ============================================
   Sidebar
   ============================================ */

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
}

.widget-title {
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.widget-title::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-glow-strong);
}

/* Mini Terminal Widget */
.mini-terminal {
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-size: 0.82rem;
  min-height: 140px;
  position: relative;
}

.mini-terminal .terminal-header {
  display: flex;
  gap: 6px;
  margin-bottom: 0.8rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.mini-terminal .terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.mini-terminal .terminal-dot.red { background: #f47067; }
.mini-terminal .terminal-dot.yellow { background: #e8b44a; }
.mini-terminal .terminal-dot.green { background: #5af5c0; }

.mini-terminal .terminal-line {
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
  line-height: 1.6;
}

.mini-terminal .terminal-prompt {
  color: var(--text-primary);
}

.mini-terminal .terminal-prompt::before {
  content: '❯ ';
  color: var(--accent);
}

.mini-terminal .terminal-output {
  color: var(--text-muted);
}

.mini-terminal .terminal-cursor {
  display: inline-block;
  width: 7px;
  height: 15px;
  background: var(--accent);
  border-radius: 1px;
  animation: cursor-blink 1.2s ease-in-out infinite;
  vertical-align: text-bottom;
  margin-left: 1px;
}

/* Utilities Widget */
.utilities-list {
  list-style: none;
}

.utilities-list li {
  border-bottom: 1px solid var(--border);
}

.utilities-list li:last-child {
  border-bottom: none;
}

.utilities-list a {
  color: var(--text-secondary);
  text-decoration: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.4rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.utilities-list a:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  padding-left: 0.8rem;
}

.utility-status {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 0.6rem;
  flex-shrink: 0;
}

.utility-name {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 500;
}

.utility-domain {
  color: var(--text-muted);
  font-size: 0.75rem;
  background: var(--tag-bg);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
}

/* Widget: default lists (recent posts, categories) */
.widget ul {
  list-style: none;
}

.widget ul li {
  border-bottom: 1px solid var(--border);
}

.widget ul li:last-child {
  border-bottom: none;
}

.widget ul a {
  display: block;
  padding: 0.55rem 0.4rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.widget ul a:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  padding-left: 0.8rem;
}

/* ============================================
   Single Post
   ============================================ */

.post-single {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
}

.post-single .post-title {
  font-size: 2rem;
  margin-bottom: 0.8rem;
  color: var(--text-primary);
}

.post-single .post-content {
  font-size: 0.95rem;
  line-height: 1.9;
  color: var(--text-primary);
}

.post-single .post-content h2,
.post-single .post-content h3,
.post-single .post-content h4 {
  font-family: var(--font-sans);
  color: var(--text-primary);
  margin: 2rem 0 0.8rem;
  letter-spacing: -0.01em;
}

.post-single .post-content h2 { font-size: 1.5rem; }
.post-single .post-content h3 { font-size: 1.25rem; }

.post-single .post-content p {
  margin: 1rem 0;
}

.post-single .post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-glow-strong);
  text-underline-offset: 3px;
}

.post-single .post-content a:hover {
  color: var(--highlight);
}

.post-single .post-content code {
  background: var(--bg-body);
  color: var(--accent);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.88em;
  border: 1px solid var(--border);
}

.post-single .post-content pre {
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.88rem;
  line-height: 1.7;
}

.post-single .post-content pre code {
  background: none;
  border: none;
  padding: 0;
}

.post-single .post-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.8rem 1.2rem;
  margin: 1.5rem 0;
  background: var(--accent-glow);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
}

.post-single .post-content ul,
.post-single .post-content ol {
  padding-left: 1.5rem;
  margin: 1rem 0;
}

.post-single .post-content li {
  margin-bottom: 0.4rem;
  color: var(--text-secondary);
}

.post-single .post-thumbnail img {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* Post Navigation */
.post-navigation {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.post-navigation a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color var(--transition);
}

.post-navigation a:hover {
  color: var(--accent);
}

/* Pagination */
.pagination {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.pagination .nav-links {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.pagination a,
.pagination span {
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: all var(--transition);
}

.pagination a:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.pagination .current {
  background: var(--accent-glow);
  color: var(--accent);
  border-color: var(--accent-dim);
}

/* ============================================
   Comments
   ============================================ */

.comments-area {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-top: 2rem;
}

.comments-title {
  font-family: var(--font-sans);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);
}

.comment {
  padding: 1.2rem;
  margin-bottom: 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--border);
}

.comment-author {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
}

.comment-meta {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.comment-text,
.comment-content {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 0.9rem;
}

/* Forms */
input[type='text'],
input[type='email'],
input[type='url'],
input[type='password'],
input[type='search'],
textarea {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  width: 100%;
  margin: 0.4rem 0;
  transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

button,
input[type='submit'],
input[type='button'] {
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.4rem;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
}

button:hover,
input[type='submit']:hover,
input[type='button']:hover {
  background: var(--accent-glow-strong);
  color: var(--highlight);
}

/* ============================================
   Footer
   ============================================ */

.site-footer {
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  margin-top: 3rem;
  font-size: 0.85rem;
}

.site-footer a {
  color: var(--accent-dim);
}

.site-footer a:hover {
  color: var(--accent);
}

.site-footer p {
  margin: 0.3rem 0;
}

/* ============================================
   Animations
   ============================================ */

@keyframes cursor-blink {
  0%, 45% { opacity: 1; }
  50%, 95% { opacity: 0; }
  100% { opacity: 1; }
}

/* ============================================
   Scrollbar
   ============================================ */

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ============================================
   Selection
   ============================================ */

::selection {
  background: var(--accent-glow-strong);
  color: var(--text-primary);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 1100px) {
  .site-content {
    grid-template-columns: 1fr;
  }

  .site-banner {
    grid-column: 1;
  }

  .sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
  }
}

@media (max-width: 768px) {
  html {
    font-size: 14px;
  }

  .site-header {
    height: auto;
    padding: 0.6rem 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .main-navigation {
    order: 3;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .main-navigation ul {
    gap: 0;
  }

  .site-content {
    margin-top: 110px;
    padding: 1rem;
  }

  .sidebar {
    grid-template-columns: 1fr;
  }

  .banner-content h1 {
    font-size: 1.4rem;
  }

  .post {
    padding: 1.2rem;
  }
}

@media (max-width: 480px) {
  .header-controls {
    width: 100%;
    justify-content: flex-end;
  }

  .prompt-path {
    display: none;
  }
}

/* ============================================
   Utility
   ============================================ */

.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
}
