/* =========================================================
   Umumiy komponentlar: loyiha kartasi, teglar, footer
   ========================================================= */

/* ---------- Teg (texnologiya belgisi) ---------- */
.tag {
    display: inline-flex; align-items: center;
    background: rgba(30, 41, 59, 0.75); color: var(--text-soft);
    border: 1px solid rgba(148, 163, 184, 0.12);
    padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 500; line-height: 1.4;
}

/* ---------- Loyiha kartasi ---------- */
.project-card {
    position: relative; display: flex; flex-direction: column;
    background: linear-gradient(180deg, rgba(17, 26, 46, 0.78), rgba(11, 17, 32, 0.78));
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 12px; height: 100%;
    transform-style: preserve-3d; will-change: transform;
    transition: transform .45s var(--ease), border-color .3s, box-shadow .45s var(--ease);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.project-card::before {
    content: ''; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
    background: radial-gradient(400px 200px at var(--mx, 50%) var(--my, 0%), rgba(59,130,246,.18), transparent 60%);
    opacity: 0; transition: opacity .3s;
}
.project-card:hover { border-color: var(--line-strong); box-shadow: 0 24px 50px -24px rgba(37, 99, 235, 0.55), inset 0 1px 0 rgba(255,255,255,.06); }
.project-card:hover::before { opacity: 1; }

.card-image {
    position: relative; display: block; overflow: hidden;
    aspect-ratio: 16 / 9.6; border-radius: 10px; background: #0A1224;
    border: 1px solid rgba(148, 163, 184, 0.08);
}
.card-image img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .7s var(--ease); }
.project-card:hover .card-image img,
.project-card:hover .card-image .mock { transform: scale(1.06); }

.card-content { padding: 14px 2px 2px; flex: 1; display: flex; flex-direction: column; }
.card-content h3 { font-size: 17px; font-weight: 700; line-height: 1.3; margin-bottom: 10px; letter-spacing: -0.01em; }
.card-content h3 a:hover { color: #93C5FD; }
.card-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 12px; }
.card-content p { color: var(--text-muted); font-size: 13px; line-height: 1.6; margin-bottom: 16px; flex: 1; }
.card-actions { display: flex; gap: 8px; margin-top: auto; }
.card-actions .btn { flex: 1; padding: 10px 12px; font-size: 13px; gap: 8px; }
.card-actions .btn:only-child { flex: 0 1 auto; padding: 10px 22px; }
.card-cat { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-cyan); margin-bottom: 6px; }

/* ---------- Muqova bo'lmaganda: dashboard maketi ---------- */
.mock { position: absolute; inset: 0; transition: transform .7s var(--ease); }
.mock-ui { display: flex; padding: 8px; gap: 6px; background: linear-gradient(160deg, #0F1B33, #0A1224); }
.mock-ui .m-side {
    width: 24%; border-radius: 6px; background: #0B1530; padding: 8px 6px; display: flex; flex-direction: column; gap: 6px;
    border: 1px solid rgba(96,165,250,.12);
}
.mock-ui .m-side i { display: block; height: 5px; border-radius: 3px; background: rgba(148,163,184,.28); }
.mock-ui .m-side i:first-child { height: 8px; width: 70%; background: linear-gradient(90deg, #3B82F6, #8B5CF6); margin-bottom: 4px; }
.mock-ui .m-side i:nth-child(3) { background: rgba(59,130,246,.65); }
.mock-ui .m-main { flex: 1; border-radius: 6px; background: #EEF3FB; padding: 8px; display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.mock-ui .m-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.mock-ui .m-title { font-size: 8px; font-weight: 700; color: #1E293B; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: 0; }
.mock-ui .m-dots { display: flex; gap: 3px; }
.mock-ui .m-dots b { width: 10px; height: 5px; border-radius: 3px; background: #CBD5E1; }
.mock-ui .m-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.mock-ui .m-stats span { height: 18px; border-radius: 4px; background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.08); position: relative; }
.mock-ui .m-stats span::after { content: ''; position: absolute; left: 5px; bottom: 4px; width: 40%; height: 4px; border-radius: 2px; background: var(--c, #3B82F6); }
.mock-ui .m-stats span:nth-child(2) { --c: #10B981; } .mock-ui .m-stats span:nth-child(3) { --c: #F59E0B; } .mock-ui .m-stats span:nth-child(4) { --c: #8B5CF6; }
.mock-ui .m-table { flex: 1; display: flex; flex-direction: column; gap: 4px; background: #fff; border-radius: 4px; padding: 6px; box-shadow: 0 1px 2px rgba(15,23,42,.08); }
.mock-ui .m-table i { display: grid; grid-template-columns: 2fr 1fr 1fr .6fr; gap: 5px; height: 5px; }
.mock-ui .m-table i::before, .mock-ui .m-table i::after { content: ''; border-radius: 3px; background: #E2E8F0; }
.mock-ui .m-table i::after { background: #BBF7D0; grid-column: 4; }
.mock-ui .m-table i:nth-child(3n)::after { background: #FDE68A; }
.mock-ui .m-table i:nth-child(4n)::after { background: #C7D2FE; }

/* ---------- Muqova bo'lmaganda: avtomatlashtirish (ijtimoiy tarmoqlar) ---------- */
.mock-social {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background:
        radial-gradient(120% 90% at 20% 30%, rgba(59,130,246,.45), transparent 55%),
        radial-gradient(90% 90% at 90% 80%, rgba(139,92,246,.45), transparent 55%),
        linear-gradient(135deg, #0B1735, #120B33);
}
.mock-social::after {
    content: ''; position: absolute; inset: 0; opacity: .25;
    background-image: linear-gradient(rgba(96,165,250,.25) 1px, transparent 1px), linear-gradient(90deg, rgba(96,165,250,.25) 1px, transparent 1px);
    background-size: 18px 18px; mask-image: linear-gradient(180deg, transparent, #000 60%); -webkit-mask-image: linear-gradient(180deg, transparent, #000 60%);
}
.mock-social .s-tg {
    width: 30%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-size: clamp(22px, 2.6vw, 34px);
    color: #fff; background: radial-gradient(circle at 30% 30%, #5AC8FA, #229ED9); box-shadow: 0 0 30px rgba(34,158,217,.7); z-index: 1;
}
.mock-social .s-row { display: flex; gap: 5px; z-index: 1; }
.mock-social .s-row span {
    width: clamp(24px, 2.4vw, 32px); aspect-ratio: .8; border-radius: 7px; display: grid; place-items: center; color: #fff; font-size: clamp(12px, 1.2vw, 16px);
    box-shadow: 0 6px 14px -4px rgba(0,0,0,.6);
}
.mock-social .s-tt { background: #000; box-shadow: -2px 0 0 #25F4EE, 2px 0 0 #FE2C55 !important; }
.mock-social .s-yt { background: #FF0000; }
.mock-social .s-ig { background: linear-gradient(45deg, #F58529, #DD2A7B, #8134AF); }
.mock-social .s-fb { background: #1877F2; }

/* ---------- Bo'sh holat ---------- */
.empty-state { grid-column: 1 / -1; padding: 40px; text-align: center; color: var(--text-muted); border: 1px dashed var(--line); border-radius: var(--radius); }

/* ---------- Forma maydonlari ---------- */
.form-control {
    width: 100%; padding: 12px 14px; background: rgba(7, 12, 26, 0.6);
    border: 1px solid rgba(96, 165, 250, 0.22); border-radius: 10px;
    color: var(--text-main); font-size: 14px; transition: border-color .2s, box-shadow .2s;
}
.form-control::placeholder { color: #64748B; }
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); }
textarea.form-control { resize: vertical; min-height: 96px; }
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 0; border-top: 1px solid rgba(59, 130, 246, 0.14); background: linear-gradient(180deg, rgba(7,12,26,.4), rgba(7,12,26,.9)); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 24px 32px; padding-top: 34px; padding-bottom: 34px; }
.footer-bottom { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: flex-end; }
.flag { display: inline-block; border-radius: 3px; box-shadow: 0 0 0 1px rgba(255,255,255,.14); flex-shrink: 0; }

/* Til tanlash: footer oxirida kichik bayroqli ochiluvchi menyu */
.lang-drop { position: relative; }
.lang-drop .lang-btn {
    display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 9px;
    background: rgba(15, 23, 42, .6); border: 1px solid var(--line); border-radius: 9px;
    color: var(--text-muted); cursor: pointer; transition: .2s;
}
.lang-drop .lang-btn:hover, .lang-drop.open .lang-btn { border-color: var(--line-strong); color: var(--text-main); }
.lang-mini { font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.lang-caret { font-size: 8px; transition: transform .25s var(--ease); }
.lang-drop.open .lang-caret { transform: rotate(180deg); }
.lang-drop .lang-menu {
    position: absolute; right: 0; bottom: calc(100% + 8px); min-width: 196px; padding: 6px; z-index: 50;
    background: var(--surface-strong); border: 1px solid var(--line); border-radius: 12px;
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 -16px 40px -18px rgba(0,0,0,.75);
    opacity: 0; transform: translateY(6px); pointer-events: none; transition: opacity .2s, transform .2s var(--ease);
}
.lang-drop.open .lang-menu { opacity: 1; transform: none; pointer-events: auto; }
.lang-drop .lang-menu a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; color: var(--text-soft); }
.lang-drop .lang-menu a:hover { background: rgba(59,130,246,.1); color: var(--text-main); }
.lang-drop .lang-menu a.active { color: #93C5FD; font-weight: 600; }
.lang-drop .lang-menu small { font-size: 10.5px; padding: 1px 6px; border-radius: 4px; background: rgba(148,163,184,.14); color: var(--text-muted); }
.lang-drop .lang-menu .fa-check { margin-left: auto; font-size: 11px; }
body.light-mode .lang-drop .lang-btn { background: #fff; }
body.light-mode .lang-drop .lang-menu a.active { color: #2563EB; }
.footer-links { display: flex; justify-content: center; gap: 36px; flex-wrap: wrap; }
.footer-links a { color: var(--text-soft); font-size: 14px; font-weight: 500; }
.footer-links a:hover { color: var(--text-main); }
.footer-right { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.footer-social { display: flex; gap: 10px; align-items: center; }
.footer-social a {
    width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px;
    color: var(--text-soft); font-size: 19px;
}
.footer-social a:hover { color: #fff; background: rgba(59,130,246,.15); transform: translateY(-2px); }
.footer-copy { color: var(--text-muted); font-size: 13px; }
.footer-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.lang-select { position: relative; }
.lang-select select {
    appearance: none; background: rgba(15,23,42,.6); color: var(--text-soft); border: 1px solid var(--line);
    padding: 6px 30px 6px 12px; border-radius: 8px; font-size: 12.5px; cursor: pointer;
}
.lang-select i { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); pointer-events: none; font-size: 9px; color: var(--text-muted); }
body.light-mode .site-footer { background: rgba(255,255,255,.6); }
body.light-mode .lang-select select { background: #fff; }
body.light-mode .project-card { background: rgba(255,255,255,.85); }

@media (max-width: 960px) {
    .footer-inner { flex-direction: column; text-align: center; gap: 22px; }
    .footer-bottom { justify-content: center; }
    .lang-drop .lang-menu { right: 50%; transform: translate(50%, 6px); }
    .lang-drop.open .lang-menu { transform: translate(50%, 0); }
    .footer-right { align-items: center; }
    .footer-meta { justify-content: center; }
    .footer-links { gap: 22px; }
}

/* Paydo bo'lish animatsiyasi + 3D hover birga ishlashi uchun */
.project-card.fade-up { transition: opacity .8s var(--ease) var(--delay, 0s), transform .8s var(--ease) var(--delay, 0s), border-color .3s, box-shadow .45s var(--ease); }
.project-card.fade-up.show-animate { transition: opacity .8s var(--ease) var(--delay, 0s), transform .45s var(--ease), border-color .3s, box-shadow .45s var(--ease); }

/* =========================================================
   Formatlangan matn (CKEditor'dan kelgan kontent)
   ========================================================= */
.rich { color: var(--text-soft); font-size: 16.5px; line-height: 1.8; overflow-wrap: anywhere; }
.rich > * + * { margin-top: 1em; }
.rich h2, .rich h3, .rich h4 { color: var(--text-main); line-height: 1.3; letter-spacing: -0.01em; margin-top: 1.6em; }
.rich h2 { font-size: 1.6em; } .rich h3 { font-size: 1.3em; } .rich h4 { font-size: 1.1em; }
.rich a { color: #60A5FA; text-decoration: underline; text-underline-offset: 3px; }
.rich a:hover { color: #93C5FD; }
.rich strong { color: var(--text-main); }
.rich ul, .rich ol { padding-left: 1.4em; }
.rich ul { list-style: disc; } .rich ol { list-style: decimal; }
.rich li + li { margin-top: .35em; }
.rich ul.todo-list { list-style: none; padding-left: 0; }
.rich .todo-list label { display: inline-flex; gap: 8px; align-items: center; }
.rich blockquote { border-left: 3px solid var(--accent); padding: 6px 0 6px 18px; color: var(--text-main); font-style: italic; background: linear-gradient(90deg, rgba(59,130,246,.08), transparent); border-radius: 0 8px 8px 0; }
.rich code { font-family: var(--font-mono); font-size: .88em; background: rgba(148,163,184,.14); color: #F9A8D4; padding: 2px 6px; border-radius: 5px; }
.rich pre { background: #050A18; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; overflow-x: auto; }
.rich pre code { background: none; color: #E2E8F0; padding: 0; font-size: 14px; line-height: 1.7; }
.rich hr { border: 0; height: 1px; background: var(--line); margin: 2em 0; }
.rich figure { margin-left: 0; margin-right: 0; }
.rich figure.image { display: table; margin: 1.4em auto; max-width: 100%; }
.rich figure.image img, .rich img { max-width: 100%; height: auto; border-radius: 12px; }
.rich figure.image.image-style-align-left { float: left; margin: .4em 1.4em 1em 0; max-width: 50%; }
.rich figure.image.image-style-align-right { float: right; margin: .4em 0 1em 1.4em; max-width: 50%; }
.rich figure.image_resized img { width: 100%; }
.rich figcaption { display: table-caption; caption-side: bottom; text-align: center; font-size: 13px; color: var(--text-muted); padding-top: 8px; }
.rich figure.table { overflow-x: auto; display: block; }
.rich table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.rich th, .rich td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.rich th { background: rgba(59,130,246,.08); color: var(--text-main); }
.rich::after { content: ''; display: table; clear: both; }
@media (max-width: 640px) {
    .rich figure.image.image-style-align-left, .rich figure.image.image-style-align-right { float: none; max-width: 100%; margin: 1.2em 0; }
}
body.light-mode .rich pre { background: #0F172A; }

/* Spam tuzog'i — ko'rinmaydi, lekin ekran o'quvchilar va botlar uchun DOM'da bor */
.hp-wrap { position: absolute !important; left: -10000px !important; top: auto; width: 1px; height: 1px; overflow: hidden; }
.field-error { display: block; color: #FCA5A5; font-size: 12.5px; margin-top: 6px; }
.form-errors { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, .55); color: #FCA5A5; padding: 10px 14px; border-radius: 10px; font-size: 13.5px; }
body.light-mode .form-errors, body.light-mode .field-error { color: #B91C1C; }

/* Sahifalash (loyihalar va blog) */
.pagination { display: flex; justify-content: center; align-items: center; gap: 15px; margin-top: 50px; }
.page-link { padding: 8px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.page-link:hover { border-color: var(--accent); color: var(--accent); }
.page-current { font-size: 14px; color: var(--text-muted); }

/* ---- Telefon maydoni: davlat kodi + raqam ---- */
.phone-wrap label .opt { color: var(--text-muted); font-weight: 400; font-size: .92em; }
.phone-field { display: flex; align-items: stretch; gap: 0; }
.phone-dial-box {
    position: relative; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; min-width: 92px; padding: 0 12px;
    background: rgba(7, 12, 26, 0.6); border: 1px solid rgba(96, 165, 250, 0.22); border-right: 0;
    border-radius: 10px 0 0 10px; color: var(--text-main); font-weight: 600; font-size: 14px; cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
}
.phone-dial-box i { font-size: 10px; color: var(--text-muted); margin-left: auto; }
.phone-dial-box select.phone-country {   /* asl select ko'rinmaydi, lekin bosiladi va klaviatura bilan ishlaydi */
    position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; padding: 0; border: 0;
}
.phone-dial-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,.2); }
.phone-field .phone-number { border-radius: 0 10px 10px 0; flex: 1; min-width: 0; letter-spacing: .02em; }
.phone-field.has-error .phone-dial-box, .phone-field.has-error .phone-number { border-color: rgba(239, 68, 68, .7); }
body.light-mode .phone-dial-box { background: #F1F5F9; border-color: #CBD5E1; color: #0F172A; }

/* "Namuna" yorlig'i (demo ma'lumotlar) */
.demo-tag {
    position: absolute; top: 10px; left: 10px; z-index: 3;
    padding: 3px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    color: #FDE68A; background: rgba(120, 53, 15, .72); border: 1px solid rgba(251, 191, 36, .45);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); pointer-events: none;
}
.demo-tag--inline { position: static; display: inline-block; margin: 0 0 10px 10px; vertical-align: middle; }
.post-thumb, .blog-image, .card-image { position: relative; }
