@font-face {
  font-family: 'Vazirmatn';
  src: url('fonts/Vazirmatn-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
    --primary: #00c3ff;
    --secondary: #ffd000;
    --accent: #ff0055;
    --bg: #02030a;
    --card-bg: rgba(2, 3, 10, 0.75);
    --border-glow: rgba(0, 195, 255, 0.25);
    --font-main: 'Vazirmatn', Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    user-select: none;
}

body {
    background-color: var(--bg);
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    font-family: 'Vazirmatn', Arial, sans-serif;
}

.nebula-layer {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 30% 40%, rgba(0, 195, 255, 0.07) 0%, transparent 40%),
        radial-gradient(circle at 70% 60%, rgba(255, 0, 85, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 50% 30%, rgba(255, 208, 0, 0.03) 0%, transparent 35%);
    z-index: -3;
    animation: nebulaShift 25s ease-in-out infinite alternate;
}

.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: 50px 50px;
    background-image: 
        linear-gradient(to right, rgba(0, 195, 255, 0.3) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 195, 255, 0.3) 1px, transparent 1px);
    z-index: -2;
    animation: gridDrift 22s linear infinite, gridLinesFlash 2.5s ease-in-out infinite alternate, gridColorShift 12s linear infinite;
}

.lightning-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    opacity: 0;
    z-index: 1000;
    pointer-events: none;
}

.dashboard-container {
    width: 100%;
    max-width: 1200px;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    animation: systemFadeIn 1s ease-out forwards;
}

.header-panel {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
}

.system-title {
    font-size: 4rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 6px;
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 195, 255, 0.6), 0 0 20px rgba(0, 195, 255, 0.3);
    animation: titleFlicker 4s infinite, breathingGlow 3s ease-in-out infinite alternate;
    position: relative;
}

.system-title span {
    color: var(--secondary);
    text-shadow: 0 0 10px rgba(255, 208, 0, 0.6);
}

.system-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 2px;
    margin-top: 10px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.system-subtitle::before, .system-subtitle::after {
    content: '';
    width: 30px;
    height: 1px;
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
    width: 100%;
    margin-bottom: 50px;
    align-items: stretch;
}

.service-card {
    background: var(--card-bg);
    border: 1px solid var(--border-glow);
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    animation: floatingUI 6s ease-in-out infinite alternate;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.services-grid .service-card:nth-child(2) { animation-delay: -1.5s; }
.services-grid .service-card:nth-child(3) { animation-delay: -3s; }
.services-grid .service-card:nth-child(4) { animation-delay: -4.5s; }

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent, rgba(0, 195, 255, 0.05), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.service-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--primary);
    box-shadow: 0 0 30px rgba(0, 195, 255, 0.35), inset 0 0 15px rgba(0, 195, 255, 0.1);
}

.service-card:hover::before {
    transform: translateX(100%);
}

.card-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 15px;
    transition: transform 0.3s ease;
    text-shadow: 0 0 15px rgba(0, 195, 255, 0.6);
}

.service-card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
}

.card-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.card-desc {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 25px;
    line-height: 1.5;
}

.panel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 20px;
    background: transparent;
    border: 1px solid var(--primary);
    border-radius: 8px;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s ease;
    position: relative;
    margin-top: auto;
}

.panel-btn:hover {
    background: var(--primary);
    color: var(--bg);
    box-shadow: 0 0 20px var(--primary);
    transform: scale(1.03);
}

.panel-btn:active {
    transform: scale(0.98) cubic-bezier(0.19, 1, 0.22, 1);
}

.card-restricted {
    border-color: rgba(255, 0, 85, 0.3);
}
.card-restricted .card-icon {
    color: var(--accent);
    text-shadow: 0 0 15px rgba(255, 0, 85, 0.6);
}
.card-restricted .panel-btn {
    border-color: var(--accent);
    color: var(--accent);
}
.card-restricted .panel-btn:hover {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 20px var(--accent);
}
.card-restricted:hover {
    border-color: var(--accent);
    box-shadow: 0 0 30px rgba(255, 0, 85, 0.35), inset 0 0 15px rgba(255, 0, 85, 0.1);
}

.terminal-panel {
    width: 100%;
    max-width: 650px;
    background: var(--card-bg);
    border: 1px solid rgba(255, 208, 0, 0.25);
    border-radius: 12px;
    padding: 25px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    position: relative;
}

.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 208, 0, 0.15);
    padding-bottom: 10px;
}

.terminal-dots {
    display: flex;
    gap: 6px;
}
.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
}
.dot-red { background: var(--accent); }
.dot-yellow { background: var(--secondary); }
.dot-blue { background: var(--primary); }

.terminal-title {
    font-size: 0.8rem;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
}

.terminal-input-frame {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
    overflow: hidden;
    border-radius: 6px;
}

.terminal-textarea {
    width: 100%;
    height: 120px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 15px;
    color: #fff;
    font-size: 0.95rem;
    resize: none;
    outline: none;
    transition: border-color 0.3s;
}

.terminal-textarea:focus {
    border-color: var(--secondary);
    box-shadow: inset 0 0 10px rgba(255, 208, 0, 0.1);
}

.terminal-btn {
    border-color: var(--secondary);
    color: var(--secondary);
}
.terminal-btn:hover {
    background: var(--secondary);
    color: var(--bg);
    box-shadow: 0 0 20px var(--secondary);
}

.terminal-console-log {
    margin-top: 15px;
    font-size: 0.85rem;
    min-height: 24px;
    color: rgba(255, 255, 255, 0.4);
    font-family: monospace;
    display: flex;
    align-items: center;
    gap: 8px;
}

.log-success { color: #00ff66; text-shadow: 0 0 8px rgba(0, 255, 102, 0.4); }
.log-error { color: var(--accent); text-shadow: 0 0 8px rgba(255, 0, 85, 0.4); }

@keyframes nebulaShift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(5%, 5%) scale(1.05); }
}

@keyframes gridDrift {
    0% { background-position: 0 0; }
    100% { background-position: 0 1000px; }
}

@keyframes gridLinesFlash {
    0% { opacity: 0.45; }
    50% { opacity: 0.65; }
    100% { opacity: 0.45; }
}

@keyframes gridColorShift {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

@keyframes systemFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes floatingUI {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-6px); }
}

@keyframes breathingGlow {
    0% { box-shadow: 0 0 0px transparent; }
    100% { text-shadow: 0 0 15px rgba(0, 195, 255, 0.8), 0 0 25px rgba(0, 195, 255, 0.4); }
}

@keyframes titleFlicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% { opacity: 1; }
    20%, 24%, 55% { opacity: 0.7; text-shadow: none; }
}

@media (max-width: 768px) {
    .system-title { font-size: 2.8rem; }
    .services-grid { grid-template-columns: 1fr; }
    .dashboard-container { padding: 20px 15px; }
}