/**
 * Enjyn Tree - Global Styles
 * Premium Linktree SaaS
 */

@import url('https://fonts.eg-core.de/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Nasalization Font */
@import url('https://fonts.eg-core.de/custom/nasalization.css');

:root {
    --primary: #0a0a10;
    --secondary: #12121a;
    --tertiary: #1a1a24;
    --accent: #a855f7;
    --accent-light: #c084fc;
    --accent-dark: #7c3aed;
    --accent-glow: rgba(168, 85, 247, 0.4);
    --text: #ffffff;
    --text-muted: #9898a8;
    --text-dim: #6b6b7a;
    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;
    --border: rgba(255, 255, 255, 0.1);
    --border-light: rgba(255, 255, 255, 0.15);
    --glass: rgba(255, 255, 255, 0.05);
    --glass-hover: rgba(255, 255, 255, 0.1);
}

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

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--primary);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Effects */
.bg-liquid {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
}

.blob-1 {
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 50%, #6366f1 100%);
    top: -150px;
    left: -100px;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #c084fc 0%, #a855f7 50%, #8b5cf6 100%);
    bottom: -100px;
    right: -80px;
    animation-delay: -7s;
    animation-duration: 25s;
}

.blob-3 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #818cf8 0%, #a855f7 100%);
    top: 40%;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: -14s;
    animation-duration: 22s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(20px, 10px) scale(1.02); }
}

.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.025;
    pointer-events: none;
    z-index: 1;
}

/* Container */
.container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 28px 20px 16px;
}

.container-wide {
    max-width: 900px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Nasalization', 'Inter', sans-serif;
    font-weight: normal;
}

.brand-name {
    font-family: 'Nasalization', sans-serif;
    font-size: 24px;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #fff, rgba(255,255,255,0.8));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Logo */
.logo {
    width: 72px;
    height: 72px;
    margin: 0 auto 14px;
    background: linear-gradient(145deg, rgba(168, 85, 247, 0.3), rgba(124, 58, 237, 0.2));
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Nasalization', sans-serif;
    font-size: 30px;
    color: #fff;
    position: relative;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(168, 85, 247, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.logo::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.15), transparent);
    border-radius: 22px 22px 0 0;
}

.logo-sm {
    width: 48px;
    height: 48px;
    font-size: 20px;
    border-radius: 14px;
}

/* Avatar */
.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.avatar-sm {
    width: 40px;
    height: 40px;
    border-width: 2px;
}

.avatar-lg {
    width: 100px;
    height: 100px;
    border-width: 4px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 14px;
    font-family: 'Nasalization', sans-serif;
    font-size: 14px;
    letter-spacing: 0.5px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    box-shadow: 0 8px 32px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(168, 85, 247, 0.5);
}

.btn-secondary {
    background: var(--glass);
    color: var(--text);
    border: 1px solid var(--border-light);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: var(--glass-hover);
    border-color: var(--accent);
}

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

.btn-outline:hover {
    background: rgba(168, 85, 247, 0.1);
}

.btn-sm {
    padding: 10px 20px;
    font-size: 12px;
}

.btn-lg {
    padding: 18px 36px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Cards */
.card {
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent);
    border-radius: 20px 20px 0 0;
    pointer-events: none;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 18px;
    color: var(--text);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    transition: all 0.3s ease;
}

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

.form-input::placeholder {
    color: var(--text-dim);
}

.form-input.is-valid {
    border-color: var(--success);
}

.form-input.is-invalid {
    border-color: var(--error);
}

.form-helper {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 6px;
}

.form-error {
    font-size: 12px;
    color: var(--error);
    margin-top: 6px;
}

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

/* Link Items */
.link-item {
    display: block;
    text-decoration: none;
    color: var(--text);
    position: relative;
    border-radius: 16px;
    padding: 14px 20px;
    font-family: 'Nasalization', sans-serif;
    font-size: 13px;
    letter-spacing: 0.5px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    margin-bottom: 10px;
}

.link-item::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent);
    border-radius: 16px 16px 0 0;
    pointer-events: none;
}

.link-item:hover {
    transform: translateY(-2px) scale(1.02);
    border-color: rgba(168, 85, 247, 0.4);
    box-shadow: 0 12px 40px rgba(168, 85, 247, 0.2), 0 0 0 1px rgba(168, 85, 247, 0.3);
}

.link-item.primary {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.35), rgba(124, 58, 237, 0.25));
    border: 1px solid rgba(168, 85, 247, 0.4);
    box-shadow: 0 8px 32px rgba(168, 85, 247, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.link-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.link-icon {
    font-size: 16px;
}

/* Social Icons */
.social-icons {
    display: flex;
    justify-content: center;
    gap: 14px;
    padding: 20px 0;
}

.social-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-icon:hover {
    background: rgba(168, 85, 247, 0.25);
    border-color: rgba(168, 85, 247, 0.4);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(168, 85, 247, 0.25);
}

.social-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--warning);
}

/* Price Tag */
.price-tag {
    font-family: 'Nasalization', sans-serif;
    font-size: 48px;
    color: var(--text);
    text-align: center;
    margin: 20px 0;
}

.price-tag .currency {
    font-size: 24px;
    vertical-align: super;
}

.price-tag .once {
    display: block;
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Feature List */
.feature-list {
    list-style: none;
    padding: 0;
    margin: 24px 0;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
}

.feature-list li:last-child {
    border-bottom: none;
}

.feature-list .check {
    width: 24px;
    height: 24px;
    background: rgba(34, 197, 94, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--success);
    flex-shrink: 0;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 250px 1fr;
    }
}

/* Sidebar */
.sidebar {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--glass-hover);
    color: var(--text);
}

.sidebar-nav a.active {
    color: var(--accent-light);
    border-left: 2px solid var(--accent);
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}

.table tbody tr:hover {
    background: var(--glass);
}

/* Link Manager */
.link-manager {
    margin-top: 20px;
}

.link-manager-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 10px;
}

.link-manager-item .handle {
    cursor: grab;
    color: var(--text-dim);
}

.link-manager-item .link-info {
    flex: 1;
}

.link-manager-item .link-title {
    font-weight: 500;
    margin-bottom: 2px;
}

.link-manager-item .link-url {
    font-size: 12px;
    color: var(--text-muted);
}

.link-manager-item .link-actions {
    display: flex;
    gap: 8px;
}

.link-manager-item .link-actions button {
    padding: 8px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.link-manager-item .link-actions button:hover {
    background: var(--glass-hover);
    color: var(--text);
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--text-dim);
    font-size: 12px;
}

.footer a {
    color: var(--text-muted);
    text-decoration: none;
}

.footer a:hover {
    color: var(--accent-light);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse {
    0%, 100% { 
        box-shadow: 0 8px 32px var(--accent-glow); 
    }
    50% { 
        box-shadow: 0 8px 48px rgba(168, 85, 247, 0.6); 
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out;
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease-out;
}

.animate-fade-in-down {
    animation: fadeInDown 0.5s ease-out;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 20px 16px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 13px;
    }
    
    .card {
        padding: 20px;
    }
    
    .price-tag {
        font-size: 40px;
    }
}

/* Safe Area for mobile */
@supports (padding: max(0px)) {
    .container {
        padding-top: max(28px, env(safe-area-inset-top) + 12px);
    }
    .footer {
        padding-bottom: max(20px, env(safe-area-inset-bottom) + 8px);
    }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    max-width: 450px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
}

.modal-close:hover {
    color: var(--text);
}

/* Toggle Switch */
.toggle {
    position: relative;
    width: 50px;
    height: 26px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--tertiary);
    border: 1px solid var(--border);
    border-radius: 26px;
    transition: 0.3s;
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: 0.3s;
}

.toggle input:checked + .toggle-slider {
    background: var(--accent);
    border-color: var(--accent);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(24px);
    background: white;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    text-align: center;
}

.stat-value {
    font-family: 'Nasalization', sans-serif;
    font-size: 28px;
    color: var(--accent-light);
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}
