/* Reset и базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #222222;
    color: #f0f0f0;
    line-height: 1.6;
}

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

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

.login-card {
    background: #2a2a2a;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-title {
    font-size: 28px;
    font-weight: 300;
    text-align: center;
    margin-bottom: 30px;
    color: #f0f0f0;
    letter-spacing: -0.5px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #cccccc;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #444444;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #333333;
    color: #f0f0f0;
}

.input-group input:focus {
    outline: none;
    border-color: #666666;
    box-shadow: 0 0 0 3px rgba(102, 102, 102, 0.1);
}

.login-btn {
    background: linear-gradient(135deg, #444444 0%, #222222 100%);
    color: #f0f0f0;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.error-message {
    margin-top: 20px;
    padding: 12px;
    background: #442222;
    border: 1px solid #663333;
    border-radius: 6px;
    color: #ff9999;
    text-align: center;
    font-size: 14px;
}

/* Основной интерфейс */
.dashboard-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #222222;
}

.dashboard-header {
    background: #2a2a2a;
    border-bottom: 1px solid #444444;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.dashboard-header h1 {
    font-size: 24px;
    font-weight: 300;
    color: #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

#current-id-display {
    font-weight: 500;
    color: #aaaaaa;
}

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

.logout-btn, .back-btn {
    padding: 8px 16px;
    background: #333333;
    color: #cccccc;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logout-btn:hover, .back-btn:hover {
    background: #444444;
    color: #ffffff;
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Боковое меню */
.sidebar {
    width: 320px;
    background: #2a2a2a;
    border-right: 1px solid #444444;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 25px;
    border-bottom: 1px solid #444444;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 15px;
    color: #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.add-id-form {
    display: flex;
    gap: 8px;
}

.add-id-form input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #444444;
    border-radius: 6px;
    font-size: 14px;
    background: #333333;
    color: #f0f0f0;
}

.add-id-form button {
    padding: 10px 16px;
    background: #333333;
    border: 1px solid #444444;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    color: #cccccc;
    min-width: 44px;
}

.add-id-form button:hover {
    background: #444444;
}

.quick-copy {
    display: flex;
    justify-content: flex-end;
}

.quick-copy button {
    padding: 8px 12px;
    background: #333333;
    border: 1px solid #444444;
    border-radius: 6px;
    cursor: pointer;
    color: #cccccc;
    font-size: 14px;
}

.quick-copy button:hover {
    background: #444444;
}

.id-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
}

.id-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 25px;
    border-left: 3px solid transparent;
    transition: background 0.2s;
    cursor: pointer;
}

.id-item:hover {
    background: #333333;
}

.id-item.active {
    background: #333333;
    border-left-color: #666666;
}

.id-link {
    flex: 1;
    color: #cccccc;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.id-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.id-item:hover .id-actions {
    opacity: 1;
}

.copy-id-btn, .delete-id-btn {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 6px;
    color: #888888;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-id-btn:hover {
    background: #444444;
    color: #cccccc;
}

.delete-id-btn:hover {
    background: #442222;
    color: #ff6666;
}

/* Основная область контента */
.content-area {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background: #222222;
}

.welcome-message {
    max-width: 600px;
    margin: 40px auto;
    text-align: center;
    color: #aaaaaa;
}

.welcome-message h2 {
    font-size: 28px;
    font-weight: 300;
    margin-bottom: 20px;
    color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Форма добавления заметки */
.add-note-form {
    margin-bottom: 40px;
}

.add-note-form textarea {
    width: 100%;
    padding: 20px;
    border: 1px solid #444444;
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    background: #333333;
    color: #f0f0f0;
}

.add-note-form textarea:focus {
    outline: none;
    border-color: #666666;
    box-shadow: 0 0 0 3px rgba(102, 102, 102, 0.1);
}

.add-note-btn {
    margin-top: 15px;
    padding: 14px 28px;
    background: linear-gradient(135deg, #444444 0%, #222222 100%);
    color: #f0f0f0;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.add-note-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* Список заметок */
.notes-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.note-card {
    background: #2a2a2a;
    border: 1px solid #444444;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.note-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

.note-content {
    padding: 25px;
}

.variant-block {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #333333;
    position: relative;
}

.variant-block:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.variant-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333333;
}

.variant-title {
    font-size: 14px;
    font-weight: 500;
    color: #888888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.variant-actions {
    display: flex;
    gap: 8px;
}

.variant-content {
    font-size: 15px;
    line-height: 1.7;
    color: #cccccc;
    white-space: pre-wrap;
    margin-bottom: 15px;
}

.variant-footer {
    display: flex;
    justify-content: flex-end;
}

.copy-variant-btn {
    padding: 8px 16px;
    background: #333333;
    border: 1px solid #444444;
    border-radius: 6px;
    font-size: 14px;
    color: #cccccc;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.copy-variant-btn:hover {
    background: #444444;
    color: #ffffff;
}

.note-actions {
    padding: 15px 25px;
    background: #333333;
    border-top: 1px solid #444444;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.note-date {
    font-size: 13px;
    color: #888888;
    display: flex;
    align-items: center;
    gap: 8px;
}

.delete-note-btn {
    padding: 8px 16px;
    background: #442222;
    color: #ff6666;
    border: 1px solid #663333;
    border-radius: 6px;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.delete-note-btn:hover {
    background: #663333;
}

/* Удаленные заметки */
.deleted-notes {
    margin-top: 40px;
    padding: 25px;
    background: #332211;
    border: 1px solid #664422;
    border-radius: 12px;
    animation: fadeIn 0.3s ease;
}

.deleted-notes h3 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 15px;
    color: #cc8833;
    display: flex;
    align-items: center;
    gap: 10px;
}

.deleted-note {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #664422;
    animation: slideIn 0.3s ease;
}

.deleted-note:last-child {
    border-bottom: none;
}

.deleted-content {
    flex: 1;
    font-size: 14px;
    color: #aaaaaa;
    padding-right: 15px;
}

.deleted-actions {
    display: flex;
    gap: 10px;
}

.restore-btn {
    padding: 6px 12px;
    background: #336633;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.restore-btn:hover {
    background: #448844;
}

.countdown-timer {
    padding: 4px 8px;
    background: rgba(204, 136, 51, 0.1);
    border-radius: 4px;
    font-size: 12px;
    color: #cc8833;
}

/* Пустое состояние */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #888888;
    font-size: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.empty-state i {
    font-size: 48px;
    color: #555555;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #888888;
}

.loading i {
    font-size: 24px;
    margin-bottom: 10px;
    color: #888888;
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-10px);
        opacity: 0;
    }
}

.slide-out {
    animation: slideOut 0.3s ease forwards;
}

/* Уведомления */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    background: #336633;
    color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 300px;
}

.notification.error {
    background: #662222;
}

.notification.info {
    background: #224466;
}

.notification.warning {
    background: #664422;
}

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

/* Адаптивность */
@media (max-width: 1024px) {
    .sidebar {
        width: 280px;
    }
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #444444;
        max-height: 300px;
    }
    
    .id-list {
        max-height: 200px;
    }
    
    .content-area {
        padding: 20px;
    }
}

/* Добавить в существующий CSS */
.variant-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.delete-variant-btn {
    padding: 6px 12px;
    background: #442222;
    color: #ff6666;
    border: 1px solid #663333;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.delete-variant-btn:hover {
    background: #663333;
}

.countdown-timer {
    padding: 4px 8px;
    background: rgba(204, 136, 51, 0.1);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #cc8833;
    min-width: 20px;
    text-align: center;
}