﻿/* РћСЃРЅРѕРІРЅС‹Рµ СЃС‚РёР»Рё */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #16a34a;
    --danger-color: #dc2626;
    --warning-color: #f59e0b;
    --background-color: #f8fafc;
    --card-background: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
}

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

/* Р—Р°РіРѕР»РѕРІРѕРє */
header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 18px;
}

.access-panel {
    max-width: 720px;
    margin: 0 auto 12px;
    padding: 18px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #f8fbff;
    box-shadow: var(--shadow);
}

.access-panel-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.access-panel-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.access-panel-controls input {
    flex: 1;
}

.access-status {
    margin-top: 10px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.access-status.ready {
    color: var(--success-color);
}

.access-status.error {
    color: var(--danger-color);
}

/* РћСЃРЅРѕРІРЅРѕР№ РєРѕРЅС‚РµРЅС‚ */
.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

/* РљР°СЂС‚РѕС‡РєРё */
.card {
    background: var(--card-background);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

/* Р¤РѕСЂРјС‹ */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Р—РѕРЅР° Р·Р°РіСЂСѓР·РєРё С„Р°Р№Р»РѕРІ */
.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #fafafa;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background-color: #f0f7ff;
}

.file-upload-area.drag-over {
    border-color: var(--primary-color);
    background-color: #e0f2fe;
}

.file-upload-content {
    pointer-events: none;
}

.upload-icon {
    fill: var(--text-secondary);
    margin-bottom: 10px;
}

.file-upload-area p {
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.file-upload-area .link {
    color: var(--primary-color);
    text-decoration: underline;
}

.file-upload-area small {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* РРЅС„РѕСЂРјР°С†РёСЏ Рѕ С„Р°Р№Р»Рµ */
.file-info {
    background-color: #f0f7ff;
    border: 1px solid #3b82f6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.file-info h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.file-info p {
    margin: 5px 0;
    color: var(--text-primary);
}

.file-info span {
    font-weight: 600;
}

/* РўР°Р±Р»РёС†Р° РїСЂРµРґРїСЂРѕСЃРјРѕС‚СЂР° */
.preview-section {
    margin: 20px 0;
}

.preview-section h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.table-wrapper {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

table th {
    background-color: #f8fafc;
    font-weight: 600;
    position: sticky;
    top: 0;
}

table tr:hover {
    background-color: #f8fafc;
}

/* РЎРµРєС†РёСЏ РїРѕР»СѓС‡Р°С‚РµР»РµР№ */
.recipients-section {
    margin: 20px 0;
}

.recipients-section h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

/* РўР°Р±Р»РёС†Р° РїРѕР»СѓС‡Р°С‚РµР»РµР№ */
.recipients-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.recipients-table th,
.recipients-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.recipients-table th {
    background-color: #f8fafc;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.recipients-table tr:hover {
    background-color: #f8fafc;
}

/* Р РµРґР°РєС‚РёСЂСѓРµРјС‹Рµ РїРѕР»СЏ РІ С‚Р°Р±Р»РёС†Рµ */
.recipients-table input[type="text"],
.recipients-table input[type="email"] {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    background-color: transparent;
    transition: all 0.3s ease;
}

.recipients-table input[type="text"]:focus,
.recipients-table input[type="email"]:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: white;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* РЎС‚Р°С‚СѓСЃ С„Р°Р№Р»Р° */
.file-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.file-status.uploaded {
    background-color: #d1fae5;
    color: #064e3b;
}

.file-status.not-uploaded {
    background-color: #fee2e2;
    color: #7f1d1d;
}

.file-status-icon {
    width: 14px;
    height: 14px;
}

/* РљРЅРѕРїРєРё РґРµР№СЃС‚РІРёР№ РІ С‚Р°Р±Р»РёС†Рµ */
.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-btn.btn-danger {
    background-color: #fee2e2;
    color: #dc2626;
}

.action-btn.btn-danger:hover:not(:disabled) {
    background-color: #fecaca;
}

.action-btn.btn-replace {
    background-color: #e0e7ff;
    color: #3730a3;
}

.action-btn.btn-replace:hover:not(:disabled) {
    background-color: #c7d2fe;
}

.action-btn-icon {
    font-size: 16px;
}

/* РљРѕРЅС‚РµР№РЅРµСЂ РґР»СЏ РєРЅРѕРїРѕРє РґРµР№СЃС‚РІРёР№ */
.action-buttons-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* РЎРµРєС†РёСЏ РґРѕР±Р°РІР»РµРЅРёСЏ РїРѕР»СѓС‡Р°С‚РµР»СЏ */
.add-recipient-section {
    margin-top: 20px;
    padding: 20px;
    background-color: #f0f7ff;
    border: 1px solid #3b82f6;
    border-radius: 8px;
}

.add-recipient-section h4 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.add-recipient-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 15px;
    align-items: end;
}

.add-recipient-form .form-group {
    margin-bottom: 0;
}

.add-recipient-form input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
}

.add-recipient-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-add {
    background-color: var(--success-color);
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.btn-add:hover {
    background-color: #15803d;
}

.btn-add-icon {
    font-size: 18px;
}

/* РћР±С‘СЂС‚РєР° РґР»СЏ С‚Р°Р±Р»РёС†С‹ СЃ РїСЂРѕРєСЂСѓС‚РєРѕР№ */
.recipients-table-wrapper {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 20px;
}

/* РЎРєСЂС‹С‚РёРµ РїРѕР»РµР№ С„Р°Р№Р»Р° РґР»СЏ Р·Р°РіСЂСѓР·РєРё */
.file-upload-input {
    display: none;
}

/* РЎРµРєС†РёСЏ Р·Р°РіСЂСѓР·РєРё С„Р°Р№Р»РѕРІ */
.upload-section {
    margin: 20px 0;
    padding: 20px;
    background-color: #fafafa;
    border-radius: 8px;
}

.upload-section h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.info-message {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.selected-files-list {
    margin: 15px 0;
}

.selected-files-list h4 {
    font-size: 1rem;
    margin-bottom: 10px;
}

.selected-files-list ul {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
}

.selected-files-list li {
    padding: 8px;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-size {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* РљРЅРѕРїРєРё */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
    background-color: #1d4ed8;
}

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

.btn-secondary:hover:not(:disabled) {
    background-color: #475569;
}

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

.btn-success:hover:not(:disabled) {
    background-color: #15803d;
}

.btn-icon {
    font-size: 1.2rem;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* РџСЂРѕРіСЂРµСЃСЃ-Р±Р°СЂ */
.progress-bar {
    width: 100%;
    height: 24px;
    background-color: #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    margin: 15px 0;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* РџСЂРѕРіСЂРµСЃСЃ РѕС‚РїСЂР°РІРєРё */
.sending-progress {
    margin-top: 30px;
    padding: 20px;
    background-color: #f0f7ff;
    border-radius: 8px;
}

.sending-progress h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.stats {
    display: flex;
    gap: 30px;
    margin-top: 15px;
    font-size: 0.95rem;
}

.stats span {
    color: var(--text-secondary);
}

.stats strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* РСЃС‚РѕСЂРёСЏ СЂР°СЃСЃС‹Р»РѕРє */
.campaigns-list {
    display: grid;
    gap: 15px;
}

.campaign-item {
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.campaign-item:hover {
    border-color: var(--primary-color);
    background-color: #fafafa;
}

.campaign-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.campaign-id {
    font-weight: 600;
    color: var(--text-primary);
}

.campaign-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-prepared {
    background-color: #fef3c7;
    color: #92400e;
}

.status-sending {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-completed {
    background-color: #d1fae5;
    color: #064e3b;
}

.campaign-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.campaign-details strong {
    color: var(--text-primary);
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
}

/* РњРѕРґР°Р»СЊРЅРѕРµ РѕРєРЅРѕ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    position: relative;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

.modal p {
    margin-bottom: 20px;
    color: var(--text-secondary);
}

/* РЈРІРµРґРѕРјР»РµРЅРёСЏ */
.notifications {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1001;
}

.notification {
    background-color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 10px;
    min-width: 300px;
    animation: notificationSlideIn 0.3s ease;
}

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

.notification.success {
    border-left: 4px solid var(--success-color);
}

.notification.error {
    border-left: 4px solid var(--danger-color);
}

.notification.warning {
    border-left: 4px solid var(--warning-color);
}

.notification.info {
    border-left: 4px solid var(--primary-color);
}

/* Recipients Section */
.recipients-section {
    margin-top: 30px;
}

.recipients-section h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
}

#recipientsTable {
    width: 100%;
    border-collapse: collapse;
}

#recipientsTable thead {
    position: sticky;
    top: 0;
    background-color: var(--background-color);
    z-index: 10;
}

#recipientsTable tbody tr:hover {
    background-color: var(--background-color);
}

.editable-field {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid transparent;
    background: transparent;
    font-size: 0.9rem;
}

.editable-field:hover {
    border-color: var(--border-color);
    background: white;
}

.editable-field:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
}

/* File Status */
.file-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.file-status.uploaded {
    background-color: #d1fae5;
    color: #065f46;
}

.file-status.not-uploaded {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Action Buttons */
.action-buttons-group {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.action-btn {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    background-color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.action-btn.btn-replace {
    background-color: #e0e7ff;
    border-color: #6366f1;
    color: #4338ca;
}

.action-btn.btn-danger {
    background-color: #fee2e2;
    border-color: #f87171;
    color: #dc2626;
}

/* Add Recipient Section */
.add-recipient-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* Dialog Styles */
.add-recipient-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.dialog-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
}

.dialog-content h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
}

.dialog-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* РЈС‚РёР»РёС‚С‹ */
.hidden {
    display: none !important;
}

/* РђРґР°РїС‚РёРІРЅРѕСЃС‚СЊ */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 2rem;
    }

    .access-panel-controls {
        flex-direction: column;
    }

    .access-panel-controls .btn,
    .access-panel-controls input {
        width: 100%;
    }

    .card {
        padding: 20px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .stats {
        flex-direction: column;
        gap: 10px;
    }

    .campaign-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .add-recipient-form {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .action-buttons-group {
        flex-direction: column;
        width: 100%;
    }

    .action-btn {
        width: 100%;
        justify-content: center;
    }

    .recipients-table {
        font-size: 0.875rem;
    }

    .recipients-table th,
    .recipients-table td {
        padding: 8px;
    }
}

