/* MT-Meter 기본 스타일 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

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

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 20px;
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2em;
    margin-bottom: 10px;
}

.header p {
    opacity: 0.9;
}

/* 버튼 스타일 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd6;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* 카드 스타일 */
.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* 프로젝트 목록 */
.project-list {
    list-style: none;
}

.project-item {
    display: block;
    padding: 20px;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}

.project-item:hover {
    background: #f8f9fa;
}

.project-item:last-child {
    border-bottom: none;
}

.project-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.project-desc {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.project-meta {
    font-size: 0.8em;
    color: #999;
}

.project-meta span {
    margin-right: 15px;
}

/* 탭 스타일 */
.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

/* 폼 스타일 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* 질문 카드 */
.question-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
}

.question-number {
    font-size: 0.8em;
    color: #667eea;
    font-weight: 600;
    margin-bottom: 8px;
}

.question-text {
    font-size: 1.1em;
    font-weight: 500;
    margin-bottom: 15px;
}

.question-type {
    font-size: 0.8em;
    color: #999;
    margin-bottom: 10px;
}

/* 응답 목록 */
.response-list {
    list-style: none;
}

.response-item {
    background: white;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
}

.response-text {
    font-size: 1em;
    color: #333;
}

.response-meta {
    font-size: 0.8em;
    color: #999;
    margin-top: 8px;
}

/* 상태 배지 */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 600;
}

.badge-active {
    background: #d4edda;
    color: #155724;
}

.badge-closed {
    background: #f8d7da;
    color: #721c24;
}

.badge-open {
    background: #cce5ff;
    color: #004085;
}

/* 모달 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    text-align: right;
}

/* 결과 화면 */
.result-container {
    padding: 20px 0;
}

.result-question {
    margin-bottom: 30px;
}

.result-question-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.result-responses {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.result-response {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    animation: fadeIn 0.3s ease-in;
}

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

.new-response {
    animation: highlight 2s ease-out;
}

@keyframes highlight {
    0% { background: #fff3cd; }
    100% { background: white; }
}

/* 로딩 */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #667eea;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 빈 상태 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

/* 알림 */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #cce5ff;
    color: #004085;
    border: 1px solid #b8daff;
}

/* 헤더 컨트롤 */
.header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* 반응형 */
@media (max-width: 600px) {
    .container {
        padding: 15px;
    }

    .header {
        padding: 20px 15px;
    }

    .header h1 {
        font-size: 1.5em;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .tab-btn {
        padding: 10px 15px;
        flex: 1;
        text-align: center;
    }

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

    .modal-content {
        width: 95%;
        margin: 10px;
    }
}

/* Admin 특화 스타일 */
.admin-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.question-list {
    list-style: none;
}

.question-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
}

.question-item .drag-handle {
    cursor: grab;
    color: #999;
    padding: 5px;
}

.question-item .question-content {
    flex: 1;
}

.question-item .question-actions {
    display: flex;
    gap: 5px;
}

.type-select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
}

/* 실시간 업데이트 표시 */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8em;
    color: #28a745;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 결과 비공개 화면 */
.result-locked {
    text-align: center;
    padding: 80px 20px;
}

.result-locked-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.result-locked h2 {
    color: #666;
    margin-bottom: 10px;
}

.result-locked p {
    color: #999;
}

/* 옵션 리스트 (객관식, 체크박스) */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.option-label:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.option-label input[type="radio"],
.option-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.option-label input[type="radio"]:checked + span,
.option-label input[type="checkbox"]:checked + span {
    color: #667eea;
    font-weight: 500;
}

.option-label:has(input:checked) {
    border-color: #667eea;
    background: #f0f4ff;
}

/* 결과 차트 스타일 */
.result-chart {
    margin-top: 15px;
}

.chart-bar-container {
    margin-bottom: 12px;
}

.chart-bar-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.95em;
}

.chart-bar-text {
    color: #333;
}

.chart-bar-count {
    color: #666;
    font-weight: 500;
}

.chart-bar {
    height: 28px;
    background: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
}

.chart-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 6px;
    transition: width 0.5s ease-out;
    min-width: 2px;
}
