/* ============================================
   Base Styles
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --success: #10b981;
    --success-dark: #059669;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --warning: #f59e0b;
    --warning-dark: #d97706;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.15), 0 3px 6px rgba(0,0,0,0.10);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--gray-800);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3 {
    font-weight: 600;
    line-height: 1.2;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--gray-600);
    color: white;
}

.btn-secondary:hover {
    background: var(--gray-700);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: var(--success-dark);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-dark);
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    background: var(--warning-dark);
}

.btn-outline {
    background: transparent;
    border: 2px solid white;
    color: white;
}

.btn-outline:hover {
    background: rgba(255,255,255,0.1);
}

.btn-large {
    padding: 15px 30px;
    font-size: 1.1rem;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.875rem;
}

/* ============================================
   Form Elements
   ============================================ */
input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--gray-700);
}

/* ============================================
   Index Page
   ============================================ */
.hero {
    text-align: center;
    padding: 60px 20px;
    color: white;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 10px;
}

.hero .subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
}

.card-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 500px;
    margin: 0 auto;
}

.card {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.card h2 {
    margin-bottom: 10px;
    color: var(--gray-800);
}

.card p {
    color: var(--gray-500);
    margin-bottom: 20px;
}

.card form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.divider {
    text-align: center;
    color: white;
    font-weight: 500;
    opacity: 0.8;
}

.error-message {
    background: var(--danger);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius);
    text-align: center;
    margin-top: 20px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   Host Page
   ============================================ */
.host-header {
    background: white;
    padding: 20px 30px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.session-info h1 {
    color: var(--gray-800);
    margin-bottom: 8px;
}

.session-meta {
    display: flex;
    gap: 20px;
    color: var(--gray-500);
}

.session-code strong,
.participant-count strong {
    color: var(--primary);
}

.session-actions {
    display: flex;
    gap: 10px;
}

/* Header QR Code */
.header-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    border-radius: 12px;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    transition: all 0.2s;
}

.header-qr:hover {
    border-color: var(--primary);
    background: white;
    transform: scale(1.02);
}

.header-qr img {
    width: 80px;
    height: 80px;
    border-radius: 4px;
}

.qr-hint {
    font-size: 0.7rem;
    color: var(--gray-500);
    margin-top: 5px;
    max-width: 100px;
    text-align: center;
    word-break: break-all;
    line-height: 1.2;
}

.host-main {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 30px;
}

@media (max-width: 900px) {
    .host-main {
        grid-template-columns: 1fr;
    }
}

.create-poll-section,
.polls-section {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.create-poll-section h2,
.polls-section h2 {
    color: var(--gray-800);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--gray-100);
}

/* Poll Type Selector */
.poll-type-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.poll-type-option {
    cursor: pointer;
}

.poll-type-option input {
    display: none;
}

.poll-type-label {
    display: inline-block;
    padding: 10px 20px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    transition: all 0.2s;
}

.poll-type-option input:checked + .poll-type-label {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.option-input {
    margin-bottom: 10px;
}

.scale-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.scale-inputs input {
    width: 80px;
}

/* Polls List */
.polls-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.empty-state {
    color: var(--gray-400);
    text-align: center;
    padding: 40px;
}

.poll-card {
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s;
}

.poll-card.poll-open {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.05);
}

.poll-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
}

.poll-header h3 {
    color: var(--gray-800);
    flex: 1;
}

.poll-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-open {
    background: var(--success);
    color: white;
}

.status-closed {
    background: var(--gray-300);
    color: var(--gray-600);
}

.poll-results {
    margin-bottom: 15px;
}

.total-votes {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-bottom: 10px;
}

/* Yes/No Bar */
.yes-no-bar {
    display: flex;
    height: 40px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--gray-100);
}

.yes-bar {
    background: var(--success);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 0.875rem;
    min-width: fit-content;
    padding: 0 10px;
}

.no-bar {
    background: var(--danger);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 0.875rem;
    min-width: fit-content;
    padding: 0 10px;
}

/* Choice Results */
.choice-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.choice-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.choice-label {
    font-size: 0.875rem;
    color: var(--gray-700);
}

.choice-bar-container {
    position: relative;
    height: 24px;
    background: var(--gray-100);
    border-radius: 4px;
    overflow: hidden;
}

.choice-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
}

.choice-value {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: var(--gray-600);
}

/* Scale Distribution */
.scale-average {
    font-size: 1.25rem;
    margin-bottom: 10px;
}

.scale-distribution {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 80px;
    padding-top: 10px;
}

.scale-bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.scale-bar {
    width: 100%;
    background: var(--primary);
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: height 0.3s ease;
}

.scale-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 4px;
}

.poll-actions {
    display: flex;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid var(--gray-100);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-400);
}

.modal-close:hover {
    color: var(--gray-600);
}

.qr-image {
    max-width: 250px;
    margin: 20px 0;
}

.qr-url {
    color: var(--gray-500);
    font-size: 0.875rem;
    word-break: break-all;
    margin-bottom: 20px;
}

/* ============================================
   Vote Page
   ============================================ */
.vote-header {
    background: white;
    padding: 20px 30px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    text-align: center;
    margin-bottom: 30px;
}

.vote-header h1 {
    color: var(--gray-800);
    margin-bottom: 5px;
}

.vote-header .session-code {
    color: var(--gray-500);
}

.vote-main {
    max-width: 600px;
    margin: 0 auto;
}

/* Waiting State */
.waiting-state {
    background: white;
    padding: 60px 30px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    text-align: center;
}

.waiting-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 30px;
    position: relative;
}

.pulse {
    width: 100%;
    height: 100%;
    background: var(--primary);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    50% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(0.8);
        opacity: 1;
    }
}

.waiting-state h2 {
    color: var(--gray-800);
    margin-bottom: 10px;
}

.waiting-state p {
    color: var(--gray-500);
}

/* Active Poll */
.active-poll {
    background: white;
    padding: 40px 30px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    text-align: center;
}

.poll-question {
    color: var(--gray-800);
    font-size: 1.5rem;
    margin-bottom: 30px;
}

/* Vote Buttons */
.vote-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.vote-btn {
    padding: 20px 40px;
    font-size: 1.25rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 120px;
}

.vote-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.vote-btn:active {
    transform: scale(0.98);
}

.vote-yes {
    background: var(--success);
    color: white;
}

.vote-no {
    background: var(--danger);
    color: white;
}

.vote-choice {
    background: var(--primary);
    color: white;
}

.choice-buttons {
    flex-direction: column;
    max-width: 400px;
    margin: 0 auto;
}

.choice-buttons .vote-btn {
    width: 100%;
}

/* Scale Slider */
.scale-slider {
    max-width: 400px;
    margin: 0 auto;
}

.scale-slider input[type="range"] {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    background: var(--gray-200);
    border-radius: 4px;
    outline: none;
    margin-bottom: 10px;
}

.scale-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
}

.scale-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    color: var(--gray-500);
}

.scale-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

/* Voted State */
.voted-state {
    padding: 20px;
}

.voted-icon {
    width: 60px;
    height: 60px;
    background: var(--success);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 15px;
}

.voted-state p {
    color: var(--success);
    font-weight: 500;
}

/* Results View */
.results-view {
    background: white;
    padding: 40px 30px;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.results-view h2 {
    text-align: center;
    color: var(--gray-600);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.results-view .poll-question {
    text-align: center;
    margin-bottom: 30px;
}

.results-yes-no {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.results-yes-no .result-bar {
    padding: 15px 20px;
    border-radius: var(--radius);
    color: white;
    font-weight: 500;
    min-width: 100px;
}

.results-yes-no .yes-bar {
    background: var(--success);
}

.results-yes-no .no-bar {
    background: var(--danger);
}

.results-choice {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.result-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.result-label {
    font-weight: 500;
    color: var(--gray-700);
}

.result-bar-container {
    position: relative;
    height: 30px;
    background: var(--gray-100);
    border-radius: var(--radius);
    overflow: hidden;
}

.result-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    transition: width 0.5s ease;
}

.result-bar.choice-bar {
    background: var(--primary);
}

.result-value {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.875rem;
    color: var(--gray-600);
}

.results-scale-avg {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.results-scale-dist {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 120px;
    padding: 10px 0;
}

.results-scale-dist .scale-bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.results-scale-dist .scale-bar {
    width: 100%;
    background: var(--primary);
    border-radius: 4px 4px 0 0;
    position: relative;
    min-height: 4px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.scale-count {
    font-size: 0.75rem;
    color: white;
    padding-top: 4px;
}

/* Session Ended */
.session-ended {
    background: white;
    padding: 60px 30px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    text-align: center;
}

.session-ended h2 {
    color: var(--gray-800);
    margin-bottom: 10px;
}

.session-ended p {
    color: var(--gray-500);
    margin-bottom: 30px;
}

/* ============================================
   Participant Badges (Host)
   ============================================ */
.participant-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.participant-badge.kc {
    background: #fef3c7;
    color: #92400e;
}

.participant-badge.office {
    background: #dbeafe;
    color: #1e40af;
}

.participant-badge.remote {
    background: #d1fae5;
    color: #065f46;
}

.participant-total {
    font-weight: 600;
}

/* ============================================
   Templates Modal
   ============================================ */
.modal-large {
    max-width: 800px;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
    text-align: left;
}

.template-card {
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.template-card:hover {
    border-color: var(--primary);
    background: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.template-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.template-card h3 {
    font-size: 1rem;
    color: var(--gray-800);
    margin-bottom: 5px;
}

.template-card p {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin: 0;
}

/* ============================================
   Mode Selection Screen
   ============================================ */
.mode-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.mode-header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

.mode-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.mode-header p {
    font-size: 1.25rem;
    opacity: 0.9;
}

.mode-cards {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.mode-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    width: 250px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 3px solid transparent;
}

.mode-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.mode-card.mode-kc:hover {
    border-color: #f59e0b;
}

.mode-card.mode-office:hover {
    border-color: #3b82f6;
}

.mode-card.mode-remote:hover {
    border-color: #10b981;
}

.mode-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.mode-card h2 {
    color: var(--gray-800);
    margin-bottom: 5px;
}

.mode-card > p {
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.mode-card ul {
    list-style: none;
    text-align: left;
    font-size: 0.85rem;
    color: var(--gray-600);
}

.mode-card li {
    padding: 5px 0;
    border-bottom: 1px solid var(--gray-100);
}

.mode-card li:last-child {
    border-bottom: none;
}

/* ============================================
   Vote Header with Mode Switch
   ============================================ */
.vote-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
}

.header-left h1 {
    font-size: 1.25rem;
    margin-bottom: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mode-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-kc {
    background: #fef3c7;
    color: #92400e;
}

.badge-office {
    background: #dbeafe;
    color: #1e40af;
}

.badge-remote {
    background: #d1fae5;
    color: #065f46;
}

/* ============================================
   KC MODE: Минимализм
   ============================================ */
.kc-mode {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 150px);
}

.kc-waiting {
    text-align: center;
    color: white;
}

.kc-pulse {
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: pulse 2s infinite;
}

.kc-waiting p {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.hotkey-hint {
    font-size: 0.9rem;
    opacity: 0.7;
}

.kc-poll {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 600px;
    width: 100%;
}

.kc-question {
    font-size: 1.5rem;
    color: var(--gray-800);
    margin-bottom: 30px;
}

.kc-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.kc-btn {
    padding: 20px 30px;
    font-size: 1.25rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 140px;
    justify-content: center;
}

.kc-btn:hover {
    transform: scale(1.05);
}

.kc-btn:active {
    transform: scale(0.98);
}

.kc-key {
    background: rgba(0,0,0,0.2);
    padding: 4px 10px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.9rem;
}

.kc-yes {
    background: var(--success);
    color: white;
}

.kc-no {
    background: var(--danger);
    color: white;
}

.kc-choice {
    background: var(--primary);
    color: white;
}

.kc-scale {
    background: var(--gray-100);
    color: var(--gray-800);
    min-width: 60px;
    padding: 15px;
}

.kc-scale:hover {
    background: var(--primary);
    color: white;
}

.kc-voted {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.check-mark {
    font-size: 4rem;
    color: var(--success);
}

/* ============================================
   OFFICE MODE: Дашборд 360°
   ============================================ */
.office-mode {
    display: grid;
    max-width: 100%;
}

.office-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
}

@media (max-width: 900px) {
    .office-grid {
        grid-template-columns: 1fr;
    }
}

.office-card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.office-card h3 {
    color: var(--gray-600);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--gray-100);
}

.office-waiting {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-400);
}

.waiting-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 15px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.office-question {
    font-size: 1.25rem;
    color: var(--gray-800);
    margin-bottom: 20px;
}

.office-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.office-btn {
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 500;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.office-btn:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.office-yes:hover {
    background: var(--success);
    border-color: var(--success);
}

.office-no:hover {
    background: var(--danger);
    border-color: var(--danger);
}

.office-scale {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.office-scale-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.office-scale-btn:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.office-voted {
    text-align: center;
    padding: 20px;
    color: var(--success);
    font-size: 1.25rem;
    font-weight: 600;
}

.office-results {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--gray-100);
}

.results-total {
    font-size: 0.9rem;
    color: var(--gray-500);
    margin-bottom: 15px;
}

.office-bar-chart {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bar-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bar-label {
    width: 80px;
    font-size: 0.85rem;
    color: var(--gray-600);
    flex-shrink: 0;
}

.bar-track {
    flex: 1;
    height: 24px;
    background: var(--gray-100);
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.5s ease;
}

.bar-fill.yes { background: var(--success); }
.bar-fill.no { background: var(--danger); }

.bar-value {
    width: 50px;
    text-align: right;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
}

.scale-avg {
    text-align: center;
    font-size: 1.25rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
}

/* History */
.office-history {
    max-height: 200px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.85rem;
}

.history-q {
    color: var(--gray-700);
}

.history-votes {
    color: var(--gray-400);
}

.empty-hint {
    color: var(--gray-400);
    font-size: 0.85rem;
    text-align: center;
}

/* ============================================
   REMOTE MODE: Фокус на воронке
   ============================================ */
.remote-mode {
    display: flex;
    flex-direction: column;
    max-width: 500px;
    margin: 0 auto;
}

.remote-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.remote-progress {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.progress-bar {
    height: 12px;
    background: var(--gray-200);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), #34d399);
    border-radius: 6px;
    transition: width 0.5s ease;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--gray-500);
}

.remote-poll-area {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: var(--shadow);
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.remote-waiting {
    text-align: center;
}

.focus-circle {
    width: 100px;
    height: 100px;
    border: 4px solid var(--gray-200);
    border-radius: 50%;
    margin: 0 auto 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: breathe 4s ease-in-out infinite;
}

.focus-inner {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0.5;
}

@keyframes breathe {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 1; }
}

.remote-waiting h2 {
    color: var(--gray-800);
    margin-bottom: 10px;
}

.remote-waiting p {
    color: var(--gray-500);
}

.remote-poll {
    text-align: center;
    width: 100%;
}

.remote-question-number {
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 10px;
}

.remote-question {
    font-size: 1.5rem;
    color: var(--gray-800);
    margin-bottom: 30px;
}

.remote-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.remote-btn {
    padding: 18px 30px;
    font-size: 1.1rem;
    font-weight: 500;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.remote-btn:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
    transform: translateX(5px);
}

.remote-yes:hover {
    background: var(--success);
    border-color: var(--success);
}

.remote-no:hover {
    background: var(--danger);
    border-color: var(--danger);
}

.remote-submit {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    margin-top: 15px;
}

.remote-scale {
    width: 100%;
}

.remote-scale input[type="range"] {
    width: 100%;
    height: 10px;
    -webkit-appearance: none;
    background: var(--gray-200);
    border-radius: 5px;
    margin-bottom: 10px;
}

.remote-scale input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 30px;
    height: 30px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
}

.remote-scale-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
    margin: 20px 0;
}

.remote-voted {
    text-align: center;
}

.success-animation {
    font-size: 4rem;
    color: var(--success);
    animation: pop 0.5s ease;
}

@keyframes pop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.remote-voted p {
    color: var(--gray-500);
    margin-top: 15px;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 600px) {
    .hero h1 {
        font-size: 2rem;
    }

    .host-header {
        flex-direction: column;
        text-align: center;
    }

    .header-qr {
        order: -1;
        margin-bottom: 10px;
    }

    .header-qr img {
        width: 100px;
        height: 100px;
    }

    .session-meta {
        flex-direction: column;
        gap: 5px;
    }

    .poll-type-selector {
        flex-direction: column;
    }

    .poll-type-option {
        width: 100%;
    }

    .poll-type-label {
        width: 100%;
        text-align: center;
    }

    .yes-no-buttons {
        flex-direction: column;
    }

    .vote-btn {
        width: 100%;
    }

    .mode-cards {
        flex-direction: column;
    }

    .mode-card {
        width: 100%;
    }

    .templates-grid {
        grid-template-columns: 1fr;
    }

    .vote-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .kc-buttons {
        flex-direction: column;
    }

    .kc-btn {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}
