:root {
    --primary-color: #673ab7;
    --primary-light: #9575cd;
    --accent-color: #00bcd4;
    --bg-dark: #0f0c29;
    --bg-gradient: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-secondary: #b3b3b3;
    --success: #4caf50;
    --danger: #f44336;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 40px;
}

/* Background Animation */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 10s infinite ease-in-out;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: var(--primary-color);
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: var(--accent-color);
    bottom: -50px;
    right: -50px;
    animation-delay: -2s;
}

.blob-3 {
    width: 200px;
    height: 200px;
    background: #e91e63;
    top: 40%;
    left: 60%;
    animation-delay: -5s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(30px, -30px);
    }
}

/* App Container */
.app-container {
    width: 100%;
    max-width: 800px;
    padding: 0 20px;
    margin-bottom: 50px;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo .icon {
    width: 32px;
    height: 32px;
    color: var(--primary-light);
}

h1 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(to right, #fff, #b3b3b3);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Cards & Glassmorphism */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: transform 0.3s ease;
}

h2 {
    font-size: 28px;
    margin-bottom: 12px;
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.6;
}

/* Inputs */
.input-group {
    margin-bottom: 24px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

input[type="text"],
input[type="password"],
textarea,
select {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    color: #fff;
    font-size: 16px;
    transition: all 0.3s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-light);
    background: rgba(0, 0, 0, 0.4);
}

/* Buttons */
button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    transition: all 0.2s ease;
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary-color), #512da8);
    color: white;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(103, 58, 183, 0.4);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(103, 58, 183, 0.6);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.text-btn {
    background: transparent;
    color: var(--text-secondary);
    padding: 12px;
}

.text-btn:hover {
    color: white;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Questions List */
.questions-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.question-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    position: relative;
    transition: all 0.2s ease;
}

.question-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.question-title {
    font-weight: 600;
    font-size: 16px;
    flex: 1;
    margin-right: 12px;
}

.question-type {
    font-size: 12px;
    background: rgba(103, 58, 183, 0.3);
    color: var(--primary-light);
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.question-options {
    margin-top: 12px;
    padding-left: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.question-options li {
    margin-bottom: 4px;
}

.question-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.question-item:hover .question-actions {
    opacity: 1;
}

.action-btn {
    background: transparent;
    color: var(--text-secondary);
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.action-btn.delete:hover {
    background: rgba(244, 67, 54, 0.2);
    color: var(--danger);
}

/* Edit Mode */
.edit-mode input,
.edit-mode select,
.edit-mode textarea {
    margin-bottom: 12px;
    font-size: 14px;
    padding: 10px;
}

.edit-mode .options-editor {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Step 3 Results */
.success-header {
    text-align: center;
    margin-bottom: 40px;
}

.check-icon {
    width: 80px;
    height: 80px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 24px;
    box-shadow: 0 0 30px rgba(76, 175, 80, 0.4);
}

.check-icon svg {
    width: 40px;
    height: 40px;
    color: white;
}

.tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 12px;
}

.tab-btn {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
}

.tab-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

.code-block-wrapper {
    position: relative;
}

pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 24px;
    border-radius: 16px;
    overflow-x: auto;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    line-height: 1.5;
    color: #a5d6ff;
    max-height: 400px;
    border: 1px solid var(--glass-border);
}

.copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
}

.tutorial-steps {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.step-item {
    display: flex;
    gap: 20px;
}

.step-number {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content h3 {
    font-size: 16px;
    margin-bottom: 4px;
    color: white;
}

.step-content p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.step-content a {
    color: var(--accent-color);
    text-decoration: none;
}

.step-content a:hover {
    text-decoration: underline;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    width: 90%;
    max-width: 500px;
}

.modal h3 {
    margin-bottom: 16px;
}

.modal p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 14px;
}

.hint {
    font-size: 12px;
    margin-top: 8px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.modal-actions button {
    width: auto;
}

/* Utilities */
.hidden {
    display: none !important;
}

.full-width {
    width: 100%;
    margin-top: 24px;
}

.button-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

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

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-message {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: #ff8a80;
    padding: 12px;
    border-radius: 8px;
    margin-top: 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: fadeIn 0.3s ease;
}

.error-message::before {
    content: '!';
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 20px;
    height: 20px;
    background: rgba(244, 67, 54, 0.2);
    border-radius: 50%;
    font-weight: bold;
    flex-shrink: 0;
}

/* Model Selector Styles */
.model-select {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px 12px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.model-select:focus {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
}

.model-select option {
    background: #1a1a1a;
    color: white;
}

.icon-btn-small {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.icon-btn-small:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(180deg);
}

.icon-btn-small:active {
    transform: scale(0.95) rotate(180deg);
}

/* Result Actions */
.result-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.result-actions>* {
    flex: 1;
    min-width: 200px;
    height: 48px;
    font-size: 16px;
}

/* Footer */
footer {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    text-align: center;
    padding: 16px 0;
    color: #64748b;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-top: 40px;
}

footer p {
    margin: 0;
}

footer a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #22d3ee;
}