/* Custom styles for Idea Board */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Idea card hover effect */
.idea-card {
    transition: all 0.2s ease;
    will-change: transform;
}

.idea-card:hover {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Prevent flash during reordering */
#ideasList {
    position: relative;
    min-height: 100px;
}

#ideasList .idea-card {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    position: relative;
    z-index: 1;
}

/* Ensure smooth reordering */
#ideasList .idea-card.idea-reordering {
    z-index: 10;
}

/* Reddit-style compact design */
.upvote-section {
    min-width: 40px;
}

.idea-card p {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Make vote count more prominent when voted */
.vote-count {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-weight: 700;
}

/* Reordering animation - subtle */
.idea-reordering {
    animation: pulse-reorder 0.8s ease-out;
}

@keyframes pulse-reorder {
    0%, 100% {
        background-color: #ffffff;
        border-color: #e5e7eb;
    }
    50% {
        background-color: #f9fdf7;
        border-color: #e8f0e0;
        box-shadow: 0 0 0 1px rgba(144, 212, 8, 0.12);
    }
}

/* Upvote button base styles */
.upvote-btn {
    transition: all 0.15s ease;
    cursor: pointer;
    border: none;
}

.upvote-btn:active:not(:disabled) {
    transform: scale(1.05);
}

/* Unvoted state - outline circle */
.upvote-unvoted {
    background: transparent;
    border: 2px solid #d1d5db;
    border-radius: 50%;
}

.upvote-unvoted:hover {
    border-color: #90D408;
    background-color: rgba(144, 212, 8, 0.1);
}

/* Voted state - filled green circle with white arrow */
.upvote-voted {
    background-color: #90D408;
    border: 2px solid #90D408;
    border-radius: 50%;
    cursor: default;
}

/* Textarea custom styling */
textarea {
    resize: vertical;
    min-height: 70px;
    font-size: 14px;
}

textarea:focus {
    box-shadow: none;
}

/* Character counter warning state */
.char-count-warning {
    color: #FDB913;
    font-weight: 600;
}

.char-count-error {
    color: #DC2626;
    font-weight: 600;
}

/* Loading animation for spinner */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.fa-spinner {
    animation: spin 1s linear infinite;
}

/* Fade in animation for new ideas - subtle */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Custom scrollbar for textarea */
textarea::-webkit-scrollbar {
    width: 8px;
}

textarea::-webkit-scrollbar-track {
    background: #F5F5F5;
    border-radius: 4px;
}

textarea::-webkit-scrollbar-thumb {
    background: #808285;
    border-radius: 4px;
}

textarea::-webkit-scrollbar-thumb:hover {
    background: #1A5632;
}

/* Responsive adjustments - keep upvote on left on mobile */
@media (max-width: 640px) {
    .idea-card {
        flex-direction: row;
        align-items: flex-start;
    }

    .upvote-section {
        flex-direction: column;
        align-items: center;
        flex-shrink: 0;
    }
}

/* Error message styling */
.error-message {
    background-color: #FEE2E2;
    border-left: 4px solid #DC2626;
    color: #991B1B;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    animation: fadeIn 0.3s ease-out;
}

.error-message i {
    margin-right: 0.5rem;
}

/* Success message styling */
.success-message {
    background-color: #D1FAE5;
    border-left: 4px solid #10B981;
    color: #065F46;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    animation: fadeIn 0.3s ease-out;
}

.success-message i {
    margin-right: 0.5rem;
}
