* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.main-content {
    padding: 30px;
}

.controls {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(86, 171, 47, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 107, 107, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(108, 117, 125, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(243, 156, 18, 0.3);
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-mini {
    padding: 4px 8px;
    font-size: 0.75rem;
}

.forums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
}

.forum-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.forum-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.forum-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.forum-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.forum-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.forum-url {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

.forum-stats {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f4f8 100%);
    border-radius: 10px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

.stat-label {
    font-size: 0.8rem;
    color: #666;
    margin-top: 2px;
}

.forum-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Стили для деталей форума */
#forumDetailsContainer {
    display: none;
}

.forum-details {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.forum-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.forum-details-header h2 {
    font-size: 2rem;
    color: #333;
    margin: 0;
}

.forum-details-url {
    color: #667eea;
    text-decoration: none;
    font-size: 1rem;
    margin-top: 5px;
    display: block;
}

.forum-details-url:hover {
    text-decoration: underline;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h3 {
    font-size: 1.3rem;
    color: #333;
    margin: 0;
}

.accounts-section {
    margin-bottom: 30px;
}

.account-card-detailed {
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f4f8 100%);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
}

.account-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.account-name {
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
}

.account-actions {
    display: flex;
    gap: 5px;
}

.account-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 10px;
}

.user-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.user-field:last-child {
    border-bottom: none;
}

.field-label {
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
    min-width: 80px;
}

.field-value {
    color: #333;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.7);
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    word-break: break-all;
    flex: 1;
    text-align: right;
}

.field-value:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.02);
}

.notes-field {
    font-family: inherit;
    word-break: break-word;
    white-space: pre-wrap;
}

.content-section {
    margin-top: 20px;
}

.content-item-detailed {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.content-item-detailed:hover {
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.1);
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.content-title {
    font-weight: 600;
    color: #333;
    margin: 0;
    font-size: 1rem;
    flex: 1;
    word-wrap: break-word;
    white-space: normal;
    margin-right: 10px;
}

.content-actions {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.content-text {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.content-text.preview {
    max-height: 60px;
    overflow: hidden;
    position: relative;
}

.content-text.preview::after {
    content: '...';
    position: absolute;
    bottom: 0;
    right: 0;
    background: white;
    padding-left: 20px;
}

.content-expand-btn {
    color: #667eea;
    font-size: 0.8rem;
    margin-top: 5px;
    cursor: pointer;
    text-decoration: underline;
}

.empty-message {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 10px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 30px;
    border-radius: 20px;
    width: 95%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close:hover {
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-input, .form-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fafafa;
}

.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-textarea {
    min-height: 200px;
    resize: vertical;
    font-family: 'Courier New', monospace;
}

.form-row {
    display: flex;
    gap: 15px;
    align-items: end;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-row-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.editor-toolbar {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    padding: 10px;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.editor-btn {
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.editor-btn:hover {
    background: #e9ecef;
}

.editor-textarea {
    border-radius: 0 0 10px 10px !important;
    border-top: none !important;
}

.conversion-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.replace-controls {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

.replace-controls h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 0.9rem;
}

.replace-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    align-items: end;
}

.preview-section {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

.preview-section h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 0.9rem;
}

#contentPreview {
    min-height: 100px;
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    line-height: 1.4;
}

.content-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 15px;
}

.content-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.content-list-item:last-child {
    border-bottom: none;
}

.content-list-item:hover {
    background-color: #f8f9fa;
}

.content-list-text {
    flex: 1;
    font-size: 0.9rem;
    color: #666;
    margin-right: 10px;
    word-wrap: break-word;
    white-space: normal;
}

.content-list-actions {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.empty-state-text {
    font-size: 1.1rem;
    line-height: 1.6;
}

.copy-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: translateX(400px);
    transition: all 0.3s ease;
    z-index: 1001;
}

.copy-notification.show {
    transform: translateX(0);
}

.rich-paste-hint {
    font-size: 0.85rem;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.tab {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.tab.active {
    border-bottom-color: #667eea;
    color: #667eea;
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.edit-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.edit-modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 15px;
    }

    .header {
        padding: 20px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .main-content {
        padding: 20px;
    }

    .forums-grid {
        grid-template-columns: 1fr;
    }

    .controls {
        justify-content: center;
    }

    .modal-content {
        margin: 5% auto;
        width: 98%;
        padding: 20px;
    }

    .editor-toolbar {
        gap: 2px;
    }

    .editor-btn {
        padding: 4px 8px;
        font-size: 0.75rem;
    }

    .form-row {
        flex-direction: column;
        gap: 10px;
    }

    .form-row-grid {
        grid-template-columns: 1fr;
    }

    .replace-row {
        grid-template-columns: 1fr;
    }

    .account-fields {
        grid-template-columns: 1fr;
    }
}