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

/* Universal hidden class to prevent flash of content */
.hidden {
    display: none !important;
}

/* Page loading state - hides all modals until JS is ready */
body.loading .auth-modal,
body.loading .data-card,
body.loading .action-menu,
body.loading .connection-action-menu,
body.loading .add-idea-form,
body.loading .delete-confirmation-modal,
body.loading .wizards-modal,
body.loading .share-modal {
    display: none !important;
}

body {
    font-family: 'Arial', sans-serif;
    background: #000000;
    overflow: hidden;
    height: 100vh;
}

/* Loading Spinner Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.8s ease-out, visibility 0.8s ease-out;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

/* Modern 3-Ring Spinner */
.modern-spinner {
    position: relative;
    width: 120px;
    height: 120px;
}

.spinner-ring {
    position: absolute;
    border: 3px solid transparent;
    border-radius: 50%;
    animation: spin 2s linear infinite;
}

.spinner-ring:nth-child(1) {
    width: 120px;
    height: 120px;
    border-top: 3px solid #ffffff;
    border-right: 3px solid #ffffff;
    animation-duration: 2s;
}

.spinner-ring:nth-child(2) {
    width: 90px;
    height: 90px;
    top: 15px;
    left: 15px;
    border-top: 3px solid #cccccc;
    border-left: 3px solid #cccccc;
    animation-duration: 1.5s;
    animation-direction: reverse;
}

.spinner-ring:nth-child(3) {
    width: 60px;
    height: 60px;
    top: 30px;
    left: 30px;
    border-top: 3px solid #888888;
    border-bottom: 3px solid #888888;
    animation-duration: 1s;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loading Text */
.loading-text {
    text-align: center;
    color: white;
}

.loading-text h2 {
    font-size: 2rem;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    text-shadow: none;
}

.loading-text p {
    font-size: 1rem;
    color: #cccccc;
    font-weight: 300;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .modern-spinner {
        width: 80px;
        height: 80px;
    }
    
    .spinner-ring:nth-child(1) {
        width: 80px;
        height: 80px;
    }
    
    .spinner-ring:nth-child(2) {
        width: 60px;
        height: 60px;
        top: 10px;
        left: 10px;
    }
    
    .spinner-ring:nth-child(3) {
        width: 40px;
        height: 40px;
        top: 20px;
        left: 20px;
    }
    
    .loading-text h2 {
        font-size: 1.5rem;
    }
    
    .loading-text p {
        font-size: 0.9rem;
    }
}

#container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#canvas-container {
    width: 100%;
    height: 100%;
}

/* Main Title */
.main-title {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    text-align: center;
    pointer-events: none;
}

.main-title h1 {
    font-size: 3.5rem;
    font-weight: 900;
    color: white;
    text-shadow: none;
    letter-spacing: 2px;
    margin: 0;
}

.powered-by-subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 5px 0 0 0;
    font-weight: 300;
    letter-spacing: 0.5px;
    cursor: pointer;
    pointer-events: all;
    transition: all 0.3s ease;
    text-transform: lowercase;
    font-style: italic;
}

.powered-by-subtitle:hover {
    color: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
    text-shadow: 0 2px 8px rgba(255, 255, 255, 0.3);
}

@media (max-width: 768px) {
    .main-title h1 {
        font-size: 2.5rem;
        letter-spacing: 1px;
    }
}

@media (max-width: 480px) {
    .main-title h1 {
        font-size: 2rem;
        letter-spacing: 0.5px;
    }
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #ffffff;
    color: #000000;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    z-index: 1000;
    animation: slideInDown 0.5s ease-out;
    border: 1px solid #000000;
}

.toast.hidden {
    animation: slideOutUp 0.5s ease-in forwards;
}

/* Tier Upgrade Notification */
.tier-upgrade-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: #ffffff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(76, 175, 80, 0.3);
    z-index: 2000;
    animation: tierUpgradeIn 0.6s ease-out;
    min-width: 320px;
    max-width: 480px;
    text-align: center;
}

.tier-upgrade-content h3 {
    margin-bottom: 12px;
    font-size: 1.4rem;
    color: #ffffff;
}

.tier-upgrade-content p {
    margin-bottom: 8px;
    font-size: 1rem;
    color: #ffffff;
}

.tier-upgrade-content ul {
    list-style: none;
    padding: 0;
    margin-top: 12px;
}

.tier-upgrade-content li {
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    margin: 4px 0;
    border-radius: 6px;
    font-size: 0.9rem;
}

@keyframes tierUpgradeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Hover Tooltip */
.tooltip {
    position: fixed;
    background: transparent;
    color: #ffffff;
    padding: 4px 8px;
    font-size: 1.2rem;
    font-weight: 700;
    z-index: 1500;
    pointer-events: none;
    white-space: nowrap;
    transition: opacity 0.2s ease;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 1px;
}

.tooltip.hidden {
    opacity: 0;
    pointer-events: none;
}



@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes slideOutUp {
    from {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
}

/* Base Popup Styles */
.popup-base {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideIn 0.3s ease-out;
    z-index: 10001;
}

.popup-base {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.popup-base.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.9);
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 10px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.popup-header h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.3em;
    font-weight: 700;
}

.popup-content {
    padding: 20px;
}

.close-button {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
}

.close-button:hover {
    background: #c0392b;
    transform: scale(1.1);
}

/* Data Card Styles */
.data-card {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 500px;
    min-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 10001;
}

.data-card.hidden {
    display: none;
}

.popup-content p {
    color: #34495e;
    line-height: 1.6;
    margin: 0;
}

/* URL Section */
.url-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.url-section.hidden {
    display: none;
}

.url-section h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.1em;
}

.url-link {
    color: #52c4b0;
    text-decoration: none;
    font-size: 14px;
    word-break: break-all;
    transition: color 0.2s ease;
    display: inline-block;
}

.url-link:hover {
    color: #45b7aa;
    text-decoration: underline;
}

/* Edit functionality styles */
.description-section {
    margin-bottom: 25px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1em;
}

.edit-btn {
    background: #52c4b0;
    color: white;
    border: none;
    border-radius: 6px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(82, 196, 176, 0.3);
}

.edit-btn:hover {
    background: #45b7aa;
    transform: scale(1.05);
    box-shadow: 0 3px 6px rgba(82, 196, 176, 0.4);
}

.edit-form {
    margin-top: 15px;
    padding: 15px;
    background: rgba(82, 196, 176, 0.05);
    border: 1px solid rgba(82, 196, 176, 0.2);
    border-radius: 8px;
}

.edit-form.hidden {
    display: none;
}

.edit-form textarea,
.edit-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.95);
    color: #2c3e50;
    box-sizing: border-box;
    margin-bottom: 12px;
    line-height: 1.4;
}

.edit-form textarea {
    min-height: 120px;
    resize: vertical;
}

.edit-form input[type="url"] {
    min-height: 44px;
}

.edit-form textarea:focus,
.edit-form input:focus {
    outline: none;
    border-color: #52c4b0;
    box-shadow: 0 0 0 2px rgba(82, 196, 176, 0.2);
}

.edit-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.no-url {
    color: #95a5a6;
    font-style: italic;
    font-size: 14px;
}

.no-url.hidden {
    display: none;
}

.data-card-footer {
    padding: 10px 20px 20px 20px;
    text-align: right;
}

.data-card-footer span {
    color: #7f8c8d;
    font-size: 0.9em;
    font-weight: bold;
}

/* Connections Section */
.connections-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.connections-section h3 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 1.1em;
}

.connection-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.connection-info {
    flex-grow: 1;
    margin-right: 10px;
}

.connection-title {
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.9em;
}

.connection-strength {
    font-size: 0.8em;
    color: #7f8c8d;
}

.vote-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.vote-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.vote-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.vote-btn.upvoted {
    color: #e74c3c;
}

.vote-btn.downvoted {
    color: #3498db;
}

.vote-score {
    min-width: 20px;
    text-align: center;
    font-weight: 500;
    font-size: 0.9em;
}

/* Comments Section */
.comments-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.comments-section h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.1em;
}

.comment-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    gap: 10px;
}

.comment-content {
    flex: 1;
}

.comment-text {
    color: #34495e;
    font-size: 0.9em;
    line-height: 1.4;
    margin-bottom: 5px;
}

.comment-meta {
    color: #95a5a6;
    font-size: 0.8em;
}

.delete-comment-btn {
    background: #f18b7f;
    color: white;
    border: none;
    border-radius: 6px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.3);
}

.delete-comment-btn:hover {
    background: #c0392b;
    transform: scale(1.05);
    box-shadow: 0 3px 6px rgba(231, 76, 60, 0.4);
}

.add-comment {
    margin-top: 15px;
}

.add-comment textarea {
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 12px;
    font-family: inherit;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.8);
    color: #2c3e50;
    backdrop-filter: blur(5px);
    transition: all 0.2s ease;
    resize: vertical;
    margin-bottom: 8px;
    box-sizing: border-box;
}

.add-comment textarea:focus {
    outline: none;
    border-color: #52c4b0;
    box-shadow: 0 0 0 2px rgba(82, 196, 176, 0.2);
    background: rgba(255, 255, 255, 0.95);
}

.btn-primary {
    background: #52c4b0;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background: #45b7aa;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

/* Click Action Menu */
.action-menu {
    position: fixed;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10001;
    pointer-events: none;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-menu.visible {
    pointer-events: all;
    opacity: 1;
    transform: translateY(0);
}

.action-btn {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    color: #2c3e50;
    position: relative;
}

.action-btn:hover {
    transform: translateX(-2px) translateY(-1px);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.action-btn:active {
    transform: translateX(0);
}

.action-btn .icon {
    font-size: 24px;
}

.action-btn::before {
    content: attr(data-tooltip);
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    backdrop-filter: blur(5px);
}

.action-btn:hover::before {
    opacity: 1;
}

/* Add Idea Form */
.add-idea-form {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    max-width: 90vw;
    z-index: 2000;
}

.add-idea-form .popup-header h2,
.add-idea-form .form-group label,
.add-idea-form .form-group input,
.add-idea-form .form-group textarea,
.add-idea-form .form-actions button {
    color: #2c3e50 !important;
}

/* Override global input styling for add-idea-form */
.add-idea-form .form-group input {
    background: rgba(255, 255, 255, 0.8) !important;
    color: #2c3e50 !important;
    border: 1px solid rgba(0, 0, 0, 0.2) !important;
}

.add-idea-form .form-group input::placeholder {
    color: #888 !important;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 6px;
    font-size: 14px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.8);
    color: #2c3e50;
    box-sizing: border-box;
    backdrop-filter: blur(5px);
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #52c4b0;
    box-shadow: 0 0 0 2px rgba(82, 196, 176, 0.2);
    background: rgba(255, 255, 255, 0.95);
}

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

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.8);
    color: #2c3e50;
    border: 1px solid rgba(0, 0, 0, 0.2);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.btn-danger {
    background: #e74c3c;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-danger:hover:not(:disabled) {
    background: #c0392b;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.btn-danger:disabled {
    background: #bdc3c7;
    color: #7f8c8d;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Delete Modal Styles */
.delete-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 450px;
    max-width: 90vw;
    z-index: 2100;
}

.delete-warning {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.delete-warning p {
    margin: 0;
    color: #c0392b;
    font-weight: 600;
}

.delete-point-info {
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
}

.delete-point-info p {
    margin: 0;
    color: #2c3e50;
}

.error-message {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    font-weight: 600;
}

.error-message.hidden {
    display: none;
}

/* Delete button styling */
.delete-btn {
    background: rgba(231, 76, 60, 0.9);
    color: white;
}

.delete-btn:hover {
    background: rgba(192, 57, 43, 0.95);
    transform: translateX(-2px) translateY(-1px);
    box-shadow: 0 6px 16px rgba(231, 76, 60, 0.4);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

canvas {
    display: block;
    cursor: grab;
    touch-action: none; /* Prevent default touch behaviors */
}

canvas:active {
    cursor: grabbing;
}

/* Wizards Modal Styles */
.wizards-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 450px;
    max-width: 90vw;
        z-index: 10001;
}

.wizard-content p {
    margin: 0 0 15px 0;
    color: #2c3e50;
    line-height: 1.6;
}

.wizard-content p:last-child {
    margin-bottom: 0;
}

.wizard-signature {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    text-align: right;
}

.wizard-signature p {
    color: #7f8c8d;
    font-size: 14px;
    margin: 0;
}

/* Share Modal Styles */
.share-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    max-width: 90vw;
        z-index: 10001;
}

.share-content p {
    margin: 0 0 15px 0;
    color: #2c3e50;
    line-height: 1.6;
}

.share-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin: 25px 0;
}

.share-url-input {
    flex: 1;
    padding: 12px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    font-size: 14px;
    font-family: monospace;
    background: rgba(255, 255, 255, 0.9);
    color: #2c3e50;
    backdrop-filter: blur(5px);
    cursor: text;
}

.share-url-input:focus {
    outline: none;
    border-color: #52c4b0;
    box-shadow: 0 0 0 2px rgba(82, 196, 176, 0.2);
    background: rgba(255, 255, 255, 0.95);
}

.copy-btn {
    white-space: nowrap;
    min-width: 120px;
}

.copy-success {
    color: #27ae60;
    font-weight: 600;
    text-align: center;
    margin: 10px 0;
    padding: 8px;
    background: rgba(39, 174, 96, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(39, 174, 96, 0.3);
}

.copy-success.hidden {
    display: none;
}

.share-description {
    margin: 20px 0;
    padding: 15px;
    background: rgba(82, 196, 176, 0.1);
    border: 1px solid rgba(82, 196, 176, 0.3);
    border-radius: 8px;
}

.share-description p {
    margin: 0;
    color: #2c3e50;
    font-style: italic;
}

.share-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Responsive design */
@media (max-width: 768px) {
    #ui-controls {
        top: 10px;
        left: 10px;
        right: 10px;
        padding: 15px;
    }
    
    h1 {
        font-size: 1.2em;
    }
    
    button {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* Header Actions */
.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Split Upvote Button */
.upvote-split-btn {
    display: flex;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: #52c4b0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
}

.upvote-action {
    padding: 0.5rem 0.8rem;
    background: transparent;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

.upvote-action:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.upvote-counter {
    padding: 0.5rem 0.6rem;
    background: rgba(0, 0, 0, 0.1);
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 2rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.downvote-action {
    padding: 0.5rem 0.8rem;
    background: transparent;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    font-weight: 600;
}

.downvote-action:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

/* Connection Action Menu Vote Count */
.action-btn .vote-count {
    font-size: 0.8rem;
    margin-left: 0.25rem;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.1rem 0.3rem;
    border-radius: 10px;
    min-width: 1.2rem;
    text-align: center;
}

/* Authentication Modal */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
        z-index: 10001;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

.auth-modal:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.auth-content {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.auth-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-header h2 {
    color: #ffffff;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: #888;
    font-size: 0.9rem;
}

.auth-tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
    background: #333;
}

.auth-tab {
    flex: 1;
    padding: 0.75rem;
    background: #333;
    border: none;
    color: #888;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.auth-tab.active {
    background: #007acc;
    color: #ffffff;
}

.auth-tab:hover:not(.active) {
    background: #444;
    color: #ffffff;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
}

.form-group input {
    padding: 0.75rem;
    border: 1px solid #333;
    border-radius: 6px;
    background: #2a2a2a !important;
    color: #ffffff !important;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

/* Ensure auth modal inputs have proper styling */
.auth-modal .form-group input {
    background: #2a2a2a !important;
    color: #ffffff !important;
}

/* Fix placeholder text color */
.form-group input::placeholder {
    color: #888 !important;
}

/* Fix browser autofill styles */
.form-group input:-webkit-autofill,
.form-group input:-webkit-autofill:hover,
.form-group input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #2a2a2a inset !important;
    -webkit-text-fill-color: #ffffff !important;
    caret-color: #ffffff !important;
}

.form-group input:focus {
    outline: none;
    border-color: #007acc;
    box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.2);
}

.register-fields {
    transition: all 0.3s ease;
}

.register-fields.hidden {
    display: none;
}

.auth-submit {
    padding: 0.75rem;
    background: #007acc;
    border: none;
    border-radius: 6px;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: 0.5rem;
}

.auth-submit:hover {
    background: #005a9e;
}

.auth-error {
    background: #dc3545;
    color: #ffffff;
    padding: 0.75rem;
    border-radius: 6px;
    margin-top: 1rem;
    font-size: 0.9rem;
    text-align: center;
}

.auth-error.hidden {
    display: none;
}

/* User Info Display */
.user-info {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: rgba(26, 26, 26, 0.95);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 1rem;
    backdrop-filter: blur(10px);
        z-index: 10001;
}

.user-info.hidden {
    opacity: 0;
    visibility: hidden;
}

.user-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.username {
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
}

.reputation {
    color: #ffd700;
    font-size: 0.9rem;
    font-weight: 500;
}

.logout-btn {
    padding: 0.5rem;
    background: transparent;
    border: 1px solid #dc3545;
    border-radius: 6px;
    color: #ffffff;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 2.2rem;
    height: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-btn:hover {
    background: #dc3545;
    transform: translateY(-1px);
}

/* Tier Progression UI */
.user-identity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tier-icon {
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s ease;
    position: relative;
}

.tier-icon:hover {
    transform: scale(1.2);
}

.tier-tooltip {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid #444;
    border-radius: 12px;
    padding: 1rem;
    min-width: 280px;
    z-index: 1001;
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

.tier-tooltip.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
}

.tier-tooltip-content h4 {
    color: #ffd700;
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tier-progress {
    margin-bottom: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd700, #ffed4e);
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0%;
}

#tier-progress-text {
    color: #ccc;
    font-size: 0.8rem;
}

.tier-capabilities {
    border-top: 1px solid #333;
    padding-top: 0.75rem;
}

.current-capabilities,
.next-capabilities {
    margin-bottom: 0.75rem;
}

.current-capabilities:last-child,
.next-capabilities:last-child {
    margin-bottom: 0;
}

.tier-capabilities h5 {
    color: #fff;
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.tier-capabilities ul {
    margin: 0;
    padding-left: 1rem;
    color: #ccc;
}

.tier-capabilities li {
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

#next-tier-info {
    color: #ffd700;
    font-size: 0.8rem;
    margin: 0.5rem 0 0 0;
    font-weight: 500;
}