/* Global Resets and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --background-color: #f8f8f8;
    --text-color: #121212;
    --primary-green: #03ff29bb; /* LightGreen */
    --primary-purple: #d097fc; /* Thistle */
    --pixel-font: 'Press Start 2P', cursive;
    --body-font: 'Inter', sans-serif;
}

body {
    font-family: var(--body-font);
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    /* Account for iOS notch safe areas when in standalone */
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* When in questions view, prevent body scrolling and pull-to-refresh */
body.lock-scroll {
    overflow: hidden; /* Disable normal scroll */
    overscroll-behavior: contain; /* Prevent bounce / refresh on supported browsers */
    touch-action: none; /* Prevent default gestures; per-element overrides below */
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
}

h1 {
    font-size: 1.8rem;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    text-align: center;
    font-family: var(--body-font);
    font-weight: bold;
}

p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

a {
    color: #555;
    text-decoration: none;
}

a:hover {
    color: #000;
    text-decoration: underline;
}

/* Header */
header {
    background-color: var(--background-color);
    color: var(--text-color);
    padding: 1rem 0.75rem;
    text-align: center;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    border-bottom: 1px solid #eee;
    padding-top: calc(1rem + env(safe-area-inset-top));
}

header h1 {
    margin: 0;
    font-size: 1.25rem;
    font-family: var(--pixel-font);
}

/* Main Content Area */
main#app-root {
    flex-grow: 1;
    padding: 5rem 0.75rem 6rem;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    background-color: transparent;
}

section {
    padding: 1rem 0;
    margin-bottom: 1rem;
}

section:last-child {
    margin-bottom: 0;
}

/* Bottom Tab Navigation */
#bottom-tab-nav {
    position: fixed;
    /* Lift a bit above iPhone home indicator while respecting safe area */
    bottom: calc(env(safe-area-inset-bottom));
    left: 0;
    width: 100%;
    background-color: #fff;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid #eee;
    z-index: 1000;
    padding-top: 0.5rem;
    padding-bottom: 1rem;
}

#bottom-tab-nav .nav-button {
    background-color: transparent;
    color: #888;
    border: none;
    padding: 0.5rem 0.25rem;
    cursor: pointer;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

#bottom-tab-nav .nav-icon {
    font-family: var(--pixel-font);
    font-size: 1.5rem;
}

#bottom-tab-nav .nav-label {
    font-size: 0.7rem;
    font-family: var(--body-font);
}

#bottom-tab-nav .nav-button:hover {
    color: #000;
}

#bottom-tab-nav .nav-button.active {
    color: #000;
    font-weight: bold;
}

/* Notification Badge for Navigation Buttons */
#bottom-tab-nav .nav-button {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: 0.1rem;
    right: 1rem;
    background-color: #ff4444;
    color: white;
    font-size: 0.6rem;
    font-weight: bold;
    font-family: var(--body-font);
    padding: 0.15rem 0.35rem;
    border-radius: 50px;
    min-width: 1.2rem;
    height: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 1px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.notification-badge:empty {
    display: none;
}

/* General Button Styling */
button, .button {
    font-family: var(--body-font);
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    font-weight: 500;
    text-align: center;
}

button.pixel-button {
    font-family: var(--pixel-font);
    border: 2px solid #000;
    background-color: #fff;
    color: #000;
    padding: 0.75rem 1.5rem;
    box-shadow: 4px 4px 0px #000;
    transition: all 0.2s ease;
}

button.pixel-button:hover {
    box-shadow: 2px 2px 0px #000;
    transform: translate(2px, 2px);
}

/* Auth View */
#auth-view .auth-box {
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
}

#auth-view h2 {
    font-family: var(--body-font);
    font-weight: bold;
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

#auth-view input {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
}

.error-message {
    color: #D8000C; /* Red for errors */
    font-size: 0.9rem;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
    min-height: 1em; /* Prevents layout shift */
}

/* Profile View */
#profile-view h2 {
    text-align: center;
    font-family: var(--body-font);
    font-weight: bold;
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

#user-profile-details {
    text-align: center;
}

.profile-image-container {
    position: relative;
    width: 100vw;
    margin-left: -0.75rem;
    margin-right: -0.75rem;
    margin-bottom: 2rem;
}

#user-profile-photo-display {
    width: 100%;
    height: 250px;
    object-fit: cover;
    /* Removed circular crop to show full image */
    border-radius: 0;
    display: block;
}

.profile-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 12px;
    font-family: var(--pixel-font);
    text-shadow: 1px 1px 0px #000;
}

#user-profile-name {
    font-size: 1rem;
    font-weight: bold;
    display: block;
    margin-bottom: 0.2rem;
    text-transform: uppercase;
}

#user-profile-position {
    font-size: 0.8rem;
    margin: 0;
    text-transform: uppercase;
}

.stats-bar {
    background-color: var(--primary-green);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 2rem;
    margin-left: 10%;
    margin-right: 10%;
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
}

.stat-label {
    font-size: 0.8rem;
    color: #333;
}

.pixel-heart {
    font-family: var(--pixel-font);
    font-size: 2rem;
    color: #000;
}

#avatar-selection-profile {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    margin-bottom: 2rem;
}

#avatar-selection-profile img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    object-fit: cover;
    object-position: center;
}

#avatar-selection-profile img.selected {
    border-color: var(--primary-green);
}

/* Question Swipe View */
#question-view {
    text-align: center;
}

.swipe-container {
    position: relative;
    width: 90%;
    max-width: 450px;
    margin: 1rem auto;
    height: calc(75vh - 10rem);
    display: flex;
    align-items: center;
    justify-content: center;
}

#swipe-card {
    position: absolute;
    width: 65%;
    height: 70%;
    min-height: 280px;
    background-color: var(--primary-green);
    color: var(--text-color);
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-left: 2.5rem;
    padding-right: 2.5rem;
    padding-top: 2rem;
    padding-bottom: 2rem;
    font-size: 1.0rem;
    font-weight: 500;
    line-height: 1.5;
    cursor: grab;
    user-select: none;
    z-index: 1;
    transition: transform 0.3s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    /* Allow pan gestures on the card itself while body is locked */
    touch-action: none; /* Explicitly manage all touch gestures for smooth swipe */
}

#question-text {
    width: 100%;
    max-height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.answer-options {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.answer-option {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--text-color);
    background-color: var(--primary-purple);
    border-radius: 8px;
    padding: 0.8rem;
    width: 45%;
    height: 18%;
    z-index: 2;
    text-align: center;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    overflow: hidden;
}

.answer-option[data-direction="top"] { 
    top: 0.5rem; 
    left: 50%;
    width: 50%;
    transform: translateX(-50%);
}
.answer-option[data-direction="right"] { 
    right: -2rem; 
    width: 35%; 
    height: 30%;
    top: 50%;
    margin-right: 0.5rem;
    transform: translateY(-50%);
}
.answer-option[data-direction="bottom"] { 
    bottom: 0.5rem; 
    left: 50%;
    width: 50%;
    transform: translateX(-50%);
}
.answer-option[data-direction="left"] { 
    left: -2rem; 
    width: 35%; 
    height: 30%;
    top: 50%;
    margin-left: 0.5rem;
    transform: translateY(-50%);
}

/* Leaderboard View */
#leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    background-color: #fff;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.leaderboard-rank {
    font-size: 1.5rem;
    font-weight: bold;
    margin-right: 1rem;
}

.leaderboard-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 1rem;
    object-fit: cover;
    object-position: center;
}

.leaderboard-info {
    flex-grow: 1;
}

.leaderboard-name {
    font-weight: bold;
}

.leaderboard-matches {
    color: #555;
}

/* My Matches View */
#my-matches-view {
    text-align: center;
}

#my-matches-view h2 {
    font-family: var(--pixel-font);
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

#matches-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

/* No matches message styling */
#matches-list p {
    grid-column: 1 / -1;
    background-color: var(--primary-purple);
    border: 2px solid #000;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 400px;
    font-family: var(--pixel-font);
    font-size: 1rem;
    color: var(--text-color);
    box-shadow: 4px 4px 0px #000;
    line-height: 1.6;
}

.match-item {
    background-color: #fff;
    border: 2px solid #000;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    box-shadow: 4px 4px 0px #000;
}

.match-item .avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    object-fit: cover;
    object-position: center;
}

.match-item .match-name {
    font-family: var(--pixel-font);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.match-item .match-position {
    font-size: 0.8rem;
    color: #777; /* Added styling for position */
    margin-bottom: 0.5rem;
}

.match-item .match-common-answers {
    font-size: 0.8rem;
    color: #555;
}

/* Common Questions in Matched Profile */
#matched-common-questions-container {
    background:#f4f4f4;
    border:1px solid #ddd;
    border-radius:8px;
    padding:0.75rem 0.85rem;
    font-size:0.85rem;
}
#matched-common-questions li { 
    margin-bottom:0.5rem; 
    line-height:1.3;
    background:#fff; 
    border:1px solid #ccc; 
    border-radius:6px; 
    padding:0.5rem 0.6rem; 
}
#matched-common-questions li:last-child { margin-bottom:0; }
#matched-common-questions .q-text { font-weight:600; display:block; margin-bottom:2px; }
#matched-common-questions .a-text { color:#333; font-style:italic; }

/* Matched User Profile View (Modal or separate section) */
#matched-user-profile-view {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
    padding: 1rem;
}

#matched-user-details {
    background-color: #fff;
    padding: 2rem;
    border-radius: 12px;
    color: var(--text-color);
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.25);
    border: 2px solid #000;
    margin: auto;
    position: relative;
}

#matched-user-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-bottom: 1rem;
    object-fit: cover;
    border: 3px solid var(--primary-green);
}

#matched-user-details p {
    margin-bottom: 0.75rem;
}

#matched-user-details strong {
    color: var(--text-color);
}

#close-matched-profile {
    margin-top: 1rem;
    background-color: var(--primary-purple);
    color: var(--text-color);
    border: 2px solid #000;
    box-shadow: 4px 4px 0px #000;
}

#close-matched-profile:hover {
    box-shadow: 2px 2px 0px #000;
    transform: translate(2px, 2px);
}


/* Match Celebration Modal */
#match-celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
}

#match-celebration-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

#match-celebration-modal {
    background-color: #fff;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    color: var(--text-color);
    width: 90%;
    max-width: 380px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease-in-out;
}

#match-celebration-overlay.visible #match-celebration-modal {
    transform: scale(1);
}

#match-celebration-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 3px solid var(--primary-green);
}

#match-celebration-modal h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

#match-celebration-modal p {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

#match-celebration-modal #match-celebration-close {
    margin-top: 1.5rem;
    width: 100%;
}

/* Confetti Animation */
.confetti-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1; /* behind modal content if we set modal higher */
}

#match-celebration-modal { position: relative; z-index: 2; }

.confetti-piece {
    position: absolute;
    top: -10px;
    width: 10px;
    height: 16px;
    background-color: var(--primary-green);
    opacity: 0.9;
    border-radius: 2px;
    animation: confetti-fall linear forwards;
    will-change: transform;
}

@keyframes confetti-fall {
    0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* No More Questions View */
#no-more-questions-view {
    text-align: center;
    padding: 2rem;
}

#no-more-questions-view h2 {
    font-family: var(--pixel-font);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

#no-more-questions-view p {
    margin-bottom: 2rem;
}


/* Profile Creation View */
#profile-creation-view {
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
}

#profile-creation-view h2 {
    font-family: var(--pixel-font);
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

#profile-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

#profile-form > div {
    text-align: left;
}

#profile-form label {
    font-family: var(--pixel-font);
    font-size: 0.8rem;
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

#profile-form input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #000;
    border-radius: 6px;
    font-size: 1rem;
    box-shadow: 4px 4px 0px #000;
    background-color: #fff;
    transition: all 0.2s ease;
}

#profile-form input[type="text"]:focus {
    outline: none;
    box-shadow: 2px 2px 0px #000;
    transform: translate(2px, 2px);
}

#profile-form input[type="file"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #000;
    border-radius: 6px;
    background-color: var(--primary-purple);
    font-size: 1rem;
    box-shadow: 4px 4px 0px #000;
    cursor: pointer;
}

#profile-form input[type="file"]:hover {
    box-shadow: 2px 2px 0px #000;
    transform: translate(2px, 2px);
}

#avatar-selection {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
    justify-items: center;
}

#avatar-selection img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    object-fit: cover;
    object-position: center;
}

#avatar-selection img:hover {
    border-color: var(--primary-green);
    transform: scale(1.1);
}

#avatar-selection img.selected {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(144, 238, 144, 0.3);
}

#profile-form > div:has(p) {
    text-align: center;
}

#profile-form > div p {
    font-family: var(--pixel-font);
    font-size: 0.8rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

#profile-form button[type="submit"] {
    font-family: var(--pixel-font);
    border: 2px solid #000;
    background-color: var(--primary-green);
    color: #000;
    padding: 1rem 2rem;
    font-size: 1rem;
    border-radius: 6px;
    box-shadow: 4px 4px 0px #000;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 1rem;
}

#profile-form button[type="submit"]:hover {
    box-shadow: 2px 2px 0px #000;
    transform: translate(2px, 2px);
}

/* Hide other sections by default */
#event-code-view, #profile-creation-view {
    display: none;
}

/* Profile Update View - Same styling as Profile Creation */
#profile-update-view {
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
}

#profile-update-view h2 {
    font-family: var(--pixel-font);
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

#profile-update-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

#profile-update-form > div {
    text-align: left;
}

#profile-update-form > div:last-child {
    text-align: center;
    margin-top: 1rem;
}

#profile-update-form label {
    font-family: var(--pixel-font);
    font-size: 0.8rem;
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

#profile-update-form input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #000;
    border-radius: 6px;
    font-size: 1rem;
    box-shadow: 4px 4px 0px #000;
    background-color: #fff;
    transition: all 0.2s ease;
}

#profile-update-form input[type="text"]:focus {
    outline: none;
    box-shadow: 2px 2px 0px #000;
    transform: translate(2px, 2px);
}

#profile-update-form input[type="file"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #000;
    border-radius: 6px;
    background-color: var(--primary-purple);
    font-size: 1rem;
    box-shadow: 4px 4px 0px #000;
    cursor: pointer;
}

#profile-update-form input[type="file"]:hover {
    box-shadow: 2px 2px 0px #000;
    transform: translate(2px, 2px);
}

/* Mobile and small screen optimizations */
/* @media screen and (max-width: 768px) {
    .swipe-container {
        height: calc(80vh - 8rem);
        width: 95%;
    }
    
    #swipe-card {
        width: 75%;
        height: 75%;
        min-height: 320px;
        padding-top: 2.5rem;
        padding-bottom: 2.5rem;
        font-size: 1.1rem;
        line-height: 1.6;
    }
    
    .answer-option {
        font-size: 0.8rem;
        padding: 0.6rem;
        width: 40%;
        height: 16%;
    }
    
    .answer-option[data-direction="right"], 
    .answer-option[data-direction="left"] {
        width: 32%;
        height: 22%;
    }
}

@media screen and (max-width: 480px) {
    .swipe-container {
        height: calc(85vh - 6rem);
        width: 98%;
    }
    
    #swipe-card {
        width: 80%;
        height: 80%;
        min-height: 350px;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
        padding-top: 3rem;
        padding-bottom: 3rem;
        font-size: 1rem;
        line-height: 1.7;
    }
    
    .answer-option {
        font-size: 0.75rem;
        padding: 0.5rem;
        width: 38%;
        height: 14%;
    }
    
    .answer-option[data-direction="top"], 
    .answer-option[data-direction="bottom"] {
        width: 42%;
    }
    
    .answer-option[data-direction="right"], 
    .answer-option[data-direction="left"] {
        width: 30%;
        height: 20%;
    }
    
    .answer-option[data-direction="right"] { 
        right: -2.5rem; 
    }
    .answer-option[data-direction="left"] { 
        left: -2.5rem; 
    }
} */

/* Landscape orientation on mobile */
/* @media screen and (max-height: 600px) and (orientation: landscape) {
    .swipe-container {
        height: calc(90vh - 4rem);
    }
    
    #swipe-card {
        min-height: 200px;
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }
} */

/* ================================
   ADMIN PANEL STYLES
   ================================ */

/* Admin Layout */
.admin-header {
    background-color: #1a1a1a;
    color: #ffffff;
    padding: 1rem 1.5rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 1px solid #333;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.admin-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.admin-header h1 {
    margin: 0;
    font-size: 1.25rem;
    font-family: var(--pixel-font);
    color: #ffffff;
}

.admin-main {
    flex-grow: 1;
    padding-top: 5rem;
    padding-bottom: 2rem;
    background-color: #f5f5f5;
    min-height: 100vh;
}

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Admin Cards */
.admin-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.admin-card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.admin-card-header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.4rem;
    font-weight: 600;
    text-align: left;
}

.admin-card-subtitle {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9rem;
    color: #ffffff;
    text-align: left;
}

.admin-card-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.admin-card-body {
    padding: 2rem;
}

.admin-dashboard {
    display: grid;
    gap: 2rem;
}

/* Admin Forms */
.admin-form-group {
    margin-bottom: 1.5rem;
}

.admin-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.admin-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: #ffffff;
}

.admin-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.admin-input::placeholder {
    color: #999;
}

.admin-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.admin-help-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #666;
}

/* Admin Buttons */
.admin-button {
    font-family: var(--body-font);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    white-space: nowrap;
}

.admin-button.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
}

.admin-button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.admin-button.secondary {
    background-color: #ffffff;
    color: #333;
    border: 1px solid #ddd;
}

.admin-button.secondary:hover {
    background-color: #f8f9fa;
    border-color: #bbb;
}

.admin-button.destructive {
    background-color: #dc3545;
    color: #ffffff;
}

.admin-button.destructive:hover {
    background-color: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.admin-button.small {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.admin-button.full-width {
    width: 100%;
}

.admin-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.admin-button-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Admin Question Form */
.admin-question-form {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.admin-swipe-options {
    margin: 1.5rem 0;
}

.admin-swipe-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.admin-swipe-option {
    position: relative;
}

.admin-swipe-option label {
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 6px 6px 0 0;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    display: block;
    margin-bottom: 0;
}

.admin-swipe-option.top label {
    background-color: #e8f4fd;
    border-color: #bee5eb;
    color: #0c5460;
}

.admin-swipe-option.right label {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.admin-swipe-option.bottom label {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.admin-swipe-option.left label {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.admin-swipe-option .admin-input {
    border-radius: 0 0 6px 6px;
    border-top: none;
}

/* Admin Messages */
.admin-error-message {
    color: #dc3545;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    padding: 0.75rem;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    display: none;
}

.admin-error-message:not(:empty) {
    display: block;
}

.admin-status-message {
    font-size: 0.9rem;
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid transparent;
    display: none;
}

.admin-status-message:not(:empty) {
    display: block;
}

.admin-status-message.success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.admin-status-message.error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.admin-status-message.info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* Admin Divider */
.admin-divider {
    position: relative;
    text-align: center;
    margin: 1rem 0;
}

.admin-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #ddd;
}

.admin-divider span {
    background-color: #ffffff;
    padding: 0 1rem;
    color: #666;
    font-size: 0.9rem;
}

/* Admin Badge */
.admin-badge {
    background-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Admin Questions List */
.admin-questions-list {
    max-height: 500px;
    overflow-y: auto;
}

.admin-question-item {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    position: relative;
    transition: all 0.2s ease;
}

.admin-question-item:last-child {
    margin-bottom: 0;
}

.admin-question-item.editing {
    background-color: #fff8e1;
    border-color: #ffcc02;
    box-shadow: 0 0 0 2px rgba(255, 204, 2, 0.2);
}

.admin-question-item.saving {
    background-color: #e3f2fd;
    border-color: #2196f3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.admin-question-text {
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.admin-question-text.editable {
    display: none;
}

.admin-question-text-edit {
    display: none;
    margin-bottom: 1rem;
}

.admin-question-text-edit.active {
    display: block;
}

.admin-question-text-edit input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
}

.admin-question-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.admin-question-option {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    border: 1px solid #ddd;
    position: relative;
}

.admin-question-option.top {
    background-color: #e8f4fd;
    border-color: #bee5eb;
}

.admin-question-option.right {
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.admin-question-option.bottom {
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.admin-question-option.left {
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.admin-question-option strong {
    display: block;
    font-size: 0.7rem;
    opacity: 0.8;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-question-option-text {
    display: block;
}

.admin-question-option-edit {
    display: none;
    margin-top: 0.25rem;
}

.admin-question-option-edit.active {
    display: block;
}

.admin-question-option-edit input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.85rem;
    background-color: #ffffff;
}

.admin-question-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.admin-question-actions.editing {
    justify-content: space-between;
}

.admin-question-actions .admin-button-group {
    display: flex;
    gap: 0.5rem;
}

/* Empty State */
.admin-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.admin-empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.admin-empty-state h3 {
    margin-bottom: 0.5rem;
    color: #333;
}

.admin-empty-state p {
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .admin-container {
        padding: 0 1rem;
    }
    
    .admin-header-content {
        padding: 0 1rem;
    }
    
    .admin-form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .admin-swipe-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-question-options {
        grid-template-columns: 1fr;
    }
    
    .admin-card-body {
        padding: 1.5rem;
    }
    
    .admin-card-header {
        padding: 1rem;
    }
    
    .admin-card-header-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .admin-button-group {
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .admin-main {
        padding-top: 4rem;
    }
    
    .admin-header {
        padding: 0.75rem 1rem;
    }
    
    .admin-header h1 {
        font-size: 1rem;
    }
    
    .admin-card {
        margin-bottom: 1.5rem;
    }
}
