/* --- Base Styles & Typography --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f8f9fa; /* Very soft off-white background */
    color: #3f3f46; /* Softer dark grey instead of harsh black */
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

h1, h2, h3 {
    color: #18181b;
    font-weight: 600;
}

/* --- Layout Containers --- */
.container {
    max-width: 600px;
    margin: 50px auto;
    padding: 40px;
    background: #ffffff;
    border-radius: 24px; /* Highly rounded */
    border: 1px solid #f4f4f5; /* Sleek, barely-there border instead of a shadow */
}

.login-container, .password-container {
    max-width: 400px;
    margin: 100px auto;
    text-align: center;
}

/* --- Forms & Inputs --- */
.input-field {
    padding: 14px 18px;
    width: 100%;
    margin-bottom: 16px;
    background-color: #f4f4f5; /* Soft inner fill */
    border: 2px solid transparent; /* Hidden border until focused */
    border-radius: 16px; /* Soft rounded corners */
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    color: #18181b;
    box-sizing: border-box;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    outline: none;
}

.input-field::placeholder {
    color: #a1a1aa;
}

.input-field:focus {
    background-color: #ffffff;
    border-color: #c7d2fe; /* Soft glowing border instead of a shadow */
}

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

.question-block {
    margin-bottom: 28px;
    text-align: left;
}

.question-label {
    display: block;
    font-weight: 500;
    margin-bottom: 10px;
    color: #27272a;
}

/* --- Buttons (Pill-shaped, flat, soft-core) --- */
.btn {
    padding: 14px 28px;
    background: #6366f1; /* Soft vibrant indigo */
    color: #ffffff;
    border: none;
    cursor: pointer;
    border-radius: 999px; /* Perfect pill shape */
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.2s ease, transform 0.1s ease;
    /* Zero box shadows! */
}

.btn:hover {
    background: #4f46e5;
}

.btn:active {
    transform: scale(0.97); /* Soft "squish" effect when clicked, rather than pushing down */
}

/* Utility classes for alternative button styles */
.btn-secondary {
    background: #f4f4f5;
    color: #18181b;
}

.btn-secondary:hover {
    background: #e4e4e7;
}

/* --- Admin Gallery & Cards --- */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.gallery-card, .response-card {
    background: #ffffff;
    padding: 24px;
    border: 2px solid #f4f4f5; /* Soft outline */
    border-radius: 20px; /* Highly rounded */
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.gallery-card:hover {
    border-color: #e4e4e7;
    transform: translateY(-2px); /* Gentle float up without shadows */
}

.gallery-card h3 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
}

.gallery-card p {
    margin: 0;
    font-size: 0.9rem;
    color: #71717a;
}

/* --- Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(24, 24, 27, 0.4); /* Softer, lighter overlay */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px); /* Sleek glass effect */
}

.modal-content {
    background: #ffffff;
    padding: 40px;
    border-radius: 24px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid #f4f4f5;
    /* No box shadow! */
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: #f4f4f5;
    border: none;
    border-radius: 999px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    color: #71717a;
    transition: background-color 0.2s ease;
}

.modal-close:hover {
    background: #e4e4e7;
    color: #18181b;
}

/* --- Specific Builder UI --- */
.builder-question { 
    background: #fafafa; 
    padding: 24px; 
    border: 2px solid #f4f4f5; 
    border-radius: 16px; 
    margin-bottom: 20px; 
    position: relative; 
}

.remove-btn { 
    position: absolute; 
    top: -10px; 
    right: -10px; 
    background: #ef4444; 
    color: white; 
    border: none; 
    width: 28px;
    height: 28px;
    border-radius: 50%; 
    cursor: pointer; 
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.response-date { 
    font-size: 0.85rem; 
    color: #71717a; 
    margin-bottom: 16px; 
    padding-bottom: 10px;
    border-bottom: 2px dashed #f4f4f5; 
}

/* --- Star Rating System --- */
.star-rating {
    display: flex;
    gap: 8px;
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
    margin-top: 8px;
}

.star-rating .star {
    color: #e4e4e7; /* Softer empty star */
    transition: color 0.15s ease, transform 0.1s ease;
    user-select: none;
}

.star-rating .star:active {
    transform: scale(0.85); /* Squish effect */
}

.star-rating .star.filled {
    color: #fbbf24; 
}

.star-rating .star.hovered {
    color: #fde68a; /* Softer yellow for hover */
}

/* --- Rich Text Editor Toolbar --- */
.toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    background: transparent;
}

.toolbar button, .toolbar select {
    padding: 8px 12px;
    border: 2px solid #f4f4f5;
    background: #ffffff;
    cursor: pointer;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.toolbar button:hover {
    background: #f4f4f5;
}

.rich-text-editor {
    min-height: 100px;
    border: 2px solid #f4f4f5;
    border-radius: 16px;
    padding: 16px;
    background: #ffffff;
    outline: none;
    transition: border-color 0.2s;
}

.rich-text-editor:focus {
    border-color: #c7d2fe;
}

/* --- Utilities --- */
.success-message {
    color: #059669;
    font-weight: 500;
    text-align: center;
    padding: 16px;
    background: #d1fae5;
    border-radius: 12px;
}

.hidden {
    display: none !important;
}

/* --- Text Links --- */
.admin-link {
    font-size: 0.9rem;
    color: #a1a1aa;
    text-decoration: none;
    transition: color 0.2s ease;
}

.admin-link:hover {
    color: #6366f1; /* Soft indigo on hover */
    text-decoration: underline;
}

/* --- Sleek UI Additions & Animations --- */

/* Smooth fade-in for new questions */
@keyframes slideDownFade {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.builder-question { 
    animation: slideDownFade 0.3s ease-out; 
}

/* Sleek Animated Close Icon */
.sleek-remove-btn {
    position: absolute; 
    top: 16px; 
    right: 16px; 
    background: transparent; 
    border: none; 
    color: #a1a1aa; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    transition: color 0.2s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sleek-remove-btn:hover {
    color: #ef4444; 
    transform: scale(1.15) rotate(90deg); /* Sleek spin effect */
}

/* Flat iOS-Style Toggle Switch */
.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px dashed #f4f4f5;
}

.toggle-label-text {
    font-size: 0.9rem;
    color: #71717a;
    font-weight: 500;
}

.toggle-switch {
    position: relative; 
    width: 44px; 
    height: 24px; 
    display: inline-block;
}

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

.toggle-slider {
    position: absolute; 
    cursor: pointer; 
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #e4e4e7; 
    transition: background-color 0.3s ease; 
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute; 
    content: ""; 
    height: 18px; 
    width: 18px; 
    left: 3px; 
    bottom: 3px;
    background-color: white; 
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    border-radius: 50%;
}

input:checked + .toggle-slider { 
    background-color: #6366f1; 
}

input:checked + .toggle-slider:before { 
    transform: translateX(20px); 
}

/* --- Rich Text Placeholder Fix --- */
[contenteditable][placeholder]:empty:before {
    content: attr(placeholder);
    color: #a1a1aa;
    pointer-events: none;
    display: block;
}