:root {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --danger-color: #ef4444;
    --success-color: #22c55e;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    filter: blur(80px);
    border-radius: 50%;
    opacity: 0.6;
    animation: float 20s infinite ease-in-out alternate;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #6366f1;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: #8b5cf6;
    bottom: -200px;
    right: -100px;
    animation-delay: -5s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: #ec4899;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translateY(0) scale(1);
    }

    100% {
        transform: translateY(50px) scale(1.1);
    }
}

.container {
    width: 100%;
    max-width: 500px;
    padding: 2.5rem;
    margin: 1rem;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
    background: linear-gradient(to right, #cfd9df 0%, #e2ebf0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.input-group {
    margin-bottom: 1.5rem;
    width: 100%;
}

.input-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.input-row .input-group {
    margin-bottom: 0;
}

.half-width {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

input {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
    background: rgba(0, 0, 0, 0.4);
}

button {
    width: 100%;
    padding: 0.9rem;
    border-radius: 12px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.39);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid var(--glass-border);
    margin-top: 1rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-admin {
    margin-top: 1rem;
    background: #ec4899;
    box-shadow: 0 4px 14px 0 rgba(236, 72, 153, 0.39);
    color: white;
}

.btn-admin:hover {
    background: #db2777;
}

.hidden {
    display: none !important;
}

.view {
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sortable List */
#choices-list {
    list-style: none;
    padding: 0;
    margin-bottom: 2rem;
}

#choices-list li {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    padding: 1rem 1.2rem;
    margin-bottom: 0.8rem;
    border-radius: 12px;
    cursor: grab;
    display: flex;
    align-items: center;
    transition: transform 0.2s, background 0.2s;
    font-weight: 500;
}

#choices-list li:active {
    cursor: grabbing;
}

#choices-list li:hover {
    background: rgba(255, 255, 255, 0.12);
}

.sortable-ghost {
    opacity: 0.4;
    background: rgba(99, 102, 241, 0.2) !important;
    border-color: var(--primary-color) !important;
}

.rank-badge {
    background: var(--primary-color);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-right: 1rem;
    font-size: 0.9rem;
    font-weight: bold;
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background: var(--success-color);
}

.toast.error {
    background: var(--danger-color);
}

/* Navigation in choices */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.action-buttons button {
    margin: 0;
}

/* Success View */
.success-icon {
    width: 80px;
    height: 80px;
    background: var(--success-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    color: white;
    margin: 0 auto 1.5rem auto;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
    }

    100% {
        transform: scale(1);
    }
}

.saved-choices-display {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1.5rem;
}

.saved-choice-item {
    display: flex;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.saved-choice-item:last-child {
    border-bottom: none;
}

.saved-choice-index {
    color: var(--primary-color);
    font-weight: bold;
    width: 30px;
}