.pause-popup { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 1200; background: rgba(0,0,0,.5); }
.pause-popup.show { display: flex; }
.pause-content { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; padding: 1.25rem; width: 90%; max-width: 420px; color: var(--color-text-primary); position: relative; }
.pause-close-btn { position: absolute; top: .5rem; right: .5rem; background: transparent; border: none; color: var(--color-text-secondary); font-size: 1.5rem; cursor: pointer; }
.pause-actions { display: flex; gap: .75rem; justify-content: flex-end; margin-top: 1rem; }
.pause-btn { padding: .6rem 1rem; border-radius: 10px; border: 1px solid var(--color-border); background: var(--color-surface-light); color: var(--color-text-primary); cursor: pointer; }
.pause-primary { background: #6c63ff; border-color: #6c63ff; color: #fff; }
.pause-secondary { background: var(--color-surface-light); }
.code-input-container { margin-top: .75rem; }
.code-input { width: 100%; padding: .6rem .8rem; border-radius: 10px; border: 1px solid var(--color-border); background: var(--color-surface-light); color: var(--color-text-primary); }
.code-error { color: #ff6b6b; font-size: .9rem; margin-top: .5rem; }
.tw-pause { background: transparent; border: none; color: #9aa0ae; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.tw-pause:hover { color: #ffffff; }
/* --- Глобальные переменные для нового дизайна --- */
:root {
    --color-bg: #16181e;
    --color-surface: #20242c;
    --color-surface-light: #2c313a;
    --color-border: #3a404b;
    --color-text-primary: #f0f0f0;
    --color-text-secondary: #8a919f;
    --color-accent: #6c63ff;
    --color-accent-hover: #574fde;
    --color-success: #27c93f;
    --color-warning: #ffa726;
    --color-error: #ff6b6b;
    --border-radius: 12px;
    --transition-speed: 0.25s;
}

/* --- Переопределение базовых стилей --- */
body {
    background: var(--color-bg);
    color: var(--color-text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.tw-header {
    background: rgba(22, 24, 30, 0.9);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.brand {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--color-text-primary);
    text-decoration: none;
    user-select: none;
}

.brand span {
    color: var(--color-accent);
}

.header-nav a {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-speed);
}

.header-nav a:hover {
    color: var(--color-text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.balance-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--color-surface);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
}

.balance-display span:first-child {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.balance-display span:last-child {
    color: var(--color-success);
    font-weight: 600;
    font-size: 1rem;
}

.user-email {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-speed);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.btn-ghost:hover {
    background: var(--color-surface);
    color: var(--color-text-primary);
    border-color: var(--color-accent);
}

.btn-primary {
    background: var(--color-accent);
    color: white;
}

.btn-primary:hover {
    background: var(--color-accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* --- Основной контент --- */
.dashboard-main {
    padding: 2rem 0 5rem;
    min-height: calc(100vh - 80px);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0;
    color: var(--color-text-primary);
}

/* --- Сетка проектов --- */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr; /* по умолчанию 1 в ряд */
    gap: 1.55rem; /* увеличил расстояние между карточками */
    margin-bottom: 1.5rem;
    justify-content: center; /* центрируем дорожки */
}
@media (min-width: 1024px) { /* ПК: не более 2 в ряд */
    .projects-grid { grid-template-columns: repeat(3, minmax(280px, 320px)); gap: 1.5rem; }
}

.project-card {
    background: transparent; /* убираем внешний блок */
    border: none;
    border-radius: 0;
    padding: 0;
    transition: none;
    position: relative;
    overflow: visible;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}
.project-card::before { display: none; }
.project-card:hover { transform: none; box-shadow: none; border-color: transparent; }

/* Строка проекта: аватар ОС слева + контент */
.project-row { display: flex; align-items: center; gap: 12px; }
.os-avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.os-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.project-main { display: flex; flex-direction: column; }

/* Карточка в стиле tailwind-примера (без tailwind) */
.tw-card { width: 100%; max-width: 520px; background: #2c3243; border-radius: 1rem; padding: 1.25rem; box-shadow: 0 10px 24px rgba(0,0,0,.25); color: #fff; margin: 0 auto; }
.tw-top { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.tw-icon-wrap { position: relative; flex-shrink: 0; }
.tw-icon { width: 64px; height: 64px; background: #f06333; border-radius: 999px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.tw-icon img { width: 40px; height: 40px; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0,0,0,.3)); }
.tw-status-badge { position: absolute; top: -2px; right: -2px; width: 20px; height: 20px; background: #6c63ff; border-radius: 999px; border: 4px solid #2c3243; }
.tw-main { flex: 1 1 auto; min-width: 0; }
.tw-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.tw-title { font-size: 1.125rem; font-weight: 700; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tw-more { color: #9aa0ae; background: transparent; border: 0; font-size: 1.25rem; line-height: 1; cursor: pointer; }
.tw-more:hover { color: #fff; }
.tw-specs { color: #9aa0ae; font-size: .9rem; margin: .25rem 0 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tw-progress { width: 100%; background: #3e4559; height: 10px; border-radius: 999px; overflow: hidden; }
.tw-progress-bar { background: #63d391; height: 100%; width: 40%; border-radius: 999px; }

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-hover));
    transform: scaleX(0);
    transition: transform var(--transition-speed);
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
    border-color: var(--color-accent);
}

.project-card:hover::before {
    transform: scaleX(1);
}

.project-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: var(--color-text-primary);
    text-decoration: none;
}

.project-card p {
    color: var(--color-text-primary);
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
    text-decoration: none;
    font-size: 0.9rem;
}

/* Уменьшаем заголовок раздела для экономии места */
.section-title { font-size: 1.75rem; }

/* Более плотная верстка на небольших экранах */
@media (max-width: 1024px) {
  .projects-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; }
  .section-title { font-size: 1.5rem; }
}

.project-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.project-actions .btn {
    flex: 1;
    min-width: 120px;
}

/* Убираем подчеркивания у всех ссылок в карточках проектов */
.project-card a,
.project-card a:hover,
.project-card a:visited {
    text-decoration: none;
    color: var(--color-text-primary);
}

/* Убираем подчеркивания у всех текстов в карточках */
.project-card * {
    text-decoration: none;
}

/* Стили для всех статусов и текстов в dashboard */
.project-card .status-active,
.project-card .status-inactive,
.project-card .status-pending,
.project-card .status-error,
.project-card span,
.project-card strong,
.project-card div,
.project-card p,
.project-card h3,
.project-card h4,
.project-card h5,
.project-card h6 {
    color: var(--color-text-primary) !important;
    text-decoration: none !important;
}

/* Убираем все подчеркивания и делаем все тексты белыми */
.project-card *,
.projects-grid *,
.dashboard-main * {
    text-decoration: none !important;
}

/* --- Стили для статусов проектов --- */
.project-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--color-text-secondary);
    transition: all var(--transition-speed);
    flex-shrink: 0;
}

.status-dot.active {
    background-color: #1a8f3a;
    box-shadow: 0 0 6px rgba(26, 143, 58, 0.4);
}

.project-status span:last-child {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-status span:last-child:first-child {
    color: var(--color-text-secondary);
}

/* Специально для статусов */
.project-card [class*="status"] {
    color: var(--color-text-primary) !important;
    text-decoration: none !important;
}

/* Для всех span элементов */
.project-card span {
    color: var(--color-text-primary) !important;
    text-decoration: none !important;
}

/* Для всех strong элементов */
.project-card strong {
    color: var(--color-text-primary) !important;
    text-decoration: none !important;
}

/* Глобальные стили для всех текстов в dashboard */
.dashboard-main *,
.projects-grid *,
.project-card *,
.create-new-card * {
    color: var(--color-text-primary) !important;
    text-decoration: none !important;
}

/* Специально для всех возможных статусов */
[class*="status"],
[class*="Status"],
[class*="STATUS"] {
    color: var(--color-text-primary) !important;
    text-decoration: none !important;
}

/* Для всех текстовых элементов */
span, strong, div, p, h1, h2, h3, h4, h5, h6 {
    text-decoration: none !important;
}

/* Убираем все цветовые переопределения */
* {
    text-decoration: none !important;
}

/* Специально для всех цветовых классов */
.text-success,
.text-error,
.text-warning,
.text-info,
.text-primary,
.text-secondary,
.text-muted,
.text-danger,
.text-warning,
.text-info,
.text-light,
.text-dark,
.text-white,
.text-black,
.text-red,
.text-green,
.text-blue,
.text-yellow,
.text-purple,
.text-orange,
.text-pink,
.text-gray,
.text-grey {
    color: var(--color-text-primary) !important;
    text-decoration: none !important;
}

/* Для всех элементов с цветовыми атрибутами */
[style*="color"] {
    color: var(--color-text-primary) !important;
}

/* Принудительно делаем все тексты белыми */
body * {
    color: var(--color-text-primary) !important;
    text-decoration: none !important;
}

/* --- Карточка создания проекта --- */
.create-new-card {
    background: linear-gradient(135deg, var(--color-surface), var(--color-surface-light));
    border: 2px dashed var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.create-new-card:hover {
    border-color: var(--color-accent);
    background: linear-gradient(135deg, var(--color-surface-light), var(--color-surface));
    transform: translateY(-4px);
}

.create-new-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.icon-wrapper-large {
    width: 64px;
    height: 64px;
    background: var(--color-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
}

.create-new-card h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: var(--color-text-primary);
    text-decoration: none;
}

.create-new-card p {
    color: var(--color-text-primary);
    margin: 0;
    max-width: 200px;
    text-decoration: none;
}

/* --- Индикатор загрузки --- */
.loading-indicator {
    text-align: center;
    padding: 3rem;
    color: var(--color-text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-top: 3px solid var(--color-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Модальное окно --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

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

.modal-content {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--color-text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: var(--color-surface-light);
    color: var(--color-text-primary);
}

.modal-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    color: var(--color-text-primary);
}

.modal-content p {
    color: var(--color-text-secondary);
    margin: 0 0 2rem 0;
    line-height: 1.6;
}

/* --- Форма --- */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-input {
    background: var(--color-surface-light);
    border: 2px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
    font-size: 1rem;
    color: var(--color-text-primary);
    transition: all var(--transition-speed);
    outline: none;
}

.form-input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.2);
}

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

.form-error {
    color: var(--color-error);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.75rem;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: var(--border-radius);
    display: none;
}

.form-error.show {
    display: block;
}

label {
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
}

/* --- Бургер-меню --- */
.burger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 24px;
    height: 20px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    z-index: 101;
}

.burger span {
    width: 24px;
    height: 3px;
    background-color: var(--color-text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: 1px;
}

/* --- Адаптивность --- */
@media (max-width: 820px) {
    .header-right {
        display: none; /* Скрываем по умолчанию на мобильных */
    }

    .burger {
        display: flex;
    }
}

/* Стили для открытого меню */
.nav-open .header-right {
    display: flex;
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background: var(--color-surface);
    flex-direction: column;
    align-items: flex-start;
    padding: 6rem 2rem 2rem;
    gap: 1.5rem;
    z-index: 100;
    box-shadow: -5px 0 15px rgba(0,0,0,0.2);
    animation: slideInRight 0.3s ease-out;
    border-left: 1px solid var(--color-border);
}

/* Стили для элементов внутри открытого меню */
.nav-open .header-right .balance-display,
.nav-open .header-right .user-email,
.nav-open .header-right .btn {
    background: var(--color-surface-light);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
    width: 100%;
    box-sizing: border-box;
}

.nav-open .header-right .balance-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-open .header-right .user-email {
    text-align: center;
    font-weight: 600;
}

.nav-open .header-right .btn {
    text-align: center;
    justify-content: center;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.nav-open .burger {
    position: fixed;
    right: 1.5rem;
}

.nav-open .burger span:nth-child(1) {
    transform: rotate(45deg);
}

.nav-open .burger span:nth-child(2) {
    opacity: 0;
    transform: translateX(20px);
}

.nav-open .burger span:nth-child(3) {
    transform: rotate(-45deg);
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .header-inner {
        padding: 0 1rem;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .project-card {
        padding: 1.5rem;
    }
    
    .modal-content {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }
}

@media (max-width: 480px) {
    .header-right {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-end;
    }
    
    .balance-display {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .project-actions {
        flex-direction: column;
    }
    
    .project-actions .btn {
        width: 100%;
    }
} 