@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --bg-gradient-start: #0f172a;
    --bg-gradient-end: #020617;
    --accent-primary: #8b5cf6;
    --accent-primary-rgb: 139, 92, 246;
    --accent-secondary: #ec4899;
    --accent-secondary-rgb: 236, 72, 153;
    --card-bg: rgba(30, 41, 59, 0.5);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --glass-blur: blur(16px);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
    overflow-x: hidden;
    position: relative;
}

/* Background glowing blobs */
body::before, body::after {
    content: '';
    position: fixed;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.15;
    pointer-events: none;
}

body::before {
    background: var(--accent-primary);
    top: 10%;
    left: 10%;
    animation: float-slow 15s infinite alternate;
}

body::after {
    background: var(--accent-secondary);
    bottom: 10%;
    right: 10%;
    animation: float-slow 15s infinite alternate-reverse;
}

@keyframes float-slow {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 30px) scale(1.1); }
}

/* Main Container */
.container {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    z-index: 1;
}

/* Glass Card */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    margin-bottom: 2rem;
    transition: var(--transition-smooth);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
}

/* Typography */
h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    background: linear-gradient(to right, #ffffff, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}

.subtitle {
    color: var(--text-secondary);
    text-align: center;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* Survey Form Elements */
.question-group {
    margin-bottom: 2.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 2rem;
}

.question-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 1.5rem;
}

.question-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: flex-start;
    color: #e2e8f0;
}

.question-num {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    font-size: 0.85rem;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    flex-shrink: 0;
    font-weight: 700;
    margin-top: 1px;
}

/* Option Styles (Checkbox & Radio) */
.options-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.option-item {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.option-item:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateX(4px);
}

.option-item input[type="radio"],
.option-item input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--text-muted);
    background-color: transparent;
    margin-right: 12px;
    outline: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
}

.option-item input[type="radio"] {
    border-radius: 50%;
}

.option-item input[type="checkbox"] {
    border-radius: 4px;
}

.option-item input[type="radio"]:checked {
    border-color: var(--accent-primary);
}

.option-item input[type="radio"]::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-primary);
    transform: scale(0);
    transition: var(--transition-smooth);
}

.option-item input[type="radio"]:checked::before {
    transform: scale(1);
}

.option-item input[type="checkbox"]:checked {
    border-color: var(--accent-secondary);
    background-color: var(--accent-secondary);
}

.option-item input[type="checkbox"]::before {
    content: '✓';
    color: white;
    font-size: 11px;
    font-weight: bold;
    transform: scale(0);
    transition: var(--transition-smooth);
}

.option-item input[type="checkbox"]:checked::before {
    transform: scale(1);
}

.option-label {
    font-size: 0.95rem;
    color: #cbd5e1;
    user-select: none;
    width: 100%;
}

/* Checked state styling for whole option card */
.option-item:has(input:checked) {
    background: rgba(139, 92, 246, 0.08);
    border-color: rgba(139, 92, 246, 0.4);
}

/* Other custom text inputs */
.other-input-container {
    margin-top: 0.75rem;
    width: 100%;
    display: none; /* JS triggers display */
}

.option-item:has(input:checked) + .other-input-container,
.option-item:has(input:checked) ~ .other-input-container {
    display: block;
    animation: slideDown 0.3s ease;
}

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

.text-input, .textarea-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-smooth);
}

.text-input:focus, .textarea-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.25);
    background: rgba(15, 23, 42, 0.8);
}

.textarea-input {
    min-height: 120px;
    resize: vertical;
}

/* 0-10 Score Selection Styling */
.score-container {
    padding: 0.5rem 0;
}

.score-grid {
    display: grid;
    grid-template-columns: repeat(11, 1fr);
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.score-btn {
    aspect-ratio: 1;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
}

.score-btn:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--accent-primary);
    color: white;
}

.score-btn.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.score-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0 0.25rem;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: 14px;
    padding: 1.15rem;
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.2);
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.35);
    filter: brightness(1.1);
}

.submit-btn:active {
    transform: translateY(1px);
}

/* Success modal/card */
.success-container {
    text-align: center;
    padding: 2rem 1rem;
}

.success-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #4ade80, #2dd4bf);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.success-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.success-desc {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* ADMIN PANEL STYLES */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 1.5rem;
}

.admin-title-wrap h1 {
    text-align: left;
    font-size: 2rem;
}

.admin-nav {
    display: flex;
    gap: 0.75rem;
}

.admin-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.admin-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.admin-btn.primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
}

.admin-btn.primary:hover {
    filter: brightness(1.1);
}

/* Summary Grid Cards */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.summary-card {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.summary-card .label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.summary-card .value {
    font-size: 2.25rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(to right, #ffffff, #e2e8f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.summary-card.accent-purple .value {
    background: linear-gradient(to right, #c084fc, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.summary-card.accent-pink .value {
    background: linear-gradient(to right, #f472b6, #fb7185);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Chart and stats styling */
.chart-container {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.chart-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.75rem;
}

.stats-bar-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stats-bar-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.stats-bar-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.stats-bar-label {
    font-weight: 500;
}

.stats-bar-value {
    font-weight: 600;
    color: white;
}

.progress-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--accent-primary), var(--accent-secondary));
    border-radius: 4px;
    width: 0; /* Dynamic width set by inline PHP */
    transition: width 1s ease-out;
}

/* Login Card (Admin) */
.login-card {
    max-width: 400px;
    width: 100%;
    margin: 4rem auto;
}

.login-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--accent-primary);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.login-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Feedbacks Grid (Text answers) */
.feedbacks-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Custom scrollbar for feedbacks */
.feedbacks-list::-webkit-scrollbar {
    width: 6px;
}

.feedbacks-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
}

.feedbacks-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.feedbacks-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.feedback-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 1rem 1.25rem;
}

.feedback-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.feedback-text {
    font-size: 0.95rem;
    color: #cbd5e1;
    line-height: 1.5;
}

/* Table Style for Data Details */
.table-wrapper {
    overflow-x: auto;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1rem;
}

.table-wrapper::-webkit-scrollbar {
    height: 6px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.data-table th, .data-table td {
    padding: 0.85rem 1rem;
    text-align: left;
}

.data-table th {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: #e2e8f0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.data-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
}

/* Rating Badges in Table */
.badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.75rem;
}

.badge-success { background: rgba(74, 222, 128, 0.15); color: #86efac; }
.badge-warning { background: rgba(250, 204, 21, 0.15); color: #fde047; }
.badge-danger { background: rgba(248, 113, 113, 0.15); color: #fca5a5; }

/* Responsive styles */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .admin-nav {
        width: 100%;
        justify-content: flex-end;
    }
}
@media (max-width: 480px) {
    .card {
        padding: 1.5rem;
    }
    h1 {
        font-size: 1.75rem;
    }
    .score-grid {
        gap: 0.2rem;
    }
    .score-btn {
        font-size: 0.8rem;
    }
}
