/* =========================================
   Maria Cloud - Dashboard UI Kit (Glassmorphism)
   ========================================= */

:root {
  --dash-bg: #0f172a;
  --dash-card: rgba(30, 41, 59, 0.7);
  --dash-border: rgba(255, 255, 255, 0.1);
  --dash-text: #f8fafc;
  --dash-muted: #94a3b8;
  --dash-primary: #3b82f6;
  --dash-primary-hover: #2563eb;
  --dash-glow: rgba(59, 130, 246, 0.4);
  --dash-success: #10b981;
  --dash-danger: #ef4444;
  --dash-radius: 16px;
}

/* کارت‌های شیشه‌ای */
.glass-panel {
  background: #101a2c;
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-radius);
  padding: 24px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.glass-panel:hover {
  border-color: rgba(59, 130, 246, 0.3);
}

/* عنوان صفحه */
.page-header { margin-bottom: 24px; }
.page-title { font-size: 24px; font-weight: 700; color: var(--dash-text); margin: 0 0 8px 0; display: flex; align-items: center; gap: 10px; }
.page-subtitle { font-size: 14px; color: var(--dash-muted); margin: 0; line-height: 1.6; }

/* فرم‌ها و ورودی‌ها */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--dash-muted); margin-bottom: 8px; }
.form-control {
  width: 100%; background: rgba(15, 23, 42, 0.6); border: 1px solid var(--dash-border);
  border-radius: 10px; padding: 12px 16px; color: var(--dash-text);
  font-family: inherit; font-size: 14px; transition: all 0.2s ease; box-sizing: border-box;
}
.form-control:focus {
  outline: none; border-color: var(--dash-primary);
  box-shadow: 0 0 0 3px var(--dash-glow); background: rgba(15, 23, 42, 0.9);
}
select.form-control {
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: left 12px center; background-size: 16px; padding-left: 40px;
}

/* دکمه‌ها */
.btn-primary {
  background: linear-gradient(135deg, var(--dash-primary), var(--dash-primary-hover));
  color: #fff; border: none; border-radius: 10px; padding: 12px 24px;
  font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 4px 15px var(--dash-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px var(--dash-glow); }
.btn-primary:active { transform: translateY(0); }
.btn-outline {
  background: transparent; color: var(--dash-text); border: 1px solid var(--dash-border);
  border-radius: 10px; padding: 12px 24px; font-weight: 600; cursor: pointer;
  transition: all 0.2s; display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
}
.btn-outline:hover { background: rgba(255, 255, 255, 0.05); border-color: var(--dash-muted); }

/* گرید (شبکه) */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 768px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
/* Admin Tables */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--dash-radius);
  border: 1px solid var(--dash-border);
  background: #0d1728;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  color: var(--dash-text);
  font-size: 14px;
}
.admin-table th {
  background: rgba(15, 23, 42, 0.8);
  padding: 16px;
  font-weight: 600;
  color: var(--dash-muted);
  border-bottom: 1px solid var(--dash-border);
  white-space: nowrap;
}
.admin-table td {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}
.admin-table tr:last-child td {
  border-bottom: none;
}
.admin-table tr:hover td {
  background: rgba(59, 130, 246, 0.05);
}

/* Stats Cards */
.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
}
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 24px;
  background: rgba(59, 130, 246, 0.15);
  color: var(--dash-primary);
}
.stat-info h4 { margin: 0 0 4px 0; font-size: 13px; color: var(--dash-muted); font-weight: 500; }
.stat-info .num { margin: 0; font-size: 24px; font-weight: 700; color: var(--dash-text); }
/* =========================================
   Alerts & Flash Messages
   ========================================= */
.flash {
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  font-size: 15px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideDownFade 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.flash-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  box-shadow: 0 8px 30px -10px rgba(16, 185, 129, 0.3);
}
.flash-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  box-shadow: 0 8px 30px -10px rgba(239, 68, 68, 0.3);
}
@keyframes slideDownFade {
  from { opacity: 0; transform: translateY(-15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   Loading Button State
   ========================================= */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn-loading::after {
  content: "";
  position: absolute;
  width: 20px; height: 20px;
  top: 50%; left: 50%;
  margin: -10px 0 0 -10px;
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================
   Custom Inputs & Selects
   ========================================= */
.form-control {
  background: rgba(15, 23, 42, 0.8) !important;
  border: 1px solid var(--dash-border) !important;
  color: #fff !important;
  border-radius: 10px;
  transition: all 0.3s ease;
}
.form-control:focus {
  border-color: var(--dash-primary) !important;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.3) !important;
}
select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: left 14px center !important;
  background-size: 16px !important;
  padding-left: 40px !important;
}
/* =========================================
   Custom Premium Scrollbars
   ========================================= */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.4);
    border-radius: 10px;
    margin: 4px;
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
    transition: all 0.3s ease;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #818cf8 0%, #a78bfa 100%);
    border: 1px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-corner {
    background: transparent;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #6366f1 rgba(15, 23, 42, 0.4);
}

/* =========================================
   Premium Animations Library
   ========================================= */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}
@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 40px rgba(99,102,241,0.6); }
}
@keyframes floatSoft {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes spinGlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}