/*
 * نیوورا - سیستم طراحی یکپارچه
 * Nivora Design System v2.0
 * Professional & Elegant Theme
 */

/* ===== FONT FACES ===== */
@font-face {
    font-family: 'Yekan';
    src: url('../../fonts/YekanBakh-Light.ttf') format('truetype');
    font-weight: 300;
}
@font-face {
    font-family: 'Yekan';
    src: url('../../fonts/YekanBakhRegular.ttf') format('truetype');
    font-weight: 400;
}
@font-face {
    font-family: 'Yekan';
    src: url('../../fonts/YekanBakh-Medium.ttf') format('truetype');
    font-weight: 500;
}
@font-face {
    font-family: 'Yekan';
    src: url('../../fonts/YekanBakh-Bold.ttf') format('truetype');
    font-weight: 700;
}
@font-face {
    font-family: 'Yekan';
    src: url('../../fonts/YekanBakh-Fat.ttf') format('truetype');
    font-weight: 900;
}

/* ===== CSS VARIABLES ===== */
:root {
    /* Primary - Indigo */
    --primary: #6366F1;
    --primary-dark: #4F46E5;
    --primary-light: #818CF8;
    --primary-bg: rgba(99, 102, 241, 0.1);
    
    /* Secondary - Sky Blue */
    --secondary: #0EA5E9;
    --secondary-dark: #0284C7;
    --secondary-light: #38BDF8;
    --secondary-bg: rgba(14, 165, 233, 0.1);
    
    /* Accent - Amber */
    --accent: #F59E0B;
    --accent-dark: #D97706;
    --accent-light: #FBBF24;
    --accent-bg: rgba(245, 158, 11, 0.1);
    
    /* Success - Emerald */
    --success: #10B981;
    --success-dark: #059669;
    --success-light: #34D399;
    --success-bg: rgba(16, 185, 129, 0.1);
    
    /* Danger - Rose */
    --danger: #EF4444;
    --danger-dark: #DC2626;
    --danger-light: #F87171;
    --danger-bg: rgba(239, 68, 68, 0.1);
    
    /* Purple - Violet */
    --purple: #8B5CF6;
    --purple-dark: #7C3AED;
    --purple-light: #A78BFA;
    --purple-bg: rgba(139, 92, 246, 0.1);
    
    /* Neutrals - Slate */
    --bg: #F8FAFC;
    --surface: #FFFFFF;
    --surface-hover: #F1F5F9;
    --text: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --text-light: #CBD5E1;
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    
    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
    --shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.12);
    --shadow-xl: 0 24px 60px rgba(15, 23, 42, 0.16);
    
    /* Sizing */
    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    --max-width: 480px;
    
    /* Animation */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --transition: all 0.2s var(--ease);
}

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

html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Yekan', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ===== APP CONTAINER ===== */
.app {
    width: 100%;
    max-width: var(--max-width);
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg);
    position: relative;
    overflow-x: hidden;
}

/* ===== HEADER ===== */
.header {
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.header-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.header-secondary {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
}

.header-accent {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

.header-purple {
    background: linear-gradient(135deg, var(--purple), var(--purple-dark));
}

.header-success {
    background: linear-gradient(135deg, var(--success), var(--success-dark));
}

.header-extended {
    padding-bottom: 100px;
}

.header-medium {
    padding-bottom: 70px;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.header-title {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

/* ===== ICON BUTTONS ===== */
.icon-btn,
.back-btn {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.08);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}

.icon-btn:hover,
.back-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

.icon-btn svg,
.back-btn svg {
    width: 20px;
    height: 20px;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: var(--danger);
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), var(--success-dark));
    color: #fff;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-bg);
}

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.15);
}

.btn svg {
    width: 20px;
    height: 20px;
}

.btn:disabled,
.btn.disabled {
    background: var(--text-muted);
    box-shadow: none;
    pointer-events: none;
    opacity: 0.6;
}

/* ===== CARDS ===== */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow);
}

.card-floating {
    margin: -70px 16px 20px;
    position: relative;
    z-index: 10;
    box-shadow: var(--shadow-lg);
    border: none;
}

.card-floating-sm {
    margin-top: -50px;
}

/* ===== CONTENT ===== */
.content {
    padding: 0 16px 100px;
}

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

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

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
    background: var(--surface);
    color: var(--text);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-bg);
}

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

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    pointer-events: none;
}

.input-wrapper .form-input {
    padding-right: 46px;
}

/* ===== BOTTOM NAVIGATION ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--max-width);
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 8px 16px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0));
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-muted);
    transition: var(--transition);
}

.nav-item.active {
    color: var(--primary);
}

.nav-item:hover {
    color: var(--primary);
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

.nav-label {
    font-size: 11px;
    font-weight: 500;
}

/* ===== FAB ===== */
.fab {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    z-index: 101;
    border: none;
}

.fab:hover {
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.5);
}

.fab svg {
    width: 26px;
    height: 26px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    background: var(--surface-hover);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.empty-state-icon svg {
    width: 40px;
    height: 40px;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-muted);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.4s var(--ease);
}

/* ===== RESPONSIVE ===== */
@media (min-width: 540px) {
    .app {
        margin: 16px auto;
        border-radius: var(--radius-lg);
        min-height: calc(100vh - 32px);
        min-height: calc(100dvh - 32px);
        box-shadow: var(--shadow-xl);
        border: 1px solid var(--border-light);
    }
    
    .header {
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
    
    .bottom-nav {
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    }
}

@media (max-width: 359px) {
    .header-title {
        font-size: 18px;
    }
    
    .btn {
        padding: 12px 20px;
    }
    
    .content {
        padding: 0 12px 90px;
    }
}

/* ===== UTILITIES ===== */
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 700; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }
