/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

.subtitle {
    opacity: 0.9;
    font-size: 16px;
}

.back-link {
    color: white;
    text-decoration: none;
    font-size: 14px;
    opacity: 0.9;
    display: inline-block;
    margin-top: 10px;
}

.back-link:hover {
    opacity: 1;
}

main {
    padding: 30px;
}

/* Карточки */
.card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.card h2, .card h3 {
    margin-bottom: 15px;
    color: #333;
}

.card ul, .card ol {
    margin-left: 20px;
    line-height: 1.8;
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    font-size: 16px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn:disabled,
.btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.poll-management-section {
    margin-bottom: 20px;
}

.management-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.management-actions .btn {
    width: 100%;
}

.voting-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.voting-actions .btn {
    flex: 1;
    min-width: 200px;
}

.actions-section {
    display: flex;
    gap: 15px;
    margin: 30px 0;
    flex-wrap: wrap;
}

/* Формы */
.poll-form {
    max-width: 600px;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

/* Участники */
.participants-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    min-height: 40px;
    padding: 10px;
    background: white;
    border-radius: 8px;
}

.participant-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #667eea;
    color: white;
    border-radius: 20px;
    font-size: 14px;
}

.participant-tag .remove {
    cursor: pointer;
    font-weight: bold;
    opacity: 0.8;
}

.participant-tag .remove:hover {
    opacity: 1;
}

.search-box {
    position: relative;
}

.participants-actions {
    margin: 15px 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.participants-actions .btn {
    flex: 1;
    min-width: 200px;
}

.add-participant-form {
    position: relative;
    margin-top: 15px;
}

.add-participant-form input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.add-participant-form input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    margin-top: 5px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.search-result-item {
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.search-result-item:hover {
    background: #f8f9fa;
}

.search-result-item:last-child {
    border-bottom: none;
}

/* Временные слоты */
.time-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.time-slot {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    background: white;
}

.time-slot:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

.time-slot.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.time-slot.unavailable {
    opacity: 0.5;
    cursor: not-allowed;
}

.time-slot.unavailable:hover {
    transform: none;
    border-color: #e0e0e0;
}

.time-slot .time {
    font-weight: 500;
    font-size: 14px;
}

.time-slot .votes {
    font-size: 12px;
    margin-top: 5px;
    opacity: 0.8;
}

/* Результаты */
.results-list {
    margin-top: 20px;
}

.result-item {
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.result-item .time {
    font-weight: 500;
    margin-bottom: 10px;
}

.result-item .stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.result-item .bar {
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.result-item .bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 500;
    font-size: 12px;
}

.result-item .voters {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

/* Список голосований */
.polls-list {
    display: grid;
    gap: 15px;
}

.poll-item {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #667eea;
    cursor: pointer;
    transition: all 0.3s ease;
}

.poll-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.poll-item .title {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 10px;
    color: #333;
}

.poll-item .meta {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #666;
    flex-wrap: wrap;
}

.poll-item .status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 10px;
}

.poll-item .status.active {
    background: #d4edda;
    color: #155724;
}

.poll-item .status.closed {
    background: #f8d7da;
    color: #721c24;
}

/* Информация о голосовании */
.poll-info .info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.poll-info .info-row:last-child {
    border-bottom: none;
}

.poll-info .label {
    font-weight: 500;
    color: #666;
}

/* Загрузка */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state p {
    font-size: 18px;
    margin-bottom: 20px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        border-radius: 0;
        min-height: 100vh;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .time-slots-grid {
        grid-template-columns: 1fr;
    }

    .actions-section {
        flex-direction: column;
    }

    .form-actions {
        flex-direction: column;
    }
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 14px;
}






