:root {
    --bg-dark: #0f172a;
    --card-bg: transparent; /* Made fully transparent */
    --border-color: rgba(255, 255, 255, 0.2);
    --text-primary: #ffffff;
    --text-secondary: #e2e8f0;
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --accent-color: #ec4899;
    --success-color: #10b981;
    --success-hover: #059669;
    --error-color: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(rgba(15, 23, 42, 0.55), rgba(15, 23, 42, 0.55)), 
                url('assets/hcmut_bg.jpg') no-repeat center center fixed;
    background-size: cover;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 40px 20px;
    overflow-x: hidden;
}

/* Background Blobs removed for cleaner image background */
.background-blob {
    display: none;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: rgba(99, 102, 241, 0.3);
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: rgba(236, 72, 153, 0.2);
    bottom: -100px;
    right: -100px;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0); }
    50% { transform: translate(30px, 30px); }
    100% { transform: translate(0, 0); }
}

.app-container {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo .emoji {
    font-size: 3rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.badge {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    font-size: 0.9rem;
    padding: 3px 8px;
    border-radius: 6px;
    vertical-align: top;
    margin-left: 10px;
    -webkit-text-fill-color: white;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--card-bg);
    border: none; /* Removed border */
    border-radius: 16px;
    padding: 30px;
    box-shadow: none; /* Removed shadow */
    transition: transform 0.3s ease, opacity 0.4s ease;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8); /* Added shadow for readability */
}

.glass-card.hidden {
    display: none;
    opacity: 0;
    transform: translateY(20px);
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Form Controls */
.input-group {
    display: flex;
    gap: 15px;
}

input[type="text"], input[type="number"] {
    flex: 1;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
}

input[type="text"]:focus, input[type="number"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
    background: rgba(15, 23, 42, 0.8);
}

/* Buttons */
button {
    cursor: pointer;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-color);
}
.btn-primary:not(:disabled):hover {
    background: var(--primary-hover);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
}
.btn-secondary:not(:disabled):hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-success {
    background: var(--success-color);
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
}
.btn-success:not(:disabled):hover {
    background: var(--success-hover);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

/* Loaders */
.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

.loader.hidden {
    display: none;
}

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

.helper-text {
    margin-top: 10px;
    font-size: 0.9rem;
}

.error {
    color: var(--error-color);
}

/* Questions Grid */
.questions-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.question-card {
    background: rgba(15, 23, 42, 0.6); /* Slightly darker background for focus */
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(8px); /* Keep slight blur for contrast in the grid items */
}

.question-title {
    font-weight: 600;
    margin-bottom: 15px;
    color: #e2e8f0;
    display: flex;
    justify-content: space-between;
}

.q-type-badge {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 4px;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.option-label {
    flex: 1;
    font-size: 0.95rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.weight-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.weight-input input[type="range"] {
    width: 120px;
    accent-color: var(--primary-color);
}

.weight-input input[type="number"] {
    width: 70px;
    padding: 8px;
    text-align: center;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.setting-item.toggle {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.4);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* Toggle Switch CSS */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255,255,255,0.2);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.slider.round {
    border-radius: 28px;
}

.slider.round:before {
    border-radius: 50%;
}

.status-message {
    margin-top: 15px;
    padding: 15px;
    border-radius: 8px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success-color);
    color: #34d399;
    text-align: center;
    font-weight: 600;
}

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

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s;
}

.modal.hidden {
    display: none;
    opacity: 0;
}

.modal-content {
    background: #1e293b;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    width: 90%;
    max-width: 800px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    animation: slideIn 0.3s ease-out;
}

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

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #fff;
}

/* Carousel */
.carousel-container {
    position: relative;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    min-height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.carousel-slide {
    width: 100%;
    text-align: center;
    transition: opacity 0.4s ease;
}

.carousel-img {
    max-width: 100%;
    max-height: 65vh;
    object-fit: contain;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.carousel-caption {
    padding: 15px;
    background: rgba(15, 23, 42, 0.8);
    color: #fff;
    font-size: 0.95rem;
    position: absolute;
    bottom: 0;
    width: 100%;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    font-size: 1.5rem;
    padding: 15px 10px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-btn:hover {
    background: rgba(99, 102, 241, 0.8);
}

.carousel-btn.prev {
    left: 10px;
}

.carousel-btn.next {
    right: 10px;
}

.carousel-dots {
    text-align: center;
    margin-top: 15px;
}

.dot {
    cursor: pointer;
    height: 10px;
    width: 10px;
    margin: 0 5px;
    background-color: var(--text-secondary);
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.3s;
}

.dot.active, .dot:hover {
    background-color: var(--primary-color);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}
.btn-outline:hover {
    background: rgba(99, 102, 241, 0.1);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

