/* style.css - CRYSTAL CLEAR Liquid Glass V5 (Based on image_1.png) */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Vazirmatn:wght@100;300;500;700;900&display=swap');

:root{
  /* --- Palette --- */
  --primary: #00f2ff;
  --accent: #7c4dff;
  --secondary: #ff0055;

  /* --- Background & Blobs (Vibrant darker theme) --- */
  --bg-1: #020817;
  --bg-2: #000000;
  --blob-1: rgba(0, 242, 255, 0.4);
  --blob-2: rgba(124, 77, 255, 0.35);

  /* --- CRYSTAL GLASS SETTINGS --- */
  --glass-surface: linear-gradient(145deg, rgba(255,255,255,0.01), rgba(255,255,255,0.005));
  --glass-edge-top: rgba(255,255,255,0.4);
  --glass-edge-bottom: rgba(255,255,255,0.05);
  --glass-blur: 5px;
  --glass-volume:
    0 30px 70px -10px rgba(0,0,0,0.8),
    inset 0 1px 1px rgba(255,255,255,0.6),
    inset 0 -1px 1px rgba(0,0,0,0.2),
    inset 0 0 20px rgba(255,255,255,0.02);

  /* --- Typography --- */
  --font-ui: 'Vazirmatn', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Orbitron', system-ui, sans-serif;
  --text-main: #ffffff;
  --text-muted: #9ca3af;

  --radius-lg: 32px;
  --radius-md: 20px;
}

/* --- Light Mode --- */
body.light-mode{
  --primary: #0066ff; /* آبی */
  --accent: #5200ff; /* بنفش تیره */
  --bg-1: #eef4ff; /* آبی روشن */
  --bg-2: #dce9ff; /* آبی روشن‌تر */
  --text-main: #1a1a2e;
  --text-muted: #64748b;
  --blob-1: rgba(0, 89, 255, 0.3); /* آبی */
  --blob-2: rgba(0, 123, 255, 0.25); /* آبی روشن‌تر */
  --glass-surface: linear-gradient(145deg, rgba(255,255,255,0.3), rgba(255,255,255,0.1));
  --glass-edge-top: rgba(255,255,255,0.8);
  --glass-edge-bottom: rgba(255,255,255,0.3);
  --glass-volume:
    0 25px 50px -10px rgba(0,40,120,0.15),
    inset 0 1px 2px rgba(255,255,255,0.9),
    inset 0 -1px 1px rgba(0,0,0,0.05);
}

/* --- Global Reset & Font Application --- */
*{
  box-sizing:border-box;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body, button, input, textarea, select {
  font-family: var(--font-ui) !important;
}
.font-eng { font-family: var(--font-display) !important; }

html,body{ height:100%; margin:0; padding:0; }

body{
  color:var(--text-main);
  background:
    radial-gradient(circle at 20% 20%, var(--blob-1), transparent 45%),
    radial-gradient(circle at 80% 80%, var(--blob-2), transparent 45%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  direction: rtl;
  min-height:100vh;
  overflow-x: hidden;
}

body::before, body::after{
  content:''; position:fixed; z-index:-1; filter: blur(80px);
  border-radius:50%; animation: floatLiquid 15s infinite alternate ease-in-out;
}
body::before{
  width:65vw; height:65vw; background:var(--blob-1);
  top:-25%; left:-25%;
}
body::after{
  width:55vw; height:55vw; background:var(--blob-2);
  bottom:-25%; right:-15%; animation-delay: -7s;
}
@keyframes floatLiquid {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(50px, 70px) scale(1.05); }
}

body::before {
  background: linear-gradient(-45deg, var(--blob-1), var(--blob-2));
  background-size: 400% 400%;
  animation: gradientMove 15s ease infinite;
}

.container{ padding:40px 5%; max-width:1400px; margin:0 auto; }
.grid{ display:grid; grid-template-columns: repeat(auto-fit, minmax(500px,1fr)); gap:10px; }
.grid.grid-4{grid-template-columns: repeat(4, 1fr);}
.grid.grid-3{grid-template-columns: repeat(3, 1fr);}

/* --- CRYSTAL HEADER --- */
.header{
  display:flex; align-items:center; justify-content:space-between;
  padding:15px 30px; height:90px;
  position:sticky; top:20px; z-index:100; margin:0 20px;
  border-radius: var(--radius-lg);
  background: var(--glass-surface);
  backdrop-filter: blur(var(--glass-blur)) saturate(250%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(250%);
  border-top: 1px solid var(--glass-edge-top);
  border-left: 1px solid var(--glass-edge-top);
  border-bottom: 1px solid var(--glass-edge-bottom);
  border-right: 1px solid var(--glass-edge-bottom);
  box-shadow: var(--glass-volume);
}

.logo{
  font-family:var(--font-display) !important;
  font-weight:900; font-size:1.8rem; letter-spacing:2px;
  background: linear-gradient(to bottom, #01ffea 30%, var(--primary));
  -webkit-background-clip:text; -webkit-text-fill-color:transparent;
  filter: drop-shadow(0 0 15px rgba(0, 242, 255, 0.5));
}

/* --- CRYSTAL CARD --- */
.card{
  background: var(--glass-surface);
  border-radius: var(--radius-lg);
  padding:35px; position:relative; overflow:hidden;
  backdrop-filter: blur(var(--glass-blur)) saturate(220%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(220%);
  border-top: 1px solid var(--glass-edge-top);
  border-left: 1px solid var(--glass-edge-top);
  border-bottom: 1px solid var(--glass-edge-bottom);
  border-right: 1px solid var(--glass-edge-bottom);
  box-shadow: var(--glass-volume);
  transition: all 0.3s ease;
  transform-style: preserve-3d;
}

.card::after{
  content:""; position:absolute; top:-50%; left:-50%; width:200%; height:200%;
  background: linear-gradient(
    to bottom right,
    transparent 40%,
    rgba(255,255,255,0.15) 50%,
    transparent 60%
  );
  transform: rotate(30deg) translateY(-100%); transition: 0.8s; pointer-events:none;
}
.card:hover::after{ transform: rotate(30deg) translateY(100%); }

.card:hover{
  transform: translateY(-8px) rotateY(5deg) scale(1.02);
  box-shadow:
    0 40px 80px -15px rgba(0,0,0,1),
    inset 0 1px 1px rgba(255,255,255,0.8);
}

/* --- افکت‌های نورپردازی پویا برای کارت‌ها --- */
.card:hover {
  border-color: rgba(0, 242, 255, 0.5);
  background: rgba(255, 255, 255, 0.05);
}

.card h3{ font-size:1.5rem; margin:0 0 15px; font-weight:700; }

/* --- Admin Accordion (details) --- */
.admin-accordion{
  padding: 0;
}
.admin-accordion > summary{
  list-style: none;
  cursor: pointer;
  user-select: none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 22px 35px;
}
.admin-accordion > summary::-webkit-details-marker{ display:none; }
.admin-accordion > summary::after{
  content: "▾";
  font-size: 1.3rem;
  opacity: 0.75;
  transform: rotate(0deg);
  transition: transform 0.2s ease;
}
.admin-accordion[open] > summary::after{ transform: rotate(180deg); }
.admin-accordion > summary h2,
.admin-accordion > summary h3{
  margin: 0;
}
.admin-accordion .admin-accordion-body{
  padding: 0 35px 35px;
  border-top: 1px solid var(--glass-edge-bottom);
}

.icon-distance-s {
  display: inline-block; width: 28px; height: 28px;
  background-image: url('image_0.png');
  background-size: contain; background-repeat: no-repeat; background-position: center;
  vertical-align: middle; margin-right: 10px;
  filter: drop-shadow(0 0 10px var(--primary));
}

/* --- Buttons --- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:10px;
  padding:14px 30px; border-radius:50px; font-weight:700; cursor:pointer;
  text-decoration:none; position:relative; overflow:hidden;
  background: rgba(255,255,255,0.01);
  border: 1px solid var(--glass-edge-top);
  color: var(--primary);
  backdrop-filter: blur(5px);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.3), 0 15px 30px -10px rgba(0,0,0,0.6);
  transition: all 0.3s ease;
  background: linear-gradient(-45deg, var(--primary), var(--accent));
  background-size: 200% 200%;
}

.btn::before{
  content:""; position:absolute; left:0; top:0; width:0%; height:100%; z-index:-1;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn:hover {
  color: #000;
  border-color: transparent;
  box-shadow: 0 20px 40px -10px var(--primary);
  background-position: 100% 50%;
}

.btn:hover::before{ width:100%; }

.btn:active {
  animation: pulse 0.3s ease;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.btn-danger{ color:var(--secondary); }
.btn-danger::before{ background: linear-gradient(90deg, var(--secondary), #ff7aa4); }
.btn-danger:hover{ color:#fff; box-shadow: 0 20px 40px -10px var(--secondary); }

/* --- Buttons in Light Mode --- */
body.light-mode .btn {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 102, 255, 0.3);
    color: #000000;
    backdrop-filter: blur(5px);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.7), 0 15px 30px -10px rgba(0, 40, 120, 0.1);
    background: linear-gradient(-45deg, rgba(0, 102, 255, 0.7), rgba(82, 0, 255, 0.7));
    background-size: 200% 200%;
}

body.light-mode .btn::before {
    background: linear-gradient(90deg, #0066ff, #5200ff);
}

body.light-mode .btn:hover {
    color: #fff;
    border-color: transparent;
    box-shadow: 0 20px 40px -10px rgba(0, 102, 255, 0.4);
    background-position: 100% 50%;
    background: rgba(0, 102, 255, 0.9);
}

body.light-mode .btn:hover::before {
    width: 100%;
}

body.light-mode .btn-danger {
    color: #d32f2f;
    border: 1px solid rgba(211, 47, 47, 0.3);
    background: linear-gradient(-45deg, rgba(211, 47, 47, 0.7), rgba(244, 67, 54, 0.7));
    background-size: 200% 200%;
}

body.light-mode .btn-danger::before {
    background: linear-gradient(90deg, #d32f2f, #f44336);
}

body.light-mode .btn-danger:hover {
    color: #fff;
    box-shadow: 0 20px 40px -10px rgba(211, 47, 47, 0.4);
    background-position: 100% 50%;
    background: rgba(211, 47, 47, 0.9);
}
/* --- Inputs --- */
input, textarea, select{
  width:100%; padding:16px; border-radius:var(--radius-md);
  background: rgba(0,0,0,0.1);
  border: 1px solid rgba(255,255,255,0.03);
  border-top: 1px solid rgba(255,255,255,0.2);
  color:var(--text-main);
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.4);
  backdrop-filter: blur(5px);
}
body.light-mode input{ background: rgba(255,255,255,0.4); border: 1px solid rgba(0,0,0,0.05); color:#000; }

input:focus{
  border-color: var(--primary);
  box-shadow: 0 0 30px rgba(0,242,255,0.3), inset 0 1px 1px rgba(255,255,255,0.6);
  background: rgba(0,0,0,0.2);
}

/* --- Table --- */
table{ width:100%; border-collapse:separate; border-spacing:0 10px; }
th{ text-align:right; color:var(--text-muted); padding:15px; }
td{
  background: rgba(255,255,255,0.01); padding:15px;
  border-top: 1px solid rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(0,0,0,0.2);
  backdrop-filter: blur(8px);
}
tr td:first-child{ border-radius:0 18px 18px 0; border-right: 4px solid var(--primary); }
tr td:last-child{ border-radius:18px 0 0 18px; }
tr:hover td{ background: rgba(255,255,255,0.03); }

/* --- Theme Toggle --- */
.theme-toggle {
    position: fixed;
    bottom: 30px;
    left: 30px;

    width: 60px;
    height: 60px;

    background: var(--glass-surface);
    border: 1px solid var(--glass-edge-top);
    border-radius: 50%;

    display: flex;
    justify-content: center;
    align-items: center;

    cursor: pointer;
    z-index: 999999; /* مهم */

    color: var(--primary);
    backdrop-filter: blur(10px) saturate(200%);
    box-shadow: 0 15px 30px rgba(0,0,0,0.4);

    transition: transform 0.3s ease;

    /* 🔴 این خط‌ها خیلی مهمن */
    transform: none !important;
    inset: auto;
}

.theme-toggle:hover { transform: rotate(180deg) scale(1.1); background: var(--primary); color: #fff; box-shadow: 0 0 40px var(--primary); }

/* --- منوی دایره‌ای --- */
.circle-menu {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--glass-surface);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.circle-menu:hover {
    transform: scale(1.1);
}

/* منوی شناور */
.floating-menu {
    position: fixed;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    background: var(--glass-surface);
    backdrop-filter: blur(10px);
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: none;
}

/* --- افکت پارالاکس --- */
.parallax {
    background-image: url('your-image.jpg');
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

.parallax::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

/* --- افکت‌های تایپوگرافی --- */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

.typing-text {
    overflow: hidden;
    white-space: nowrap;
    animation: typing 2s steps(30, end);
}

h1, h2, h3 {
    font-family: var(--font-display);
    background: linear-gradient(to right, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- Popup Notification --- */
.popup-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: none;
    max-width: 250px;
    background: var(--glass-surface);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    backdrop-filter: blur(var(--glass-blur)) saturate(220%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(220%);
    border-top: 1px solid var(--glass-edge-top);
    border-left: 1px solid var(--glass-edge-top);
    border-bottom: 1px solid var(--glass-edge-bottom);
    border-right: 1px solid var(--glass-edge-bottom);
    box-shadow: var(--glass-volume);
    color: var(--text-main);
    font-family: var(--font-ui);
    font-size: 0.9rem;
    animation: fadeIn 0.3s ease-in-out;
}

.popup-content {
    display: flex;
    align-items: center;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Toast Notification --- */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    background: var(--glass-surface);
    backdrop-filter: blur(var(--glass-blur)) saturate(220%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(220%);
    border-top: 1px solid var(--glass-edge-top);
    border-left: 1px solid var(--glass-edge-top);
    border-bottom: 1px solid var(--glass-edge-bottom);
    border-right: 1px solid var(--glass-edge-bottom);
    box-shadow: var(--glass-volume);
    color: var(--text-main);
    font-family: var(--font-ui);
    font-size: 0.9rem;
    animation: fadeIn 0.3s ease-in-out;
    max-width: 300px;
    border-left: 4px solid var(--primary);
}

.toast.success {
    border-left: 4px solid var(--primary);
}

.toast.error {
    border-left: 4px solid var(--secondary);
    color: var(--secondary);
}

.toast.info {
    border-left: 4px solid var(--accent);
}

/* --- تنظیمات ریسپانسیو برای موبایل --- */
@media (max-width: 768px) {
    body { font-size: 14px; }
    .header { height: auto; flex-direction: column; padding: 15px; gap: 15px; margin: 10px; }
    .header div { width: 100%; justify-content: center; display: flex; }
    .logo { font-size: 1.4rem; }
    .card { padding: 20px; margin: 10px 0; }
    .btn { padding: 10px 20px; font-size: 0.9rem; }
    .grid { grid-template-columns: 1fr; gap: 15px; }
    input, textarea, select { padding: 12px; }
    table { display: block; overflow-x: auto; }
    th, td { padding: 10px; font-size: 0.85rem; }
    .theme-toggle { bottom: 20px; left: 20px; width: 45px; height: 45px; font-size: 0.8rem; }
    .container { padding: 20px 5%; }
    .circle-menu { bottom: 20px; right: 20px; width: 50px; height: 50px; }
    .floating-menu { left: 10px; padding: 8px; }
    .popup-notification { top: 10px; right: 10px; max-width: 200px; font-size: 0.8rem; }
    .toast { top: 10px; right: 10px; max-width: 250px; font-size: 0.8rem; }
}

/* --- Animation Enhancements --- */
button, a {
  transition: all 0.3s ease-in-out;
}

button:hover, a:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(0, 242, 255, 0.3);
}

/* --- Scroll Animation --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section {
  animation: fadeInUp 0.8s ease-in-out;
}
