/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background: #0a0a0a;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #e0e0e0;
    background: #0a0a0a;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: #0a0a0a;
    color: white;
    padding: 2rem 0;
    text-align: center;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    color: #888;
    position: relative;
}

.user-menu {
    position: relative;
}

.username-button {
    background: none;
    border: none;
    color: #888;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s;
}

.username-button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.username-button:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.animal-emoji {
    font-size: 1.3rem;
    line-height: 1;
}

.user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 0.75rem;
    min-width: 200px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.user-dropdown.show {
    display: block;
}

.user-email {
    padding: 0.5rem;
    color: #666;
    font-size: 0.85rem;
    border-bottom: 1px solid #333;
    margin-bottom: 0.5rem;
}

.btn-signout {
    display: block;
    width: 100%;
    color: #888;
    text-decoration: none;
    padding: 0.5rem;
    border: 1px solid #444;
    border-radius: 6px;
    transition: all 0.3s;
    font-size: 0.85rem;
    text-align: center;
}

.btn-signout:hover {
    background: #888;
    color: #0a0a0a;
    border-color: #888;
}

header h1 {
    font-family: 'Fredoka One', cursive;
    font-size: 2.5rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
    color: #00d4ff;
    text-shadow: 0 0 30px rgba(0, 212, 255, 0.6);
    margin: 0;
}

.tagline {
    font-size: 1.1rem;
    color: #888;
}

/* Main Content */
main {
    padding: 2rem 0;
    padding-bottom: 8rem;
    min-height: calc(100vh - 300px);
}

/* Post Idea Form */
.post-idea {
    background: #1a1a1a;
    border: 1px solid #222;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.post-idea h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #00ff88;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.form-group {
    margin-bottom: 1rem;
}

textarea, input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    background: #0f0f0f;
    border: 2px solid #333;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    color: #e0e0e0;
    transition: all 0.3s;
}

textarea {
    resize: vertical;
    min-height: 80px;
    max-height: 25vh;
}

textarea:focus, input[type="text"]:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

textarea::placeholder, input[type="text"]::placeholder {
    color: #555;
}

.btn-primary {
    background: #00d4ff;
    color: #0a0a0a;
    border: none;
    padding: 0.75rem 2rem;
    font-family: 'Fredoka One', cursive;
    font-size: 1rem;
    font-weight: 400;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.6);
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: #1a1a1a;
    padding: 0.5rem;
    border-radius: 12px;
    border: 1px solid #222;
}

.filter-tabs a {
    flex: 1;
    text-align: center;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: #888;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s;
}

.filter-tabs a:hover {
    background: #252525;
    color: #fff;
}

.filter-tabs a.active {
    background: #1f1f1f;
    color: #fff;
    border-bottom: 2px solid #00d4ff;
}

/* Ideas List */
.ideas-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 3rem;
}

.no-ideas {
    background: #1a1a1a;
    border: 1px solid #222;
    padding: 3rem 2rem;
    text-align: center;
    border-radius: 12px;
    color: #666;
}

.idea-card {
    background: #1a1a1a;
    border: 1px solid #222;
    border-radius: 12px;
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all 0.3s;
    position: relative;
}

.idea-card:hover {
    transform: translateY(-2px);
    border-color: #00ff88;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.5);
}

.idea-content {
    flex: 1;
}

.idea-content .content {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: #e0e0e0;
    line-height: 1.5;
}

.idea-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: #666;
}

.idea-meta .author {
    font-weight: 500;
    color: #666;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-follow {
    background: none;
    border: none;
    color: #666;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    margin: 0;
    line-height: 1;
    transition: all 0.3s;
}

.btn-follow:hover {
    color: #ffd700;
    transform: scale(1.2);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}

.btn-follow.following {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.btn-follow.following:hover {
    color: #666;
    transform: scale(1.1);
    text-shadow: none;
}

.btn-follow.own-idea {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
    cursor: default;
}

/* Engagement Section */
.idea-engagement {
    display: flex;
    align-items: center;
    padding-top: 0.75rem;
}

/* Voting */
.idea-voting {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 140px;
}

.vote-form {
    display: flex;
    gap: 0.5rem;
    flex-direction: row;
    width: 100%;
    flex-wrap: wrap;
    position: relative;
}

.btn-vote {
    border: 2px solid;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Fredoka One', cursive;
    font-size: 0.85rem;
    font-weight: 400;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f0f0f;
    flex: 1;
    min-width: 90px;
    position: relative;
}

/* Super Silly - brightest green (+2) */
.btn-vote[name="voteType"][value="supersilly"] {
    border-color: #00ff88;
    color: #00ff88;
}

.btn-vote[name="voteType"][value="supersilly"]:hover {
    background: #00ff88;
    color: #0a0a0a;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}

.btn-vote[name="voteType"][value="supersilly"].voted {
    background: #00ff88;
    color: #0a0a0a;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}

/* Silly - cyan/blue (+1) */
.btn-vote[name="voteType"][value="silly"] {
    border-color: #00aaff;
    color: #00aaff;
}

.btn-vote[name="voteType"][value="silly"]:hover {
    background: #00aaff;
    color: #0a0a0a;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 170, 255, 0.5);
}

.btn-vote[name="voteType"][value="silly"].voted {
    background: #00aaff;
    color: #0a0a0a;
    box-shadow: 0 0 20px rgba(0, 170, 255, 0.5);
}

/* Meh - purple/magenta (0) */
.btn-vote[name="voteType"][value="meh"] {
    border-color: #bb00ff;
    color: #bb00ff;
}

.btn-vote[name="voteType"][value="meh"]:hover {
    background: #bb00ff;
    color: #0a0a0a;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(187, 0, 255, 0.5);
}

.btn-vote[name="voteType"][value="meh"].voted {
    background: #bb00ff;
    color: #0a0a0a;
    box-shadow: 0 0 20px rgba(187, 0, 255, 0.5);
}

/* Kinda Silly - orange (-1) */
.btn-vote[name="voteType"][value="kindasilly"] {
    border-color: #ff8800;
    color: #ff8800;
}

.btn-vote[name="voteType"][value="kindasilly"]:hover {
    background: #ff8800;
    color: #0a0a0a;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 136, 0, 0.5);
}

.btn-vote[name="voteType"][value="kindasilly"].voted {
    background: #ff8800;
    color: #0a0a0a;
    box-shadow: 0 0 20px rgba(255, 136, 0, 0.5);
}

/* Not Silly - red (-2) */
.btn-vote[name="voteType"][value="notsilly"] {
    border-color: #ff0055;
    color: #ff0055;
}

.btn-vote[name="voteType"][value="notsilly"]:hover {
    background: #ff0055;
    color: #0a0a0a;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 0, 85, 0.5);
}

.btn-vote[name="voteType"][value="notsilly"].voted {
    background: #ff0055;
    color: #0a0a0a;
    box-shadow: 0 0 20px rgba(255, 0, 85, 0.5);
}

.net-score {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #666;
}

/* Confetti Animation */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti {
    /* Size and position set by JavaScript */
}

/* Idea Menu */
.idea-menu {
    position: absolute;
    top: 1rem;
    right: 4rem;
}

.btn-idea-menu {
    background: none;
    border: none;
    color: #666;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.3s;
    line-height: 1;
}

.btn-idea-menu:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.idea-menu-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    background: #252525;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 0.25rem;
    min-width: 100px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.idea-menu-dropdown.show {
    display: block;
}

.menu-item-delete {
    display: block;
    width: 100%;
    background: none;
    border: none;
    color: #ccc;
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.menu-item-delete:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Auth Forms */
.auth-container {
    min-height: calc(100vh - 300px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

.auth-card {
    background: #1a1a1a;
    border: 1px solid #222;
    border-radius: 12px;
    padding: 2.5rem;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.auth-card.register-card {
    max-width: 600px;
}

.auth-card h2 {
    font-family: 'Fredoka One', cursive;
    font-size: 1.8rem;
    color: #00d4ff;
    text-align: center;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

.auth-card h4 {
    text-align: center;
    color: #888;
    font-weight: 400;
    font-size: 1rem;
    margin-bottom: 2rem;
}

.auth-card .auth-message {
    background: rgba(255, 136, 0, 0.1);
    border: 1px solid #ff8800;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    color: #ff8800;
    text-align: center;
    font-size: 0.9rem;
}

.auth-card .username-display {
    background: #0f0f0f;
    border: 2px solid #333;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 500;
    color: #00d4ff;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: #888;
    font-size: 0.9rem;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 0.75rem;
    background: #0f0f0f;
    border: 2px solid #333;
    border-radius: 8px;
    font-size: 1rem;
    color: #e0e0e0;
    transition: all 0.3s;
    margin-bottom: 1rem;
}

input[type="text"]:disabled,
input[type="email"]:disabled,
input[type="password"]:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

.form-hint {
    display: block;
    color: #666;
    font-size: 0.85rem;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
}

.text-danger {
    background: rgba(255, 0, 85, 0.1);
    border: 1px solid #ff0055;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    color: #ff0055;
    font-size: 0.9rem;
}

.text-danger:empty {
    display: none;
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

.auth-footer a {
    color: #00d4ff;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}

.auth-footer a:hover {
    color: #00ff88;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

/* Animal Selection */
.animal-selection {
    margin-bottom: 1.5rem;
}

.required-step {
    color: #ff0055;
    font-size: 1.2rem;
}

.animal-instruction {
    color: #666;
    font-size: 0.9rem;
    margin-top: 0.25rem;
    margin-bottom: 0.75rem;
}

.animal-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.animal-option {
    cursor: pointer;
    position: relative;
    background: #0f0f0f;
    border: 2px solid #333;
    border-radius: 12px;
    padding: 1rem 0.5rem;
    text-align: center;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.animal-option:hover {
    border-color: #00d4ff;
    background: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.2);
}

.animal-option.dimmed {
    opacity: 0.4;
    filter: grayscale(50%);
}

.animal-option.dimmed:hover {
    opacity: 0.6;
}

.animal-option.selected {
    opacity: 1;
    filter: none;
    border-color: #00ff88;
    background: rgba(0, 255, 136, 0.05);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.animal-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.animal-option.selected .animal-icon {
    transform: scale(1.2);
}

.animal-icon {
    font-size: 2.5rem;
    transition: all 0.3s;
    line-height: 1;
}

.animal-name {
    font-size: 0.85rem;
    color: #888;
    font-weight: 500;
    transition: all 0.3s;
}

.animal-option.selected .animal-name {
    color: #00ff88;
}

.username-preview {
    display: none;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #0f0f0f;
    border: 2px solid #00d4ff;
    border-radius: 8px;
    text-align: center;
    color: #00d4ff;
    font-weight: 500;
    font-size: 0.95rem;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
}

@media (max-width: 600px) {
    .animal-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .auth-card.register-card {
        padding: 2rem 1.5rem;
    }
}

.btn-primary {
    width: 100%;
    background: #00d4ff;
    color: #0a0a0a;
    border: none;
    padding: 0.875rem;
    font-family: 'Fredoka One', cursive;
    font-size: 1.1rem;
    font-weight: 400;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
    margin-top: 0.5rem;
    position: relative;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.6);
}

.btn-primary:disabled:not(.loading) {
    cursor: not-allowed;
    background: #0a0a0a;
    color: #333;
    border: 2px solid #222;
    box-shadow: none;
    transform: none;
    opacity: 0.4;
}

.btn-primary.loading {
    cursor: not-allowed;
    background: #0a0a0a;
    color: #00d4ff;
    border: 2px solid #00d4ff;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.6);
    transform: none;
}

.btn-primary.loading::after {
    content: '';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.2rem;
    height: 1.2rem;
    border: 2px solid #00d4ff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* Footer */
footer {
    background: #0a0a0a;
    color: #666;
    padding: 1.5rem 0;
    text-align: center;
    margin-top: 2rem;
}

footer p {
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 600px) {
    header h1 {
        font-size: 2rem;
    }
    
    .filter-tabs {
        flex-wrap: wrap;
    }
    
    .filter-tabs a {
        flex: 1 1 45%;
    }
}

/* Terms of Service page styles */
.tos-page {
    padding: 2.5rem 0;
}
.tos-title {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #fff;
}
.tos-summary {
    color: #dcdcdc;
    font-size: 1.05rem;
    margin-bottom: 1.25rem;
    line-height: 1.6;
}
.tos-subhead {
    color: #fff;
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
}
.tos-list {
    padding-left: 1.25rem; /* restore list indent removed by global reset */
    margin-bottom: 1rem;
    color: #e0e0e0;
}
.tos-list li {
    margin-bottom: 0.6rem;
    line-height: 1.5;
}
.tos-note {
    margin-top: 0.75rem;
    color: #bdbdbd;
}
.tos-page .btn {
    display: inline-block;
    margin-top: 1rem;
    background: transparent;
    color: #00d4ff;
    text-decoration: underline;
}
