/* ══════════════════════════════════════════
   MORENTY Design System
   Dark Cyberpunk / Hacker Aesthetic
   ══════════════════════════════════════════ */

:root {
    /* Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #0e0e16;
    --bg-card: rgba(255, 255, 255, 0.025);
    --bg-card-hover: rgba(255, 255, 255, 0.05);
    --bg-glass: rgba(20, 20, 35, 0.6);
    --accent: #e6193c;
    --accent-glow: #ff2d55;
    --accent-soft: rgba(230, 25, 60, 0.15);
    --green: #00ff88;
    --green-soft: rgba(0, 255, 136, 0.12);
    --yellow: #ffd600;
    --text-primary: #e8e8ee;
    --text-secondary: #8888a0;
    --text-muted: #555570;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(230, 25, 60, 0.3);

    /* Typography */
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing */
    --nav-height: 64px;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;

    /* Transitions */
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Matrix Canvas */
#matrix-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    opacity: 0.07;
    pointer-events: none;
}

/* Scanlines */
.scanlines {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.08) 2px,
        rgba(0, 0, 0, 0.08) 4px
    );
}

/* ── NAVIGATION ── */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-height);
    z-index: 1000;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px) saturate(1.4);
    border-bottom: 1px solid var(--border);
    transition: background 0.4s var(--ease);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    gap: 4px;
}

.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.3s var(--ease);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.nav-link.active {
    color: var(--accent);
    background: var(--accent-soft);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
}

.nav-link-icon {
    font-size: 1rem;
}

/* Nav Auth */
.nav-auth {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 4px 12px 4px 4px;
    border-radius: 30px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all 0.3s var(--ease);
}

.nav-user:hover { border-color: var(--border-hover); }

.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    object-fit: cover;
}

.nav-username {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Burger */
.nav-burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.nav-burger span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s var(--ease);
}

.nav-burger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-burger.active span:nth-child(2) { opacity: 0; }
.nav-burger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile Menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0; right: 0; bottom: 0;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    z-index: 999;
    padding: 24px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.4s var(--ease);
    pointer-events: none;
}

.mobile-menu.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.mobile-menu-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-menu-links .nav-link {
    font-size: 1.1rem;
    padding: 14px 20px;
}

/* ── PAGE CONTAINER ── */
.page-container {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    padding-top: var(--nav-height);
}

.page {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.page.active {
    opacity: 1;
    transform: translateY(0);
}

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s var(--ease);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 20px rgba(230, 25, 60, 0.3);
}

.btn-primary:hover {
    background: var(--accent-glow);
    box-shadow: 0 6px 30px rgba(230, 25, 60, 0.5);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.btn-ghost:hover {
    background: var(--accent-soft);
}

.btn-sm { padding: 8px 18px; font-size: 0.82rem; }
.btn-lg { padding: 16px 36px; font-size: 1rem; }

.btn-tg {
    background: #2AABEE;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(42, 171, 238, 0.3);
}

.btn-tg:hover {
    background: #1d9bd9;
    box-shadow: 0 6px 30px rgba(42, 171, 238, 0.5);
    transform: translateY(-2px);
}

/* ── CARDS ── */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(1.2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: all 0.4s var(--ease);
}

.glass-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 8px 40px rgba(230, 25, 60, 0.08);
    transform: translateY(-4px);
}

/* ── HERO ── */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--nav-height));
    text-align: center;
    padding: 60px 24px;
    position: relative;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid rgba(230, 25, 60, 0.2);
    border-radius: 30px;
    margin-bottom: 24px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.hero-badge .pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse-red 2s infinite;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 40px;
    line-height: 1.7;
}

.hero-typing {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--green);
    margin-bottom: 40px;
    min-height: 1.6em;
}

.hero-typing .cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: var(--green);
    margin-left: 2px;
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.hero-image {
    margin-top: 60px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 3px solid var(--accent);
    box-shadow: 0 0 40px rgba(230, 25, 60, 0.3), 0 0 80px rgba(230, 25, 60, 0.1);
    object-fit: cover;
    animation: float 6s ease-in-out infinite;
}

/* ── SECTIONS ── */
.section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 24px;
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ── GRID ── */
.grid {
    display: grid;
    gap: 24px;
}

.grid-2 { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ── SOFTWARE / CONTENT CARDS ── */
.content-card {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.4s var(--ease);
}

.content-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-6px);
    box-shadow: 0 12px 48px rgba(230, 25, 60, 0.1);
}

.content-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid var(--border);
}

.content-card-body {
    padding: 20px;
}

.content-card-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.content-card-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 16px;
    line-height: 1.6;
}

.content-card-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.tag {
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: 4px;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid rgba(230, 25, 60, 0.15);
}

.tag.green { background: var(--green-soft); color: var(--green); border-color: rgba(0, 255, 136, 0.15); }

.content-card-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── CABINET ── */
.cabinet-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 40px;
}

.cabinet-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid var(--accent);
    box-shadow: 0 0 30px rgba(230, 25, 60, 0.25);
    object-fit: cover;
}

.cabinet-info h2 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
}

.cabinet-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.cabinet-info .cabinet-id {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.license-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.3s var(--ease);
}

.license-card:hover { border-color: var(--border-hover); }

.license-name {
    font-weight: 600;
    font-size: 1rem;
}

.license-key {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-muted);
}

.license-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.license-status.active { background: var(--green-soft); color: var(--green); }
.license-status.expired { background: rgba(255, 60, 60, 0.12); color: #ff4444; }

/* ── TOAST ── */
.toast-container {
    position: fixed;
    top: calc(var(--nav-height) + 16px);
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    animation: slideInRight 0.4s var(--ease), fadeOut 0.4s var(--ease) 2.6s forwards;
    max-width: 360px;
}

.toast.success { background: rgba(0, 255, 136, 0.1); color: var(--green); border-color: rgba(0, 255, 136, 0.2); }
.toast.error { background: rgba(230, 25, 60, 0.1); color: var(--accent); border-color: rgba(230, 25, 60, 0.2); }
.toast.info { background: rgba(42, 171, 238, 0.1); color: #2AABEE; border-color: rgba(42, 171, 238, 0.2); }

/* ── EMPTY STATE ── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    text-align: center;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.empty-state-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ── DROPDOWN ── */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    backdrop-filter: blur(20px);
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: all 0.3s var(--ease);
    z-index: 100;
}

.dropdown-menu.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    font-size: 0.85rem;
    color: var(--text-primary);
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}

.dropdown-item:hover { background: var(--bg-card); }
.dropdown-item.danger { color: var(--accent); }

/* ── FORM ELEMENTS ── */
.form-group { margin-bottom: 20px; }

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: all 0.3s var(--ease);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-textarea { resize: vertical; min-height: 100px; }

/* Fix native select/option dropdown colors */
.form-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238888a0' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.form-select option {
    background: #1a1a2e;
    color: #e8e8ee;
    padding: 8px 12px;
}

.form-select option:checked,
.form-select option:hover {
    background: #e6193c;
    color: #fff;
}

/* Checkbox dark styling */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}

input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

/* File input dark styling */
input[type="file"] {
    font-family: var(--font-body);
    font-size: 0.82rem;
    color: var(--text-secondary);
}

input[type="file"]::file-selector-button {
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.82rem;
    cursor: pointer;
    margin-right: 10px;
    transition: all 0.2s;
}

input[type="file"]::file-selector-button:hover {
    background: var(--accent-soft);
    border-color: var(--border-hover);
}

/* Date input dark styling */
input[type="date"] {
    color-scheme: dark;
}

/* ── LOADING ── */
.loader {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

.loader-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-burger { display: flex; }
    .mobile-menu { display: block; }
    .hero-title { font-size: 2.2rem; }
    .hero-image { width: 140px; height: 140px; }
    .cabinet-header { flex-direction: column; text-align: center; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .hero-buttons { flex-direction: column; align-items: center; }
    .license-card { flex-direction: column; text-align: center; }
    .nav-auth { display: none; }
    .section { padding: 40px 16px; }
}

@media (max-width: 480px) {
    .hero { padding: 40px 16px; }
    .hero-title { font-size: 1.8rem; }
}
