/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: #1E90FF; /* Canvas background - Dodger Blue */
    color: #E0E0E0;      /* Soft white text */
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* Copy alert */
.copy-alert {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(13, 17, 23, 0.95);
    color: #E0E0E0;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.copy-alert.show {
    opacity: 1;
}

/* Hamburger menu */
.hamburger-menu {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(30, 144, 255, 0.1);
    border: 1px solid rgba(30, 144, 255, 0.3);
    border-radius: 6px;
    width: 44px;
    height: 44px;
    font-size: 20px;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #C0C0C0;
}

.hamburger-menu:hover {
    background: rgba(30, 144, 255, 0.2);
    border-color: rgba(30, 144, 255, 0.5);
    color: #FFFFFF;
}

/* Session panel */
.session-panel {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    height: 100vh;
    background: rgba(15, 15, 20, 0.9);
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    transition: right 0.3s ease;
    z-index: 200;
    display: flex;
    flex-direction: column;
}

.session-panel.open {
    right: 0;
}

.session-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}

.session-header h3 {
    font-size: 18px;
    font-weight: 500;
}

.session-header button {
    background: rgba(255,255,255,0.08);
    border: 2px solid #ffffff;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s ease, transform 0.05s ease-in-out;
}

.session-header button:hover { background: rgba(255,255,255,0.16); }
.session-header button:active { transform: scale(0.96); }

.session-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.session-item {
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 4px;
    margin-bottom: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.session-item:hover {
    background: rgba(255,255,255,0.06);
}

.new-session-btn {
    margin: 20px;
    padding: 12px;
    background: #FF8C00;
    color: #0D1117;
    border: 1px solid #FFFFFF;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.3px;
    transition: background-color 0.2s ease;
}

.new-session-btn:hover { background: #FFA500; }

/* Full text display panel */
.full-text-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 33vw; /* initial width */
    min-width: 280px;
    max-width: 80vw;
    height: 100vh;
    background: #1a1d21; /* Cursor-like dark background */
    border-left: 1px solid rgba(51, 55, 61, 0.3); /* More subtle border */
    z-index: 150;
    color: #c5c8c6; /* Softer text color */
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    transition: width 0.1s ease; /* For smoother resizing */
}

.full-text-content {
    flex: 1; /* take up available space */
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    background: #1a1d21; /* Same background as panel */
}

.full-text-content .placeholder {
    padding: 20px;
    color: #8e8ea0;
}

.full-text-content .placeholder h3 {
    color: #ECECEC;
    margin-top: 0;
}

/* Chat bubble container */
.chat-bubble-container {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 16px;
    max-width: 100%;
}

/* Chat bubble styling */
.chat-bubble {
    /* background: rgba(29, 161, 242, 0.15); */
    border: 1px solid rgb(156 166 173 / 30%);
    border-radius: 18px;
    padding: 12px 16px;
    margin: 0;
    font-size: 16px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #c5c8c6;
    position: relative;
    max-width: calc(100% - 48px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Chat bubble text */
.chat-bubble p {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Copy button next to bubble */
.bubble-copy-btn {
    background-color: #2a2d31;
    border: 1px solid #33373d;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s ease;
    flex-shrink: 0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23c5c8c6" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>');
    background-repeat: no-repeat;
    background-position: center;
}

.bubble-copy-btn:hover {
    opacity: 1;
    background-color: #33373d;
}

.sidebar-copy-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background-color: #2a2d31;
    border: 1px solid #33373d;
    border-radius: 6px;
    cursor: pointer;
    z-index: 160;
    opacity: 0.7;
    transition: all 0.2s ease;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23c5c8c6" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>');
    background-repeat: no-repeat;
    background-position: center;
}

.sidebar-copy-btn:hover {
    opacity: 1;
    background-color: #33373d;
}

.copy-icon-group {
    cursor: pointer;
    opacity: 0; /* hidden by default */
    transition: opacity 0.2s ease;
}

.node:hover .copy-icon-group {
    opacity: 0.7; /* visible on node hover */
}

.copy-icon-group:hover {
    opacity: 1;
}

.copy-icon-bg {
    fill: transparent;
}

.copy-icon-group:hover .copy-icon-bg {
    fill: rgba(0,0,0,0.2);
}

.resize-handle {
    position: absolute;
    top: 0;
    left: -5px;
    width: 10px;
    height: 100%;
    cursor: col-resize;
    z-index: 200;
}

/* Canvas container */
.canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 33vw; /* initial width of panel */
    width: auto;
    height: 100vh;
    background: #1DA1F2; /* canvas background color */
    overflow: hidden;
    cursor: grab;
    /* Enable smooth touch interactions */
    touch-action: none; /* Allow custom touch handling */
    -webkit-user-select: none; /* Prevent text selection */
    user-select: none;
}

.canvas-container.dragging {
    cursor: grabbing;
}

/* D3 SVG styling */
.node {
    cursor: grab;
}

.node:hover rect {
    stroke-width: 2.5;
    stroke: #8ab4ff; /* soft blue */
}

.node:active {
    cursor: grabbing;
}

.node.selected rect {
    stroke: #ffffff;                /* high contrast */
    stroke-width: 4;                /* thicker */
    stroke-linejoin: round;
    stroke-dasharray: 12 6;         /* larger dashes */
    animation: dashCycle 0.75s linear infinite, strokeBlink 1.1s ease-in-out infinite, glowBlueStrong 1.2s ease-in-out infinite;
    filter: drop-shadow(0 0 16px rgba(29,161,242,0.95));
}

.link {
    stroke: #ffffff; /* pure white */
    stroke-width: 1px; /* thin */
    stroke-dasharray: 6 4; /* dashed connector */
    fill: none;
    pointer-events: none; /* Allow clicking through to background */
}

/* Pan cursor for empty canvas */
svg {
    cursor: grab;
    touch-action: none; /* Enable custom touch handling */
    -webkit-user-select: none;
    user-select: none;
}

svg.dragging {
    cursor: grabbing;
}

/* Mind map nodes */
.tweet-node {
    position: absolute;
    background: #1DA1F2; /* message background */
    border: 1px solid #ffffff; /* thin pure white */
    border-radius: 8px;
    padding: 16px 20px; /* increased padding */
    max-width: 475px;
    min-width: 400px; /* increased from 325px to prevent short messages from being cut off */
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px; /* larger font */
    font-weight: 400; /* regular weight */
    line-height: 1.4; /* tighter line spacing */
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 6px 20px rgba(0,0,0,0.35);
    word-wrap: break-word;
    overflow: hidden;
}

.tweet-node:hover {
    box-shadow: 0 10px 24px rgba(0,0,0,0.45);
    transform: translateY(-1px);
}

.tweet-node.selected {
    border-color: #ffffff;
    background: #1DA1F2;
    animation: borderPulse 1.6s ease-in-out infinite;
}

.tweet-node.completed {
    background: #f0f0f0;
    opacity: 0.8;
}

/* Connection lines */
.connection-line {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

/* Model selector */
.model-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 0 20px;
}

.model-selector label {
    font-size: 13px;
    color: #c5c8c6;
    font-weight: 600;
    white-space: nowrap;
}

.model-select {
    flex: 1;
    background-color: #0f1419;
    border: 1px solid #33373d;
    border-radius: 8px;
    color: #c5c8c6;
    padding: 8px 12px;
    font-size: 13px;
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    outline: none;
    transition: all 0.2s ease;
    cursor: pointer;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none"><path d="M2 4l4 4 4-4" stroke="%23c5c8c6" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

.model-select:hover {
    border-color: #1DA1F2;
    background-color: #1a1d21;
}

.model-select:focus {
    border-color: #FF8C00;
    box-shadow: 0 0 0 2px rgba(255, 140, 0, 0.2);
    background-color: #1a1d21;
}

.model-select option {
    background-color: #0f1419;
    color: #c5c8c6;
    padding: 8px;
}

/* Input container */
.input-section {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    width: 100%;
    max-width: 100%; /* Prevent overflow */
    padding: 20px;
    box-sizing: border-box;
    z-index: 1001;
    margin-top: auto;
}

.input-container {
    width: 100%;
    max-width: 100%; /* Ensure container doesn't exceed parent width */
    box-sizing: border-box; /* Include padding and border in width calculation */
    background-color: #0D1117; /* Dark background */
    border-radius: 28px; /* Pill shape */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    padding: 8px;
    border: 1px solid #666666; /* Thin gray border */
    transition: all 0.3s ease;
}

.input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
    max-width: 100%; /* take full width of parent */
    margin: 0;
}

#tweet-input {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: #ECECEC;
    font-size: 14px;
    padding: 12px 20px;
    resize: none;
    overflow-y: auto; /* Changed from hidden to auto */
    max-height: 70vh; /* Set max-height to 70% of viewport height */
    min-height: 20px; /* Prevent collapsing to zero height */
    max-width: 100%; /* Prevent overflow beyond container width */
    word-wrap: break-word; /* Wrap long words */
    white-space: pre-wrap; /* Preserve line breaks but wrap text */
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

#tweet-input::placeholder {
    color: #8e8ea0;
}

#tweet-input:focus {
    outline: none;
}

/* Custom scrollbar for the textarea */
.tweet-input::-webkit-scrollbar {
    width: 8px;
}

.tweet-input::-webkit-scrollbar-track {
    background: #0f1419; /* Match input container background */
}

.tweet-input::-webkit-scrollbar-thumb {
    background-color: #4a4d51; /* Subtle gray thumb */
    border-radius: 4px;
    border: 2px solid #0f1419; /* Padding around thumb */
}

.tweet-input {
    scrollbar-width: thin;
    scrollbar-color: #4a4d51 #0f1419;
}

.tweet-input:focus {
    border-color: transparent;
    box-shadow: 0 0 8px rgba(74, 144, 226, 0.2);
}

/* Pulse the input when linked to selected node */
.tweet-input.linked {
    border-color: transparent;
    border-width: 0;
    animation: none; /* remove old animation */
    box-shadow: 0 0 12px 2px rgba(74, 144, 226, 0.5);
}

.submit-btn {
    background-color: #FF8C00; /* Orange */
    color: #FFFFFF;
    border: none;
    border-radius: 50%; /* Circular shape */
    width: 38px;
    height: 38px;
    font-size: 1.6em;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: 8px;
    flex-shrink: 0;
}

.submit-btn:hover:not(:disabled) {
    background-color: #FFA500; /* Lighter orange on hover */
}

.submit-btn:disabled {
    background-color: #5a5a72;
    color: #8e8ea0;
    cursor: not-allowed;
}

.submit-btn:disabled svg path {
    stroke: #8e8ea0;
}

/* Small New button in canvas area */
.new-small-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #FF8C00;
    color: #FFFFFF;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.3px;
    cursor: pointer;
    z-index: 1002;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.new-small-btn:hover {
    background: #FFA500;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

/* Draggable Lark logo */
.lark-logo {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 300;
    color: #0b0b0c;
    background: #FF8C00;
    border: none;
    border-radius: 8px;
    font-family: 'Atma', cursive;
    font-weight: 400;
    font-size: 33px;
    letter-spacing: 0.6px;
    padding: 8px 16px;
    user-select: none;
    cursor: grab;
    box-shadow: none;
}

.lark-logo.dragging { cursor: grabbing; }

.input-status {
    text-align: center;
    margin-top: 0;
    font-size: 13px;
    color: #888;
    min-height: 16px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .input-container {
        padding: 12px;
    }

    .input-wrapper {
        gap: 8px;
    }

    .tweet-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .tweet-node {
        max-width: 240px;
        min-width: 200px; /* increased from 160px to maintain readability on mobile */
        padding: 10px 12px;
        font-size: 13px;
    }

    .hamburger-menu {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

/* Mobile Optimized Mode */
.mobile-optimized {
    /* Hide the right panel in mobile mode */
    .full-text-panel {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }

    /* Canvas takes full width and leaves space for thin input bar */
    .canvas-container {
        right: 0 !important;
        width: 100% !important;
        bottom: 90px !important; /* Updated for new panel height */
        /* Enable smooth touch interactions */
        touch-action: none; /* Prevent browser default touch behaviors */
        -webkit-user-select: none; /* Prevent text selection on iOS */
        user-select: none; /* Prevent text selection */
    }

    /* Thin input bar integrated into canvas bottom */
    .mobile-input-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 90px; /* Increased height for multi-line input */
        background: rgba(13, 17, 23, 0.95); /* Darker, more professional background */
        border-top: 1px solid rgba(255, 255, 255, 0.15);
        z-index: 1000; /* Higher than canvas */
        display: flex;
        align-items: center;
        padding: 12px 16px; /* Slightly reduced horizontal padding for more input space */
        box-sizing: border-box; /* Include padding in dimensions */
        backdrop-filter: blur(15px);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    }

    .mobile-input-container {
        flex: 1;
        background-color: #0D1117; /* Match desktop dark background */
        border: 1px solid #666666; /* Match desktop gray border */
        border-radius: 28px; /* Match desktop pill shape */
        display: flex;
        align-items: center;
        padding: 8px; /* Match desktop padding */
        padding-left: 15px; /* Increased left padding */
        transition: all 0.3s ease;
        width: 100%; /* Full width */
        max-width: 100%; /* Ensure it doesn't overflow */
        box-sizing: border-box; /* Include padding and border in width */
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); /* Match desktop shadow */
    }

    .mobile-input-container:focus-within {
        border-color: #1DA1F2; /* Match desktop focus color */
        box-shadow: 0 0 8px rgba(74, 144, 226, 0.2); /* Match desktop focus glow */
    }

    .mobile-tweet-input {
        flex: 1 1 auto; /* Take up all available space */
        background: transparent;
        border: none;
        color: #ECECEC; /* Match desktop text color */
        font-size: 14px; /* Match desktop font size */
        padding: 5px 10px; /* Slightly more horizontal padding for better appearance */
        resize: none;
        overflow-y: auto; /* Allow vertical scrolling */
        max-height: 60px; /* Allow for about 3 lines */
        min-height: 30px; /* Reduced minimum height to match your element style */
        width: 100%; /* Full width of flex container */
        min-width: 0; /* Allow flex item to shrink below content size */
        max-width: 100%; /* Prevent overflow */
        box-sizing: border-box; /* Include padding in width calculation */
        font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
        line-height: 1.4;
        font-weight: 400;
    }

    .mobile-tweet-input::placeholder {
        color: #8e8ea0; /* Match desktop placeholder color */
        font-weight: 300;
    }

    .mobile-tweet-input:focus {
        outline: none;
    }

    .mobile-submit-btn {
        background-color: #FF8C00; /* Match desktop submit button color */
        color: #FFFFFF;
        border: none;
        border-radius: 50%; /* Circular shape */
        width: 38px; /* Match desktop size */
        height: 38px; /* Match desktop size */
        font-size: 1.6em;
        cursor: pointer;
        transition: background-color 0.2s ease; /* Match desktop transition */
        display: flex;
        justify-content: center;
        align-items: center;
        margin-left: 8px;
        flex-shrink: 0; /* Don't shrink - maintain fixed size */
    }

    .mobile-submit-btn:hover:not(:disabled) {
        background-color: #FFA500; /* Match desktop hover color */
    }

    .mobile-submit-btn:disabled {
        background-color: #5a5a72; /* Match desktop disabled color */
        color: #8e8ea0; /* Match desktop disabled text color */
        cursor: not-allowed;
    }

    /* Mobile top-right action button */
    .mobile-action-btn {
        position: fixed;
        top: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        background: linear-gradient(135deg, #FF8C00, #FFA500);
        border: none;
        border-radius: 50%;
        color: #FFFFFF;
        font-size: 20px;
        cursor: pointer;
        z-index: 1001;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
        box-shadow: 0 4px 15px rgba(255, 140, 0, 0.3);
    }

    .mobile-action-btn:hover {
        background: linear-gradient(135deg, #FFA500, #FFB84D);
        transform: scale(1.1);
        box-shadow: 0 6px 25px rgba(255, 140, 0, 0.5);
    }

    .mobile-action-btn:active {
        transform: scale(0.95);
    }

    /* Hide mobile input section (model selector) for thin bar design */
    .mobile-input-section .mobile-model-selector {
        display: none;
    }

    .mobile-input-status {
        display: none; /* Hide status in thin bar mode */
    }

    /* Adjust nodes for mobile */
    .tweet-node {
        max-width: 280px;
        min-width: 220px;
        font-size: 14px;
        padding: 12px 16px;
    }

    /* Hide desktop elements in mobile mode */
    .new-small-btn {
        display: none;
    }

    .hamburger-menu {
        display: none;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Loading spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Status modal */
.status-modal { position: fixed; inset: 0; display: none; z-index: 400; }
.status-modal.open { display: block; }
.status-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.35); backdrop-filter: blur(2px); }
.status-card {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: 340px; background: #0b2740; border: 1px solid #ffffff; border-radius: 12px;
    padding: 18px 18px 20px; color: #e6e6e6; box-shadow: 0 14px 36px rgba(0,0,0,0.35);
}
.status-title { font-weight: 800; font-size: 16px; margin-top: 8px; letter-spacing: 0.3px; text-align: center; }
.status-sub { margin-top: 6px; font-size: 13px; opacity: 0.9; text-align: center; }

/* fun animated dots */
.status-spinner { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 6px; }
.status-spinner span { width: 8px; height: 8px; background: #FF8C00; border-radius: 50%; display: inline-block; animation: bounce 0.9s infinite ease-in-out; }
.status-spinner span:nth-child(2) { animation-delay: 0.1s; }
.status-spinner span:nth-child(3) { animation-delay: 0.2s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.6; }
  40% { transform: scale(1); opacity: 1; }
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Pulse animations for selected elements */
@keyframes dashCycle {
    from { stroke-dashoffset: 0; }
    to   { stroke-dashoffset: 14; }
}

@keyframes glowBlue {
    0% { box-shadow: 0 0 0 0 rgba(29,161,242,0.55); }
    50% { box-shadow: 0 0 14px 4px rgba(29,161,242,0.35); }
    100% { box-shadow: 0 0 0 0 rgba(29,161,242,0.55); }
}

@keyframes glowBlueStrong {
    0% { box-shadow: 0 0 8px 1px rgba(29,161,242,0.65); }
    50% { box-shadow: 0 0 22px 6px rgba(29,161,242,0.55); }
    100% { box-shadow: 0 0 8px 1px rgba(29,161,242,0.65); }
}

@keyframes strokeBlink {
    0% { stroke: #ffffff; }
    50% { stroke: #1DA1F2; }
    100% { stroke: #ffffff; }
}

/* Mobile Warning Modal */
.mobile-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 500;
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.mobile-modal.open {
    display: block;
}

.mobile-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.mobile-card {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    background: #0b2740;
    border: 1px solid #ffffff;
    border-radius: 16px;
    padding: 24px;
    color: #e6e6e6;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.mobile-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.mobile-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #ffffff;
}

.mobile-message {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 24px;
    color: #c5c8c6;
}

.mobile-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.mobile-continue-btn,
.mobile-dismiss-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.mobile-continue-btn {
    background: #FF8C00;
    color: #0D1117;
}

.mobile-continue-btn:hover {
    background: #FFA500;
    transform: translateY(-1px);
}

.mobile-dismiss-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #c5c8c6;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-dismiss-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* Mobile responsive adjustments for modal */
@media (max-width: 480px) {
    .mobile-card {
        width: 95%;
        padding: 20px;
    }

    .mobile-icon {
        font-size: 40px;
    }

    .mobile-title {
        font-size: 18px;
    }

    .mobile-message {
        font-size: 13px;
    }

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

    .mobile-continue-btn,
    .mobile-dismiss-btn {
        width: 100%;
        padding: 12px;
    }
}