:root {
    --primary-color: #8B5CF6;
    --primary-dark: #6D28D9;
    --primary-light: #A78BFA;
    --bg-dark: #0F0F23;
    --bg-card: #1A1A3E;
    --bg-hover: #252550;
    --text-primary: #FFFFFF;
    --text-secondary: #B4B4D4;
    --text-muted: #6B6B8F;
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    --border: #2D2D5A;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.app-container {
    min-height: 100vh;
    max-width: 100%;
    margin: 0 auto;
    padding-bottom: 20px;
}

/* Header */
.header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-icons {
    display: flex;
    gap: 15px;
}

.icon-btn, .back-btn {
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    transition: all 0.3s;
    background: transparent;
    border: none;
    cursor: pointer;
}

.icon-btn:hover, .back-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Main Content */
.main-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

/* Active Order */
.active-order-container {
    margin-bottom: 30px;
}

.active-order-card {
    border-left: 4px solid var(--primary-color);
}

.active-order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.active-order-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.status-badge {
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.pending {
    background: var(--warning);
    color: #000;
}

.status-badge.confirmed {
    background: var(--primary-color);
    color: #fff;
}

.status-badge.completed {
    background: var(--success);
    color: #fff;
}

.status-badge.cancelled {
    background: var(--error);
    color: #fff;
}

.active-order-info {
    color: var(--text-secondary);
    margin-bottom: 15px;
}

/* Action Buttons */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.action-btn {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 25px 20px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.action-btn:hover {
    border-color: var(--primary-color);
    background: var(--bg-hover);
    transform: translateY(-2px);
}

.action-btn svg {
    color: var(--primary-color);
}

.buy-btn:hover svg {
    color: var(--success);
}

.sell-btn:hover svg {
    color: var(--error);
}

.mixer-btn:hover svg {
    color: var(--primary-light);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-danger {
    background: var(--error);
    color: white;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
}

.modal {
    background: var(--bg-card);
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border);
    position: relative;
    z-index: 1001;
    pointer-events: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 28px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s;
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Order Detail */
.order-detail-container {
    margin-bottom: 20px;
}

.order-info-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.order-info-item:last-child {
    border-bottom: none;
}

.order-info-label {
    color: var(--text-secondary);
}

.order-info-value {
    font-weight: 600;
}

/* Messages */
.order-messages {
    margin-bottom: 20px;
}

.message {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 10px;
    max-width: 80%;
}

.message.user {
    background: var(--primary-color);
    margin-left: auto;
    text-align: right;
}

.message.admin {
    background: var(--bg-hover);
}

.message-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 5px;
}

/* Order Actions */
.order-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Support */
.support-container {
    margin-top: 20px;
}

.support-tickets-list {
    margin-bottom: 30px;
}

.ticket-item {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.3s;
}

.ticket-item:hover {
    border-color: var(--primary-color);
    background: var(--bg-hover);
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.ticket-subject {
    font-weight: 600;
    font-size: 16px;
}

.ticket-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: var(--text-muted);
}

.support-form-container {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border);
    margin-top: 20px;
}

.support-form-container h3 {
    margin-bottom: 20px;
    font-size: 18px;
    color: var(--text-primary);
}

.support-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.support-form input[type="text"],
.support-form textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s;
}

.support-form input[type="text"]:focus,
.support-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.support-form textarea {
    resize: vertical;
    min-height: 120px;
}

/* Modal form styles */
.modal-footer form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-footer textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
}

.modal-footer textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 480px) {
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .main-content {
        padding: 15px;
    }
}

