@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #ec4899;
    --accent: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --bg-primary: #0a0a0f;
    --bg-secondary: #13131a;
    --bg-tertiary: #1a1a24;
    --bg-elevated: #1f1f2e;
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --text-tertiary: #6b7280;
    --border: #27272f;
    --border-light: #2d2d38;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.6);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.gradient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: 
        radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(236, 72, 153, 0.05) 0%, transparent 50%);
    animation: gradientShift 20s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(19, 19, 26, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(19, 19, 26, 0.95);
    box-shadow: var(--shadow-lg);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    object-fit: cover;
    transition: transform 0.3s ease;
}

.brand-logo:hover {
    transform: scale(1.05) rotate(5deg);
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-elevated);
    border-color: var(--primary);
}

.btn-large {
    padding: 1.125rem 2.5rem;
    font-size: 1.125rem;
    border-radius: var(--radius-lg);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-md);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.hero {
    text-align: center;
    padding: 8rem 2rem;
    position: relative;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 50px;
    color: var(--primary-light);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease;
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 5.5rem);
    font-weight: 900;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    letter-spacing: -0.04em;
    animation: fadeInUp 0.8s ease 0.1s both;
}

.highlight {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1.125rem, 3vw, 1.5rem);
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.hero .btn-large {
    animation: fadeInUp 0.8s ease 0.3s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

#purchase-message {
    transition: all 0.3s ease;
    border: 2px solid var(--border);
}

#purchase-message:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}


.dashboard {
    min-height: 100vh;
}

.dashboard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(19, 19, 26, 0.7);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.dashboard-nav > div {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.user-info:hover {
    background: var(--bg-elevated);
    border-color: var(--primary);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

.dashboard-content {
    display: flex;
    min-height: calc(100vh - 73px);
}

.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 1.5rem 0;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.sidebar-header h3 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
}

.sidebar-item {
    padding: 0.875rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.875rem;
    position: relative;
}

.sidebar-item svg {
    width: 20px;
    height: 20px;
    transition: transform 0.2s ease;
}

.sidebar-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar-item:hover svg {
    transform: translateX(3px);
}

.sidebar-item.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.15), transparent);
    color: var(--primary-light);
    border-left: 3px solid var(--primary);
}

.sidebar-item.active svg {
    color: var(--primary);
}

.main-content {
    flex: 1;
    padding: 2.5rem;
    overflow-y: auto;
    background: var(--bg-primary);
}

section {
    display: none;
    animation: fadeIn 0.4s ease;
}

section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

section h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    letter-spacing: -0.03em;
}

#products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.product-card:hover::before {
    transform: scaleX(1);
}

.product-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.2);
}

.product-image {
    width: 100%;
    height: 240px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-card-content {
    padding: 1.5rem;
}

.product-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.product-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.product-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-light);
    margin-bottom: 1rem;
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.product-price span {
    font-size: 1.125rem;
    font-weight: 600;
}

input, textarea, select {
    width: 100%;
    padding: 0.875rem 1rem;
    margin-bottom: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-elevated);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.tickets-container {
    display: grid;
    gap: 1rem;
}

.ticket-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ticket-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.ticket-item:hover::before {
    transform: scaleY(1);
}

.ticket-item:hover {
    border-color: var(--primary);
    transform: translateX(8px);
    box-shadow: var(--shadow-lg);
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.ticket-id {
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--text-primary);
}

.ticket-status {
    padding: 0.375rem 0.875rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ticket-status.open {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.ticket-status.closed {
    background: rgba(107, 114, 128, 0.15);
    color: var(--text-tertiary);
    border: 1px solid rgba(107, 114, 128, 0.3);
}

.ticket-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.75rem;
}

.ticket-product {
    color: var(--primary-light);
    font-weight: 500;
}

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    align-items: stretch;
    justify-content: stretch;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--bg-secondary);
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: none;
    border-radius: 0;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.modal-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    background: transparent;
}

.modal-close:hover {
    background: var(--bg-elevated);
    color: var(--error);
    transform: rotate(90deg);
}

.modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-primary);
}

.messages-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow-y: auto;
    padding: 1.5rem 2rem;
    scroll-behavior: smooth;
}

.message-item {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 1rem;
    margin-bottom: 0.25rem;
    transition: background 0.1s ease;
    position: relative;
}

.message-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.message-avatar:hover {
    transform: scale(1.1);
}

.message-content-wrapper {
    flex: 1;
    min-width: 0;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.message-author {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: color 0.1s ease;
}

.message-author:hover {
    text-decoration: underline;
}

.message-author.admin {
    color: var(--secondary);
}

.admin-badge {
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    color: white;
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-left: 0.5rem;
}

.message-content {
    color: var(--text-primary);
    line-height: 1.5;
    word-wrap: break-word;
    font-size: 0.95rem;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

.message-content img.emoji {
    width: 1.375rem;
    height: 1.375rem;
    margin: 0 0.05rem;
    vertical-align: -0.4rem;
}

.message-form {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--bg-secondary);
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.message-form textarea {
    min-height: 60px;
    max-height: 200px;
    margin-bottom: 1rem;
    resize: vertical;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

.message-form textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.message-form-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    position: relative;
}

.emoji-picker-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.emoji-picker-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--primary);
    transform: scale(1.1);
}

.emoji-picker {
    display: none;
    position: absolute;
    bottom: calc(100% + 0.5rem);
    left: 0;
    background: var(--bg-elevated);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.75rem;
    width: 300px;
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    z-index: 10000;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
}

.emoji-picker.active {
    display: grid;
    animation: fadeIn 0.2s ease;
}

.emoji-picker::-webkit-scrollbar {
    width: 8px;
}

.emoji-picker::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

.emoji-picker::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.emoji-picker::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.emoji-item {
    cursor: pointer;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem;
    transition: all 0.15s ease;
    border-radius: 6px;
    user-select: none;
    width: 100%;
    height: 38px;
}

.emoji-item:hover {
    transform: scale(1.25);
    background: var(--bg-tertiary);
    z-index: 1;
}

.admin-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
}

.admin-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    z-index: 10000;
    box-shadow: var(--shadow-xl);
    animation: slideInRight 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 400px;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
}

.notification.error {
    background: linear-gradient(135deg, var(--error), #dc2626);
    color: white;
}

.notification.info {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

input, textarea, .message-content {
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
}

@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    
    #products-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 1rem 1.5rem;
        justify-content: center;
    }
    
    .navbar .btn-primary {
        display: none;
    }
    
    .nav-brand {
        margin: 0 auto;
    }
    
    .hero {
        padding: 4rem 1.5rem;
    }
    
    .dashboard-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 1rem 0;
    }
    
    .sidebar-item {
        padding: 0.75rem 1rem;
    }
    
    .main-content {
        padding: 1.5rem;
    }
    
    #products-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .messages-container {
        padding: 1rem;
    }
    
    .message-form {
        padding: 1rem;
    }
    
    .dashboard-nav {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .dashboard-nav > div {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {

        font-size: 1rem;
