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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #eee;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Auth Styles */
.auth-container {
    max-width: 400px;
    margin: 80px auto;
    text-align: center;
}

.auth-container h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.tagline {
    color: #888;
    margin-bottom: 30px;
}

.auth-tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.tab {
    background: transparent;
    border: 2px solid #444;
    color: #888;
    padding: 10px 30px;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.2s;
}

.tab.active, .tab:hover {
    border-color: #6c5ce7;
    color: #6c5ce7;
}

.auth-form input {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid #333;
    border-radius: 8px;
    background: #1a1a2e;
    color: #fff;
    font-size: 1rem;
}

.auth-form input:focus {
    outline: none;
    border-color: #6c5ce7;
}

.auth-form button {
    width: 100%;
    padding: 15px;
    background: #6c5ce7;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.auth-form button:hover {
    background: #5b4cdb;
}

#auth-message {
    margin-top: 20px;
    padding: 10px;
    border-radius: 5px;
}

.error {
    background: #e74c3c22;
    color: #e74c3c;
    padding: 15px;
    border-radius: 8px;
}

.success {
    background: #27ae6022;
    color: #27ae60;
    padding: 15px;
    border-radius: 8px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #333;
}

header h1 {
    font-size: 1.8rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-logout {
    color: #888;
    text-decoration: none;
    padding: 8px 15px;
    border: 1px solid #444;
    border-radius: 5px;
    transition: all 0.2s;
}

.btn-logout:hover {
    border-color: #e74c3c;
    color: #e74c3c;
}

.back-link {
    color: #6c5ce7;
    text-decoration: none;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 10px;
}

.back-link:hover {
    text-decoration: underline;
}

/* Quick Add */
.quick-add {
    margin-bottom: 25px;
}

.quick-add form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.quick-add input[type="text"] {
    flex: 1;
    min-width: 150px;
    padding: 15px;
    border: 2px solid #333;
    border-radius: 8px;
    background: #1a1a2e;
    color: #fff;
    font-size: 1rem;
}

.quick-add input:focus {
    outline: none;
    border-color: #6c5ce7;
}

.quick-add button {
    padding: 15px 25px;
    background: #6c5ce7;
    border: none;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.quick-add button:hover {
    background: #5b4cdb;
}

.confidence-input {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: #1a1a2e;
    border-radius: 8px;
    border: 2px solid #333;
}

.confidence-input label {
    font-size: 0.85rem;
    color: #888;
    white-space: nowrap;
}

.confidence-input input[type="range"] {
    width: 100px;
}

/* Filters */
.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.filter {
    background: transparent;
    border: 1px solid #444;
    color: #888;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter.active, .filter:hover {
    border-color: #6c5ce7;
    color: #6c5ce7;
}

/* Quest Cards */
.quest-card {
    background: #1e1e3f;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid #333;
    transition: border-color 0.2s;
}

.quest-card:hover {
    border-color: #444;
}

.quest-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

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

.quest-header h3 {
    font-size: 1.2rem;
    color: #fff;
}

.status {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    font-weight: 600;
}

.status-in_progress {
    background: #f39c1222;
    color: #f39c12;
}

.status-victorious {
    background: #27ae6022;
    color: #27ae60;
}

.status-abandoned {
    background: #e74c3c22;
    color: #e74c3c;
}

.quest-desc {
    color: #aaa;
    margin-bottom: 15px;
    line-height: 1.5;
}

.quest-meta, .quest-meta-bar {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 15px;
}

.quest-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #333;
}

.quest-actions select {
    padding: 8px 12px;
    background: #1a1a2e;
    border: 1px solid #444;
    border-radius: 5px;
    color: #fff;
    cursor: pointer;
}

.btn-delete {
    padding: 8px 15px;
    background: transparent;
    border: 1px solid #e74c3c44;
    border-radius: 5px;
    color: #e74c3c;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-delete:hover {
    background: #e74c3c22;
    border-color: #e74c3c;
}

.btn-edit {
    padding: 8px 15px;
    background: transparent;
    border: 1px solid #6c5ce744;
    border-radius: 5px;
    color: #6c5ce7;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 10px;
}

.btn-edit:hover {
    background: #6c5ce722;
    border-color: #6c5ce7;
}

/* Confidence meters */
.confidence-preview {
    display: flex;
    gap: 20px;
    margin: 15px 0;
}

.mini-meter {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
}

.meter-label {
    color: #888;
    min-width: 45px;
}

.meter-bar {
    width: 60px;
    height: 6px;
    background: #333;
    border-radius: 3px;
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    background: linear-gradient(90deg, #e74c3c 0%, #f39c12 50%, #27ae60 100%);
    border-radius: 3px;
    transition: width 0.3s;
}

.meter-fill.crowd {
    background: linear-gradient(90deg, #3498db 0%, #9b59b6 100%);
}

.meter-pct {
    color: #888;
    min-width: 35px;
}

/* Reaction summary on cards */
.reaction-summary {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.reaction-badge {
    font-size: 0.85rem;
    padding: 2px 8px;
    background: #ffffff11;
    border-radius: 12px;
}

.comment-count {
    font-size: 0.8rem;
    color: #666;
    margin-top: 8px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

/* Quest Detail Page */
.quest-detail {
    background: #1e1e3f;
    border-radius: 12px;
    padding: 30px;
}

.quest-description {
    margin: 20px 0;
    padding: 20px;
    background: #16213e;
    border-radius: 8px;
}

.quest-description p {
    line-height: 1.6;
}

.no-description {
    color: #666;
    font-style: italic;
}

.owner-actions {
    margin: 20px 0;
    padding: 15px;
    background: #16213e;
    border-radius: 8px;
    display: flex;
    gap: 10px;
}

/* Confidence Section */
.confidence-section {
    margin: 30px 0;
    padding: 20px;
    background: #16213e;
    border-radius: 8px;
}

.confidence-section h2 {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.confidence-meters {
    display: grid;
    gap: 20px;
}

.confidence-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.confidence-item label {
    color: #888;
    font-size: 0.9rem;
}

.meter {
    height: 24px;
    background: #333;
    border-radius: 12px;
    overflow: hidden;
}

.meter .meter-fill {
    height: 100%;
}

.meter-value {
    font-size: 1.1rem;
    font-weight: 600;
}

.crowd-desire {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: #888;
}

.prediction-count {
    color: #666;
}

.no-predictions {
    color: #666;
    font-style: italic;
}

/* Prediction Form */
.prediction-form {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #333;
}

.prediction-form h3 {
    margin-bottom: 15px;
    font-size: 1rem;
}

.slider-group {
    margin-bottom: 15px;
}

.slider-group label {
    display: block;
    margin-bottom: 8px;
    color: #888;
    font-size: 0.9rem;
}

.slider-group input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #333;
    outline: none;
    -webkit-appearance: none;
}

.slider-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #6c5ce7;
    cursor: pointer;
}

.prediction-form button {
    padding: 10px 20px;
    background: #6c5ce7;
    border: none;
    border-radius: 5px;
    color: #fff;
    cursor: pointer;
}

.prediction-form button:hover {
    background: #5b4cdb;
}

/* Reactions Section */
.reactions-section {
    margin: 30px 0;
    padding: 20px;
    background: #16213e;
    border-radius: 8px;
}

.reactions-section h2 {
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.reaction-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.reaction-btn {
    padding: 10px 15px;
    font-size: 1.2rem;
    background: #1a1a2e;
    border: 2px solid #333;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.reaction-btn:hover {
    border-color: #6c5ce7;
    transform: scale(1.05);
}

.reaction-btn.active {
    border-color: #6c5ce7;
    background: #6c5ce722;
}

.reaction-btn .count {
    font-size: 0.85rem;
    color: #888;
}

/* Comments Section */
.comments-section {
    margin: 30px 0;
    padding: 20px;
    background: #16213e;
    border-radius: 8px;
}

.comments-section h2 {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.comment-form {
    margin-bottom: 25px;
}

.comment-form textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #333;
    border-radius: 8px;
    background: #1a1a2e;
    color: #fff;
    font-size: 1rem;
    resize: vertical;
    min-height: 80px;
    margin-bottom: 10px;
}

.comment-form textarea:focus {
    outline: none;
    border-color: #6c5ce7;
}

.comment-form button {
    padding: 10px 20px;
    background: #6c5ce7;
    border: none;
    border-radius: 5px;
    color: #fff;
    cursor: pointer;
}

.comment-form button:hover {
    background: #5b4cdb;
}

.comment {
    padding: 15px;
    background: #1a1a2e;
    border-radius: 8px;
    margin-bottom: 10px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.comment-header strong {
    color: #6c5ce7;
}

.comment-date {
    font-size: 0.8rem;
    color: #666;
}

.comment p {
    line-height: 1.5;
    color: #ccc;
}

.no-comments {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Edit Form */
.edit-form-container {
    margin: 20px 0;
    padding: 20px;
    background: #16213e;
    border-radius: 8px;
    border: 2px solid #6c5ce7;
}

.edit-form-container h3 {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #888;
}

.form-group input[type="text"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #333;
    border-radius: 8px;
    background: #1a1a2e;
    color: #fff;
    font-size: 1rem;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group input[type="range"] {
    width: 100%;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.form-actions button {
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

.form-actions button[type="submit"] {
    background: #6c5ce7;
    border: none;
    color: #fff;
}

.form-actions button[type="button"] {
    background: transparent;
    border: 1px solid #444;
    color: #888;
}

/* Responsive */
@media (max-width: 600px) {
    .quick-add form {
        flex-direction: column;
    }

    .quest-header {
        flex-direction: column;
        gap: 10px;
    }

    .quest-actions {
        flex-direction: column;
    }

    .confidence-preview {
        flex-direction: column;
        gap: 10px;
    }

    .reaction-buttons {
        justify-content: center;
    }
}
