/* Основные стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ffffff;
    --secondary-color: #000000;
    --gray-100: #171717;
    --gray-200: #262626;
    --gray-300: #404040;
    --gray-400: #525252;
    --gray-500: #737373;
    --gray-600: #a3a3a3;
    --gray-700: #d4d4d4;
    --gray-800: #e5e5e5;
    --gray-900: #f5f5f5;
    --border-color: #404040;
    --shadow: 0 1px 3px rgba(255, 255, 255, 0.1);
    --shadow-md: 0 4px 6px rgba(255, 255, 255, 0.1);
    --shadow-lg: 0 10px 15px rgba(255, 255, 255, 0.1);
    --radius: 6px;
    --radius-lg: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--gray-800);
    background-color: var(--secondary-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--gray-800);
    border-color: var(--gray-800);
    color: var(--secondary-color);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--gray-700);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--gray-100);
    border-color: var(--gray-300);
    color: var(--gray-800);
}

.btn-small {
    padding: 4px 8px;
    font-size: 12px;
}

/* Типографика */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 8px;
}

h1 { font-size: 24px; }
h2 { font-size: 20px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }

/* Страница входа */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--gray-100) 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 32px;
    border: 1px solid var(--border-color);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 28px;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.login-header p {
    color: var(--gray-500);
    font-size: 14px;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.login-footer p {
    color: var(--gray-400);
    font-size: 12px;
}

/* Dashboard */
.dashboard-page {
    height: 100vh;
    overflow: hidden;
}

.dashboard-container {
    display: flex;
    height: 100%;
    position: relative;
}

/* Сайдбар */
.sidebar {
    width: 250px;
    background-color: var(--gray-100);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 50;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translateX(0);
}

/* Когда модал активен, сайдбар автоматически скрывается через JS */
body:has(.modal.active) .sidebar {
    pointer-events: none;
}

.sidebar.hidden {
    transform: translateX(-250px);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    min-height: 98px;
    flex-shrink: 0;
    background-color: var(--gray-100);
}

.sidebar-header * {
    pointer-events: auto;
}

.sidebar-title-section {
    flex: 1;
    pointer-events: none;
}

.sidebar-title-section h2,
.sidebar-title-section .version {
    pointer-events: auto;
}

.sidebar-header h2 {
    font-size: 18px;
    margin-bottom: 4px;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

.sidebar-header .version {
    color: #dc2626;
    font-size: 12px;
    font-weight: 600;
    transition: color 0.3s ease;
}

.sidebar-toggle {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: var(--gray-600);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    z-index: 60;
    min-width: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.sidebar-toggle:hover {
    background-color: var(--gray-200);
    color: var(--gray-800);
    transform: scale(1.1);
}

.sidebar-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.sidebar-logo:hover {
    transform: rotate(360deg);
}

.sidebar-logo svg {
    width: 60px;
    height: 60px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.sidebar-nav:hover {
    opacity: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--gray-600);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-left: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0.1), transparent);
    transition: width 0.3s ease;
}

.nav-item:hover::before {
    width: 100%;
}

.nav-item:hover {
    background-color: var(--gray-200);
    color: var(--gray-800);
    transform: translateX(5px);
}

.nav-item.active {
    background-color: var(--gray-200);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    transform: translateX(5px);
}

.nav-icon {
    margin-right: 12px;
    font-size: 16px;
    transition: transform 0.3s ease;
}

.nav-item:hover .nav-icon {
    transform: scale(1.2);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background-color: var(--gray-100);
}

/* Кнопка для показа скрытого сайдбара в header */
.header-sidebar-toggle {
    background: none;
    border: none;
    color: var(--gray-700);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    margin-right: 16px;
    opacity: 0;
    transform: translateX(-20px);
    z-index: 60;
}

.header-sidebar-toggle:not(.hidden) {
    opacity: 1;
    transform: translateX(0);
}

.header-sidebar-toggle:hover {
    background-color: var(--gray-200);
    color: var(--gray-800);
    transform: translateX(0) scale(1.1);
}

.header-sidebar-toggle.hidden {
    opacity: 0;
    transform: translateX(-20px);
    pointer-events: none;
}

/* DrainPanel info в header */
.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: auto;
    transition: all 0.3s ease;
}

.header-brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.header-brand-logo:hover {
    transform: rotate(180deg);
}

.header-brand-logo svg {
    width: 20px;
    height: 20px;
}

.header-brand-text h1 {
    font-size: 20px;
    margin-bottom: 0;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

.header-brand-version {
    color: #dc2626;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

/* Основной контент */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-left: 250px;
    transition: margin-left 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.dashboard-container:has(.sidebar.hidden) .main-content {
    margin-left: 0;
}

.content-header {
    padding: 20px 24px;
    background-color: var(--gray-100);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: padding-left 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.content-header h1 {
    font-size: 20px;
    margin-bottom: 0;
    color: var(--primary-color);
}

.wallet-count {
    font-size: 14px;
    color: var(--gray-500);
}

.wallet-count span {
    font-weight: 600;
    color: var(--gray-800);
}

.content-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background-color: var(--secondary-color);
    transition: all 0.3s ease;
}

/* Специальная кнопка "Добавить кошелек" */
#addReceiverWalletBtn {
    background: linear-gradient(135deg, #8B0000, #DC143C) !important;
    color: #ffffff !important;
    border: 1px solid rgba(139, 0, 0, 0.3) !important;
    box-shadow: 0 2px 8px rgba(139, 0, 0, 0.2) !important;
}

#addReceiverWalletBtn:hover {
    background: linear-gradient(135deg, #DC143C, #FF6347) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 15px rgba(139, 0, 0, 0.4) !important;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.item-count {
    font-size: 14px;
    color: #a3a3a3;
}

/* Адаптивность */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }
    
    .login-container {
        padding: 16px;
    }
    
    .login-card {
        padding: 24px;
    }
}

@media (max-width: 640px) {
    .sidebar {
        position: fixed;
        left: -250px;
        z-index: 1000;
        transition: left 0.3s ease;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .main-content {
        width: 100%;
    }
} 

/* Input help */
.input-help {
    margin-top: 6px;
    font-size: 12px;
    color: #9ca3af;
}

/* Стили для подсказок в формах */
.form-help {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #9ca3af;
    font-style: italic;
}

/* Приватный ключ - особый стиль */
input[type="password"][name="private_key"] {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    letter-spacing: 1px;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(64, 64, 64, 0.6);
}

input[type="password"][name="private_key"]:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
} 

/* Убеждаемся что модалы всегда выше сайдбара */
.modal {
    z-index: 1000 !important;
}

.modal.active {
    z-index: 1000 !important;
} 