/* TechDeen — Cycle (dairesel) ana menü */

@property --spin {
    syntax: '<angle>';
    inherits: true;
    initial-value: 0deg;
}

/* ---------- Tek sayfa kilidi (alttaki boşluğu önler, pull-to-refresh'e izin verir) ---------- */
html:has(.cycle-page),
body.cycle-home {
    height: 100%;
    min-height: 100%;
    overflow-x: hidden;
    overscroll-behavior-y: auto;
    background: #090e1a !important;
}

body.light-mode.cycle-home {
    background: #f5f8fc !important;
}

/* Cycle menü sayfasında alttaki particles canvas'ı gizlenir (cycle-bg kendi arkaplanını kullanır) */
body.cycle-home #particles-js,
body.cycle-home #particles-js canvas {
    display: none !important;
}

body.cycle-home #page-container {
    height: 100%;
    min-height: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
}

body.cycle-home #content-wrap {
    height: 100%;
    min-height: 100%;
    max-height: 100%;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.cycle-page {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 100%;
    max-height: 100%;
    max-width: none;   /* style.css'teki global main { max-width:1200px; margin:auto } kuralını ezer */
    margin: 0;
    padding: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: #dbe6f7;
    isolation: isolate;
}

/* ---------- Arka plan: koyu lacivert + ince ızgara + yumuşak ışık ---------- */
.cycle-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 50% 50%, rgba(56, 189, 248, 0.07), transparent 55%),
        radial-gradient(circle at 88% 28%, rgba(30, 64, 175, 0.22), transparent 42%),
        radial-gradient(circle at 10% 85%, rgba(99, 102, 241, 0.1), transparent 40%),
        linear-gradient(rgba(148, 163, 184, 0.045) 1px, transparent 1px) 0 0 / 72px 72px,
        linear-gradient(90deg, rgba(148, 163, 184, 0.045) 1px, transparent 1px) 0 0 / 72px 72px,
        #090e1a;
}

/* ---------- Köşe butonları ---------- */
.cycle-corner {
    position: absolute;
    top: 18px;
    z-index: 5;
    display: flex;
    gap: 8px;
}

.cycle-corner--left { left: 18px; }
.cycle-corner--right { right: 18px; }

.cycle-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 15px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #d6e2f5;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
}

.cycle-chip:hover,
.cycle-chip:focus-visible {
    color: #ffffff;
    border-color: rgba(96, 165, 250, 0.55);
    box-shadow: 0 0 18px rgba(59, 130, 246, 0.25);
}

.cycle-chip--primary {
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    border-color: transparent;
    color: #ffffff;
}

.cycle-chip--icon {
    width: 38px;
    padding: 0;
    justify-content: center;
}

.cycle-avatar {
    flex: none;
    width: 26px;
    height: 26px;
    margin-left: -9px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    position: relative;
    overflow: hidden;
}

.cycle-avatar img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
}

/* Resim varken harfi gizle; resim yüklenemeyip kaldırılırsa harf görünür */
.cycle-avatar img ~ .cycle-avatar-initial { display: none; }

/* ---------- Sayı rozeti ---------- */
.cycle-chip { position: relative; }

.cycle-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 0 0 2px #090e1a;
}

/* ---------- Açılır panel (bildirimler / bekleyenler) ---------- */
.cycle-panel {
    width: min(360px, calc(100vw - 28px));
    margin-top: 8px !important;
    padding: 0;
    overflow: hidden;
    background: rgba(13, 19, 33, 0.97);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    color: #dbe6f7;
}

.cycle-panel-header {
    padding: 12px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #e2e8f0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.cycle-panel-body {
    max-height: 380px;
    overflow-y: auto;
}

.cycle-panel .notification-unread-dot {
    width: 7px;
    height: 7px;
    margin-top: 6px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #3ea6ff;
}

.cycle-pending-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    color: #d6e2f5;
    font-size: 0.85rem;
    text-decoration: none;
    transition: background 0.2s ease;
}

.cycle-pending-row + .cycle-pending-row { border-top: 1px solid rgba(148, 163, 184, 0.08); }

.cycle-pending-row:hover {
    background: rgba(148, 163, 184, 0.08);
    color: #ffffff;
}

.cycle-pending-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(var(--rgb), 0.14);
    color: rgb(var(--rgb));
    font-size: 0.8rem;
}

.cycle-pending-count {
    margin-left: auto;
    min-width: 26px;
    padding: 1px 8px;
    border-radius: 999px;
    background: rgba(var(--rgb), 0.16);
    color: rgb(var(--rgb));
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
}

/* ---------- Profil menüsü ---------- */
.cycle-caret {
    font-size: 0.6rem;
    opacity: 0.6;
    transition: transform 0.25s ease;
}

#cycleProfileBtn[aria-expanded="true"] .cycle-caret { transform: rotate(180deg); }

.cycle-panel--menu {
    width: 230px;
    padding: 6px;
}

.cycle-menu-user {
    padding: 8px 12px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #8fa3c4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cycle-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 10px;
    background: none;
    color: #d6e2f5;
    font-family: 'Outfit', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.cycle-menu-item i {
    width: 16px;
    text-align: center;
    color: #8fa3c4;
    transition: color 0.2s ease;
}

.cycle-menu-item:hover,
.cycle-menu-item:focus-visible {
    background: rgba(148, 163, 184, 0.1);
    color: #ffffff;
}

.cycle-menu-item:hover i { color: #60a5fa; }

.cycle-menu-item--danger:hover,
.cycle-menu-item--danger:focus-visible {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
}

.cycle-menu-item--danger:hover i { color: #f87171; }

.cycle-menu-divider {
    height: 1px;
    margin: 4px 6px;
    background: rgba(148, 163, 184, 0.12);
}

/* ---------- Çark ---------- */
.cycle-wheel {
    --wheel: min(84vmin, 760px);
    --r: calc(var(--wheel) * 0.41);
    --node: clamp(52px, 11vmin, 96px);
    position: relative;
    width: var(--wheel);
    height: var(--wheel);
}

.cycle-orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    width: calc(var(--r) * 2);
    height: calc(var(--r) * 2);
    border-radius: 50%;
    border: 1px dashed rgba(148, 163, 184, 0.12);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* ---------- Merkez ---------- */
.cycle-core {
    position: absolute;
    top: 50%;
    left: 50%;
    width: calc((var(--r) - var(--node) / 2) * 2 - 28px);
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
}

.cycle-core-default,
.cycle-core-detail {
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.cycle-core-detail {
    position: absolute;
    inset: 50% 0 auto;
    transform: translateY(-50%) scale(0.96);
    opacity: 0;
}

.cycle-core.has-detail .cycle-core-default {
    opacity: 0;
    transform: scale(0.94);
}

.cycle-core.has-detail .cycle-core-detail {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

.cycle-page .cycle-brand {
    margin: 0;
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.5rem, 6.4vmin, 3.4rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.1;
    background: linear-gradient(100deg, #3b9cff 0%, #e9dfbf 50%, #6fb6ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 24px rgba(59, 156, 255, 0.25));
}

.cycle-page .cycle-tagline {
    margin: 0.6em 0 0;
    font-size: clamp(0.72rem, 1.9vmin, 1rem);
    font-style: italic;
    letter-spacing: 0.12em;
    text-transform: lowercase;
    color: #8fa3c4;
}

.cycle-page .cycle-hint {
    margin: 1.6em 0 0;
    font-size: clamp(0.58rem, 1.35vmin, 0.72rem);
    font-weight: 500;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: #5f7193;
    white-space: nowrap;
}

.cycle-page .cycle-detail-title {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.2rem, 4.6vmin, 2.5rem);
    font-weight: 700;
    line-height: 1.15;
    color: rgb(var(--rgb, 96, 165, 250));
    text-shadow: 0 0 26px rgba(var(--rgb, 96, 165, 250), 0.35);
}

.cycle-page .cycle-detail-desc {
    margin: 0.55em auto 0;
    max-width: 30ch;
    font-size: clamp(0.72rem, 1.9vmin, 1rem);
    line-height: 1.5;
    color: #a9b8d3;
}

/* ---------- Halka ve öğeler ---------- */
/* Dönüş animasyonu cycle_menu.js'te (Web Animations API) */
.cycle-ring {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    --spin: 0deg;
}

/* JS ilk giriş animasyonunu başlatana kadar gizli */
.cycle-ring.is-entering { opacity: 0; }

.cycle-item {
    --angle: calc(var(--a) + var(--spin));
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--node);
    height: var(--node);
    margin: calc(var(--node) / -2) 0 0 calc(var(--node) / -2);
    transform: rotate(var(--angle)) translateY(calc(var(--r) * -1)) rotate(calc(var(--angle) * -1));
}

/* Öğeden merkeze uzanan ince ışın */
.cycle-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1px;
    height: calc(var(--r) * 0.6);
    margin-left: -0.5px;
    transform-origin: top center;
    transform: rotate(var(--angle));
    background: linear-gradient(to bottom, rgba(var(--rgb), 0.35), transparent);
    pointer-events: none;
}

.cycle-node {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.cycle-icon {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 35%, rgba(var(--rgb), 0.22), rgba(var(--rgb), 0.06) 70%),
        #0d1424;
    border: 1px solid rgba(var(--rgb), 0.45);
    box-shadow: 0 0 22px rgba(var(--rgb), 0.18), inset 0 0 18px rgba(var(--rgb), 0.12);
    color: rgb(var(--rgb));
    font-size: calc(var(--node) * 0.36);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.cycle-icon.is-glyph {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: calc(var(--node) * 0.34);
    letter-spacing: -0.04em;
}

/* Alt menüsü olan öğelerde yavaş dönen kesikli halka */
.cycle-node.has-children::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1px dashed rgba(var(--rgb), 0.4);
    animation: cycleSpin 18s linear infinite;
    pointer-events: none;
}

@keyframes cycleSpin {
    to { transform: rotate(360deg); }
}

.cycle-label {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-family: 'Outfit', sans-serif;
    font-size: clamp(0.68rem, 1.7vmin, 0.95rem);
    font-weight: 500;
    color: #d3dff2;
    transition: color 0.3s ease;
}

.cycle-node:hover .cycle-icon,
.cycle-node:focus-visible .cycle-icon {
    transform: scale(1.08);
    border-color: rgba(var(--rgb), 0.85);
    box-shadow: 0 0 34px rgba(var(--rgb), 0.45), inset 0 0 20px rgba(var(--rgb), 0.2);
}

.cycle-node:hover .cycle-label,
.cycle-node:focus-visible .cycle-label {
    color: #ffffff;
}

.cycle-node:focus-visible { outline: none; }

/* ---------- Açık tema ---------- */
body.light-mode .cycle-page { color: #1e293b; }

body.light-mode .cycle-bg {
    background:
        radial-gradient(ellipse at 50% 50%, rgba(56, 189, 248, 0.1), transparent 55%),
        radial-gradient(circle at 88% 28%, rgba(59, 130, 246, 0.12), transparent 42%),
        radial-gradient(circle at 10% 85%, rgba(99, 102, 241, 0.08), transparent 40%),
        linear-gradient(rgba(15, 23, 42, 0.05) 1px, transparent 1px) 0 0 / 72px 72px,
        linear-gradient(90deg, rgba(15, 23, 42, 0.05) 1px, transparent 1px) 0 0 / 72px 72px,
        #f5f8fc;
}

body.light-mode .cycle-chip {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(15, 23, 42, 0.12);
    color: #1e3a8a;
}

body.light-mode .cycle-chip:hover {
    color: #1d4ed8;
    background: #ffffff;
}

body.light-mode .cycle-chip--primary {
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    border-color: transparent;
    color: #ffffff;
}

body.light-mode .cycle-badge { box-shadow: 0 0 0 2px #f5f8fc; }

body.light-mode .cycle-panel {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.12);
    color: #1e293b;
}

body.light-mode .cycle-panel-header {
    color: #0f172a;
    background: #f8fafc;
    border-bottom-color: #e2e8f0;
}

body.light-mode .cycle-pending-row { color: #334155; }
body.light-mode .cycle-pending-row + .cycle-pending-row { border-top-color: #eef2f7; }
body.light-mode .cycle-pending-row:hover { background: #f1f5f9; color: #0f172a; }

body.light-mode .cycle-menu-user { color: #64748b; }
body.light-mode .cycle-menu-item { color: #334155; }
body.light-mode .cycle-menu-item i { color: #64748b; }
body.light-mode .cycle-menu-item:hover { background: #f1f5f9; color: #0f172a; }
body.light-mode .cycle-menu-item:hover i { color: #2563eb; }
body.light-mode .cycle-menu-item--danger:hover { background: #fef2f2; color: #dc2626; }
body.light-mode .cycle-menu-item--danger:hover i { color: #dc2626; }
body.light-mode .cycle-menu-divider { background: #e2e8f0; }

body.light-mode .cycle-orbit { border-color: rgba(15, 23, 42, 0.12); }

body.light-mode .cycle-page .cycle-brand {
    background: linear-gradient(100deg, #1d4ed8 0%, #0f766e 50%, #2563eb 100%);
    -webkit-background-clip: text;
    background-clip: text;
    filter: none;
}

body.light-mode .cycle-page .cycle-tagline,
body.light-mode .cycle-page .cycle-detail-desc { color: #475569; }

body.light-mode .cycle-page .cycle-hint { color: #94a3b8; }

body.light-mode .cycle-page .cycle-detail-title { text-shadow: none; }

body.light-mode .cycle-icon {
    background:
        radial-gradient(circle at 50% 35%, rgba(var(--rgb), 0.18), rgba(var(--rgb), 0.05) 70%),
        #ffffff;
    box-shadow: 0 6px 18px rgba(var(--rgb), 0.18);
}

body.light-mode .cycle-label { color: #334155; }
body.light-mode .cycle-node:hover .cycle-label { color: #0f172a; }

/* ---------- Mobil ---------- */
@media (max-width: 576px) {
    .cycle-corner { top: 14px; }
    .cycle-corner--left { left: 14px; }
    .cycle-corner--right { right: 14px; }
    .cycle-corner .cycle-chip-text { display: none; }
    .cycle-corner #cycleAdminBtn,
    .cycle-corner #cycleProfileBtn { width: 38px; padding: 0; justify-content: center; }
    .cycle-avatar { margin-left: 0; }
    .cycle-corner { gap: 6px; }
    .cycle-corner .cycle-caret { display: none; }
    .cycle-page .cycle-hint { margin-top: 1.2em; letter-spacing: 0.2em; }
    .cycle-page .cycle-hint-lead { display: none; }
}

/* Geri bildirim butonu anasayfada mobilde de görünür (feedback.css: body:not(.cycle-home));
   burada yalnızca mobil konumu ayarlanıyor */
@media (max-width: 991px) {
    .cycle-home .feedback-fab {
        left: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .cycle-icon,
    .cycle-core-default,
    .cycle-core-detail { transition: none; }
    .cycle-node.has-children::after { animation: none; }
}
