﻿/* ============================================
   Survey System - Responsive Stylesheet
   ============================================ */

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

a { color: #444; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Container */
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 16px;
}

/* ============================================
   Survey Frontend
   ============================================ */
.survey-header {
    margin-bottom: 32px;
    padding: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    overflow: hidden;
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #2c2c2c 0%, #444 100%);
    color: #fff;
}
.survey-logo {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    background: #fff;
    padding: 6px;
    flex-shrink: 0;
    object-fit: contain;
}
.header-text { flex: 1; }
.survey-header h1 { font-size: 1.35rem; margin-bottom: 10px; font-weight: 700; letter-spacing: -0.3px; }
.survey-header .survey-intro { opacity: 0.88; font-size: 0.88rem; line-height: 1.6; margin: 0; }
@media (max-width: 520px) {
    .header-inner { flex-direction: column; text-align: center; padding: 24px 18px; }
    .survey-logo { width: 56px; height: 56px; }
    .survey-header h1 { font-size: 1.15rem; }
}

/* Form */
.survey-form {
    background: #fff;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.95rem;
}
.required { color: #e53935; }
.optional { color: #999; font-weight: 400; font-size: 0.85rem; }

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}
.form-control:focus {
    outline: none;
    border-color: #555;
    box-shadow: 0 0 0 3px rgba(85,85,85,0.12);
}

textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }

/* Options (radio/checkbox) */
.question-block { margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid #f0f0f0; }
.question-block:last-of-type { border-bottom: none; }
.question-label { display: block; font-weight: 600; margin-bottom: 10px; font-size: 1rem; }

.options-group { display: flex; flex-direction: column; gap: 8px; }
.option-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.option-item:hover { background: #f8f8f8; border-color: #999; }
.option-item input[type="radio"],
.option-item input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: #555; }
.option-item label { cursor: pointer; flex: 1; font-size: 0.95rem; }

.form-actions { text-align: center; margin-top: 32px; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s, transform 0.1s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: #333; color: #fff; }
.btn-primary:hover { background: #555; }

.btn-danger { background: #e53935; color: #fff; }
.btn-danger:hover { background: #c62828; }

.btn-success { background: #43a047; color: #fff; }
.btn-success:hover { background: #2e7d32; }

.btn-outline { background: transparent; border: 1px solid #ddd; color: #333; }
.btn-outline:hover { background: #f5f5f5; }

.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-lg { padding: 14px 40px; font-size: 1.1rem; }
.btn-block { display: block; width: 100%; }

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.alert-danger { background: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }
.alert-warning { background: #fff8e1; color: #f57f17; border: 1px solid #ffecb3; }

.survey-footer {
    text-align: center;
    margin-top: 24px;
    padding: 16px;
    color: #999;
    font-size: 0.85rem;
}

/* ============================================
   Login Page
   ============================================ */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}
.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}
.login-box h1 {
    text-align: center;
    margin-bottom: 24px;
    font-size: 1.5rem;
    color: #555;
}
.login-footer { text-align: center; margin-top: 20px; font-size: 0.9rem; }

/* ============================================
   Admin Layout
   ============================================ */
.admin-nav {
    background: #555;
    color: #fff;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-brand { font-size: 1.2rem; font-weight: 700; }
.nav-user { display: flex; align-items: center; gap: 12px; font-size: 0.9rem; }
.nav-user .btn-outline { color: #fff; border-color: rgba(255,255,255,0.4); }
.nav-user .btn-outline:hover { background: rgba(255,255,255,0.15); }

.admin-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px;
}
.admin-header { margin-bottom: 24px; }
.admin-header h1 { font-size: 1.6rem; }
.admin-header p { color: #666; }

/* Cards */
.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 24px;
    overflow: hidden;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
}
.card-header h2, .card-header h3 { font-size: 1.1rem; }
.card-body { padding: 20px; }

/* Tables */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid #f0f0f0; }
.table th { background: #fafafa; font-weight: 600; color: #555; white-space: nowrap; }
.table tr:hover { background: #f8f9ff; }
.table-sm td, .table-sm th { padding: 8px 12px; }
.actions { white-space: nowrap; }
.actions .btn { margin-right: 4px; }

/* Bulk Actions */
.bulk-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #f0f0f0;
    flex-wrap: wrap;
}
#selectedCount { color: #666; font-size: 0.9rem; }

/* Stats */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.stat-number { font-size: 2.2rem; font-weight: 700; color: #555; }
.stat-label { font-size: 0.9rem; color: #666; margin-top: 4px; }

.chart-container { max-width: 500px; margin: 0 auto 16px; }

.response-list {
    list-style: none;
    padding: 0;
}
.response-list li {
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.95rem;
}
.response-list li:last-child { border-bottom: none; }

.response-detail {
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
}
.response-detail p { margin-bottom: 8px; }
.response-detail p:last-child { margin-bottom: 0; }

/* Badge */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    background: #e8eaf6;
    color: #3949ab;
}
.badge-info { background: #e3f2fd; color: #1565c0; }

.text-muted { color: #999; }
.text-sm { font-size: 0.85rem; }
.mt-2 { margin-top: 12px; }

.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .survey-header h1 { font-size: 1.4rem; }
    .survey-form { padding: 20px; }
    .login-box { padding: 24px; }
    .admin-nav { flex-direction: column; gap: 8px; padding: 10px 16px; }
    .stats-summary { grid-template-columns: 1fr 1fr; }
    .bulk-actions { flex-direction: column; align-items: stretch; }
    .table { font-size: 0.8rem; }
    .table th, .table td { padding: 8px; }
    .actions { display: flex; flex-wrap: wrap; gap: 4px; }
}

@media (max-width: 480px) {
    .container { padding: 12px 8px; }
    .survey-header { padding: 20px 16px; }
    .survey-form { padding: 16px; }
    .btn-lg { padding: 12px 24px; font-size: 1rem; }
    .stats-summary { grid-template-columns: 1fr; }
}
