:root {
    --background-color: #D76A03;
    --widget-background: rgba(26, 26, 26, 0.95);
    --text-color: #F1F5F9;
    --accent-color: #fd8f41;
    --shadow-color: rgba(0, 0, 0.2);
    --positive-change: #00c781;
    --negative-change: #ff4d4d;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: 'SF Pro Display', 'Inter', sans-serif;
    margin: 0;
    padding: 0px;
    background-image: radial-gradient(circle, #000 1px, transparent 1px);
    background-size: 16px 16px;
    background-position: center;
    min-height: 100vh;
    letter-spacing: -0.02em;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
}

.header {
    margin-bottom: 12px;
}

.header h1 {
    font-size: 1.5em;
    font-weight: 700;
    margin-bottom: 8px;
}

.compact-news {
    background-color: var(--widget-background);
    padding: 2px 12px 12px 10px;
    border-radius: 12px;
    margin-bottom: 16px;
    position: relative;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
}

.social-icon-img {
    width: 15px;
    height: 15px;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.social-icon-img:hover {
    filter: grayscale(0%);
}

.compact-news h2 {
    font-size: 1.1em;
    margin-bottom: 8px;
}

.compact-news ul {
    list-style: none;
    padding: 0;
    margin: 0 60px 0 0;
}

.compact-news li {
    font-size: 0.9em;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.compact-news a {
    color: var(--accent-color);
    text-decoration: none;
}

.compact-news a:hover {
    text-decoration: underline;
}

.more-button {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background-color: var(--accent-color);
    color: #000;
    border: none;
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 0.8em;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.more-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.news-scroll-wrapper {
    max-height: 4em;
    overflow-y: auto;
    padding-right: 6px;
    margin-top: 8px;
}

.news-scroll-wrapper::-webkit-scrollbar {
    width: 6px;
}

.news-scroll-wrapper::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

#news-container.expanded .news-scroll-wrapper {
    max-height: 300px;
    overflow-y: auto;
}

#news-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.notification {
    background-color: var(--accent-color);
    color: #000;
    padding: 12px;
    border-radius: 12px;
    font-size: 0.9em;
    text-align: center;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1.2;
}

/* Market notification specific styling for tighter vertical spacing */
#market-notification {
    line-height: 1.0;
}

#market-notification > div > div {
    line-height: 1.0;
}

#market-notification span {
    line-height: 1.0;
}

.market-icon {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.market-open {
    background-color: var(--positive-change);
}

.market-closed {
    background-color: var(--negative-change);
}

.menu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.time-filters {
    display: flex;
    gap: 8px;
}

.time-filter-btn {
    background-color: var(--widget-background);
    color: var(--text-color);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.time-filter-btn.active {
    background-color: var(--accent-color);
    color: #000;
}

.time-filter-btn:hover {
    background-color: var(--accent-color);
    color: #000;
}

.widget-subheader {
    font-size: 1rem;
    font-weight: 600;
    color: #ccc;
    text-transform: uppercase;
    margin-bottom: 8px;
    margin-left: 4px;
}

.update-status {
    font-size: 0.875em;
    text-align: center;
    margin-top: 16px;
    background-color: var(--accent-color);
    color: #fff;
    padding: 12px;
    border-radius: 12px;
    opacity: 1;
}

.main-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, 280px);
    gap: 16px;
    margin-bottom: 16px;
    padding: 0 16px 20px;
    box-sizing: border-box;
    min-height: calc(100vh - 200px);
    position: relative;
    width: 100%;
    justify-content: center;
}

@media (min-width: 1024px) {
    .main-content {
        margin-left: 0px;
        justify-content: start;
    }
}

.widget {
    background-color: var(--widget-background);
    border-radius: 20px;
    padding: 20px;
    width: 240px;
    height: 240px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    transition: transform 0.2s ease;
    box-sizing: border-box;
    position: relative;
}

.widget:hover {
    transform: scale(1.05);
}

.widget-header {
    font-size: 14px;
    text-transform: uppercase;
    color: #aaa;
    margin-bottom: 4px; /* or 0 for no gap */
}

.widget-value {
    font-size: 28px;
    font-weight: bold;
    margin-top: 0; /* or a small value like 2px */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    line-height: 1.2;
    flex-shrink: 0;
    /* Prevent mobile browsers from detecting numbers as phone numbers */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.btc-equivalent,
.last-low-date,
.change-period {
    font-size: 0.4em !important;
    opacity: 0.6 !important;
    display: block;
    margin-top: 2px;
    line-height: 1.1;
}

/* Make btc-equivalent text smaller for raises widgets and ATH widgets */
#raises-count .btc-equivalent,
#last-raise .btc-equivalent,
#swc-ath .btc-equivalent,
#tswcf-ath .btc-equivalent,
#ath-3m8f .btc-equivalent,
#bitcoin-buys-count .btc-equivalent,
#last-bitcoin-buys .btc-equivalent {
    font-size: 0.50em !important;
}

.last-low-date {
    font-size: 0.4em !important;
    opacity: 0.6 !important;
    display: block;
    margin-top: 1px;
    line-height: 1.1;
}

.widget#tennyson-target .widget-value {
    font-size: 18px;
    margin-top: 4px;
}

/* ATH Widget Styles - Standardized to match market cap widgets */
#swc-ath,
#tswcf-ath,
#ath-3m8f,
#raises-count,
#last-raise,
#bitcoin-buys-count,
#last-bitcoin-buys {
    padding-top: 0 !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
    display: flex !important;
    flex-direction: column !important;
}

#swc-ath .widget-header,
#tswcf-ath .widget-header,
#ath-3m8f .widget-header,
#raises-count .widget-header,
#last-raise .widget-header,
#bitcoin-buys-count .widget-header,
#last-bitcoin-buys .widget-header {
    margin-top: 18px !important;
    padding-bottom: 0 !important;
}

#swc-ath .widget-value,
#tswcf-ath .widget-value,
#ath-3m8f .widget-value,
#raises-count .widget-value,
#last-raise .widget-value,
#bitcoin-buys-count .widget-value,
#last-bitcoin-buys .widget-value {
    font-size: 28px; /* Changed from 36px to match market cap widgets */
    font-weight: bold;
    line-height: 1.2;
    margin-top: 0;
    text-align: left;
}

#swc-ath .widget-value span:not(.btc-equivalent),
#tswcf-ath .widget-value span:not(.btc-equivalent),
#ath-3m8f .widget-value span:not(.btc-equivalent),
#raises-count .widget-value span:not(.btc-equivalent),
#last-raise .widget-value span:not(.btc-equivalent),
#bitcoin-buys-count .widget-value span:not(.btc-equivalent),
#last-bitcoin-buys .widget-value span:not(.btc-equivalent) {
    font-size: 18px !important;
    opacity: 0.8 !important;
    font-weight: normal;
    display: block;
    margin-top: 2px;
    text-align: left;
}

#swc-ath .change,
#tswcf-ath .change,
#ath-3m8f .change,
#raises-count .change,
#last-raise .change,
#bitcoin-buys-count .change,
#last-bitcoin-buys .change {
    font-size: 18px;
    margin-top: 8px;
}

#swc-ath .change span,
#tswcf-ath .change span,
#ath-3m8f .change span,
#raises-count .change span,
#last-raise .change span,
#bitcoin-buys-count .change span,
#last-bitcoin-buys .change span {
    font-size: 18px !important;
    opacity: 0.8 !important;
}

.change {
    font-size: 0.9em !important;
    margin-top: 6px;
    min-height: 14px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    /* Prevent mobile browsers from detecting numbers as phone numbers */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.change.positive {
    color: var(--positive-change);
}

.change.negative {
    color: var(--negative-change);
}

.days-to-cover-positive {
    color: var(--negative-change);
}

.days-to-cover-negative {
    color: var(--positive-change);
}

.change-period {
    font-size: 0.9em !important;
    opacity: 0.85 !important;
    display: inline-block !important;
    margin-left: 8px;
    vertical-align: middle;
}

.chart-canvas {
    margin-top: 8px;
    height: 35px;
    flex-grow: 1;
}

.community-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.community-card .widget-header {
    text-align: center;
}

.community-card .widget-value {
    text-align: center;
}

.community-card .social-icons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s ease;
}

.social-icon:hover {
    background-color: #D76A03;
}

.social-icon svg {
    width: 20px;
    height: 20px;
}

.theme-toggle-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%; /* full circle */
    border: 2px solid #000; /* will flip in JS */
    background: linear-gradient(45deg, #D76A03 50%, #000 50%);
    cursor: pointer;
    display: inline-block;
    transition: all 0.3s ease;
}

.theme-toggle-btn:hover {
    /* Hover effects removed */
}

.currency-toggle-btn {
    background-color: var(--widget-background);
    color: var(--text-color);
    border: 2px solid #000;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    font-weight: bold;
}

.currency-toggle-btn:hover {
    background-color: var(--accent-color);
    color: #000;
    border-color: var(--accent-color);
}

.currency-toggle-btn.mixed {
    background-color: var(--widget-background);
    color: var(--text-color);
    border-color: #000;
}

.currency-toggle-btn.gbp {
    background-color: #00c781;
    color: #000;
    border-color: #00c781;
}

.currency-toggle-btn.usd {
    background-color: #ff4d4d;
    color: #fff;
    border-color: #ff4d4d;
}

.currency-toggle-btn.mixed:hover,
.currency-toggle-btn.gbp:hover,
.currency-toggle-btn.usd:hover {
    background-color: var(--accent-color);
    color: #000;
    border-color: var(--accent-color);
}

.info-btn {
    background-color: var(--widget-background);
    color: var(--text-color);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-btn:hover {
    background-color: var(--accent-color);
    color: #000;
}

.view-toggle-btn {
    background-color: var(--widget-background);
    color: var(--text-color);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-toggle-btn:hover {
    background-color: var(--accent-color);
    color: #000;
}

.view-toggle-btn.active {
    background-color: var(--widget-background);
    color: var(--text-color);
}

.modal-time-btn {
    background: #fd8f41;
    color: #000;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0 12px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-time-btn:hover,
.modal-time-btn.active {
    background-color: #723700;
}

.modal-button {
    background: #fd8f41;
    color: #000;
    border: none;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 12px;
}

.modal-time-btn {
    border-radius: 50px;
}

#theme-image {
    width: 555px;
}

.modal-close-btn {
    border-radius: 50%;
    width: 40px;
    padding: 0;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0,0,0,0.8);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #1a1a1a;
    color: var(--text-color);
    padding: 40px 30px;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
    text-align: center;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    background: none;
    color: var(--text-color);
    border: none;
    cursor: pointer;
}

.detailed-chart-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.39);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 5%;
    box-sizing: border-box;
}

.detailed-chart-container {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: #1a1a1a;
    border-radius: 16px;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.modal-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

.modal-time-buttons {
    display: flex;
    gap: 8px;
}

.chart-container {
    flex-grow: 1;
    display: flex;
    align-items: center;
}

/* Mobile Responsive */
@media (max-width: 430px) {
    .container {
        padding: 6px;
    }
    
    .compact-news {
        max-height: none !important;
        overflow: visible !important;
    }
    
    .widget,
    .main-content,
    .container {
        overflow: visible !important;
    }
    
    #theme-image {
        width: 100%;
    }
    
    #detailed-chart {
        margin-top: 40px !important;
        height: 200px;
        padding: 8px;
    }
    
    .main-content {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(160px, auto));
        gap: 16px;
        padding: 0 6px 10px;
        min-height: calc(100vh - 150px);
        grid-auto-rows: 180px;
        justify-content: center;
        align-items: start;
    }
    
    .widget {
        width: 180px;
        height: 180px !important;
        padding: 16px;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    
    /* Specific rules for community widget on mobile */
    .widget.community-card {
        height: 175px !important;
    }
    
    .widget.community-card .social-icons {
        gap: 8px;
        margin-top: 4px;
    }
    
    .widget.community-card .social-icon {
        width: 24px;
        height: 24px;
    }
    
    .widget.community-card .social-icon svg {
        width: 16px;
        height: 16px;
    }
    
    .widget.community-card .social-icon-img {
        width: 16px;
        height: 16px;
    }
    
    .widget.community-card hr {
        margin: 3px 0;
    }
    
    .widget-header {
        font-size: 12px;
    }
    
    .widget-value {
        font-size: 18px;
        white-space: normal;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.2;
    }
    
    .widget#tennyson-target .widget-value {
        font-size: 14px;
    }
    
    /* Make the BUY/HOLD/SELL text smaller on mobile */
    .widget#tennyson-target #tenny-value {
        font-size: 12px !important;
        font-weight: bold;
    }
    
    .change {
        font-size: 10px !important;
    }
    
    .change-period {
        font-size: 10px !important;
    }
    
    .chart-canvas {
        margin-top: 6px;
        height: 30px;
    }
    
    .news-scroll-wrapper {
        max-height: 4em;
        overflow-y: auto;
        padding-right: 6px;
        margin-top: 8px;
        transition: max-height 0.3s ease;
    }
    
    /* Fix market notification container on mobile */
    #market-notification {
        padding: 8px 4px;
        font-size: 0.8em;
        line-height: 1.4;
    }
    
    #market-notification > div {
        gap: 6px !important;
        flex-direction: column !important;
        justify-content: center;
        align-items: center;
        min-height: auto;
        width: 100%;
    }
    
    #market-notification > div > div {
        line-height: 1.4;
        display: flex;
        align-items: center;
        gap: 6px;
        width: 100%;
        justify-content: center;
        padding: 2px 0;
    }
    
    #market-notification .market-icon {
        width: 12px;
        height: 12px;
        flex-shrink: 0;
        min-width: 12px;
    }
    
    #market-notification span {
        white-space: nowrap;
        flex-shrink: 0;
        line-height: 1.4;
        overflow: visible;
        text-overflow: unset;
        max-width: none;
    }
}

@media (max-width: 375px) {
    .main-content {
        grid-template-columns: repeat(auto-fit, minmax(130px, auto));
        grid-auto-rows: 160px;
    }
    
    /* Additional market notification fixes for very small screens */
    #market-notification {
        padding: 6px 2px;
        font-size: 0.75em;
    }
    
    #market-notification > div {
        gap: 4px !important;
        flex-direction: column !important;
    }
    
    #market-notification > div > div {
        width: 100%;
        padding: 1px 0;
        gap: 4px;
    }
    
    #market-notification .market-icon {
        width: 10px;
        height: 10px;
        min-width: 10px;
    }
    
    #market-notification span {
        max-width: none;
        font-size: 0.7em;
    }
    
    .widget {
        width: 160px;
        height: 160px !important;
        padding: 16px;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    
    /* Specific rules for community widget on smaller mobile */
    .widget.community-card {
        height: 160px !important;
    }
    
    .widget.community-card .social-icons {
        gap: 6px;
        margin-top: 2px;
    }
    
    .widget.community-card .social-icon {
        width: 20px;
        height: 20px;
    }
    
    .widget.community-card .social-icon svg {
        width: 14px;
        height: 14px;
    }
    
    .widget.community-card .social-icon-img {
        width: 14px;
        height: 14px;
    }
    
    .widget.community-card hr {
        margin: 2px 0;
    }
    
    .widget-header {
        font-size: 11px;
    }
    
    .change {
        font-size: 12px;
    }
    
    #news-container.expanded .news-scroll-wrapper {
        max-height: 500px;
        overflow-y: auto;
    }
}

/* Widget Drag and Drop Styles */
.edit-btn {
    background-color: var(--widget-background);
    color: var(--text-color);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-btn:hover {
    background-color: var(--accent-color);
    color: #000;
}

.edit-btn.active {
    background-color: var(--positive-change);
    color: #000;
}

.widget.draggable {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.widget.draggable:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.widget.dragging {
    opacity: 0.9 !important;
    transform: rotate(8deg) scale(1.02) !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5) !important;
    pointer-events: none !important;
    border: none !important;
    background: var(--widget-background) !important;
    z-index: 9999 !important;
    transition: transform 0.1s ease-out, opacity 0.1s ease-out, box-shadow 0.1s ease-out !important;
    cursor: grabbing !important;
}

/* Ensure widgets don't animate during drag operations */
.widget:not(.dragging) {
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out, opacity 0.3s ease-out;
}

.edit-mode.widget:not(.dragging) {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.3s ease;
}

/* Disable transitions during drag operations */
.edit-mode .widget:not(.dragging) {
    transition: border-color 0.3s ease;
}

/* Disable all transitions during dragging */
.edit-mode .widget.dragging,
.edit-mode .widget.dragging * {
    transition: none !important;
}

/* Disable transitions for widgets when any widget is being dragged */
.edit-mode.dragging-active .widget:not(.dragging) {
    transition: none !important;
}

.widget.draggable:not(.dragging) {
    cursor: grab;
}

/* Edit mode visual indicators */
.edit-mode .widget:not(.removed) {
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.edit-mode .widget:not(.removed):hover {
    border-color: var(--accent-color);
}

.widget-handle {
    position: absolute;
    top: 4px;
    right: 48px;
    color: var(--accent-color);
    font-size: 40px;
    opacity: 0;
    pointer-events: none;
    z-index: 10;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    margin-right: 4px;
}

.widget-remove, .widget-restore {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 40px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.widget-remove { color: #ff4d4d; }
.widget-restore { color: var(--positive-change); }

/* Only show remove on active, restore on removed */
.widget:not(.removed) .widget-remove { display: flex; }
.widget:not(.removed) .widget-restore { display: none; }
.widget.removed .widget-remove { display: none; }
.widget.removed .widget-restore { display: flex; }

/* Show controls on hover when in edit mode */
.edit-mode .widget.draggable:hover .widget-handle,
.edit-mode .widget.draggable:hover .widget-remove {
    opacity: 0.8;
}

.edit-mode .widget.removed:hover .widget-restore {
    opacity: 0.8;
}

.widget.draggable .widget-handle,
.widget.draggable .widget-remove,
.edit-mode .widget.removed .widget-restore {
    pointer-events: auto;
}

.widget.dragging .widget-handle {
    cursor: grabbing;
}

.widget.draggable .widget-remove:hover {
    opacity: 1;
    color: #ff0000;
    background-color: rgba(255, 0, 0, 0.2);
}

.edit-mode .widget.removed .widget-restore:hover {
    opacity: 1;
    color: #00a000;
    background-color: rgba(0, 160, 0, 0.2);
}

.widget-placeholder {
    position: absolute !important;
    pointer-events: none;
    z-index: 997;
    border: 2px dashed #fd8f41;
    border-radius: 20px;
    background: rgba(253, 143, 65, 0.1);
    box-shadow: 0 0 0 2px #fd8f4133;
    transition: none;
    box-sizing: border-box;
}

.widget.dragging ~ .widget-placeholder {
    /* Hide the original spot of the dragged widget */
    visibility: visible;
}

/* Drop zone styles for the new drag system */
.widget-drop-zone {
    position: absolute !important;
    pointer-events: none;
    z-index: 998;
    border: 2px dashed transparent;
    border-radius: 20px;
    background: transparent;
    transition: none;
    box-sizing: border-box;
}

.widget-drop-zone.active {
    border: 2px dashed #fd8f41;
    background: rgba(253, 143, 65, 0.1);
    box-shadow: 0 0 0 2px #fd8f4133;
}

/* Removed widget styles */
.widget.removed {
    opacity: 0.4;
    filter: grayscale(50%);
    pointer-events: none;
    transition: all 0.3s ease;
    display: none; /* Hidden by default */
}

.edit-mode .widget.removed {
    display: flex; /* Show in edit mode */
    pointer-events: auto;
    cursor: pointer;
}

.edit-mode .widget.removed:hover {
    opacity: 0.7;
    filter: grayscale(25%);
}

.edit-mode .widget.removed .widget-remove {
    display: none;
}

.edit-mode .widget.removed .widget-handle {
    display: none;
}

/* Prevent text selection during drag */
.widget.draggable * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Disable widget clicks during edit mode */
.widget.draggable {
    pointer-events: auto;
}

/* Mobile touch support */
@media (max-width: 768px) {
    .widget-handle,
    .widget-remove,
    .widget-restore {
        font-size: 40px;
        width: 60px;
        height: 60px;
    }
    
    .edit-btn,
    .view-toggle-btn,
    .info-btn,
    .currency-toggle-btn,
    .theme-toggle-btn,
    .time-filter-btn {
        width: 36px;
        height: 36px;
        font-size: 0.8em;
    }
}

/* Extra small mobile support for 360px screens */
@media (max-width: 360px) {
    .widget-handle,
    .widget-remove,
    .widget-restore {
        font-size: 28px;
        width: 42px;
        height: 42px;
    }
    
    .edit-btn,
    .view-toggle-btn,
    .info-btn,
    .currency-toggle-btn,
    .theme-toggle-btn,
    .time-filter-btn {
        width: 28px;
        height: 28px;
        font-size: 0.6em;
    }
    
    /* Make market notification text bigger on 360px screens */
    #market-notification {
        font-size: 0.9em !important;
        padding: 4px 6px;
        line-height: 1.5;
    }
    
    #market-notification > div {
        gap: 0px !important;
    }
    
    #market-notification > div > div {
        line-height: 1.5;
        gap: 0px;
        padding: 3px 0;
    }
    
    #market-notification span {
        font-size: 0.9em;
        line-height: 1.5;
    }
}

/* Small mobile support for 400px screens */
@media (min-width: 361px) and (max-width: 400px) {
    .widget-handle,
    .widget-remove,
    .widget-restore {
        font-size: 36px;
        width: 50px;
        height: 50px;
    }
    
    .edit-btn,
    .view-toggle-btn,
    .info-btn,
    .currency-toggle-btn,
    .theme-toggle-btn,
    .time-filter-btn {
        width: 30px;
        height: 30px;
        font-size: 0.7em;
    }
}

/* Invisible placeholder widget for drag and drop */
.widget-placeholder-invisible {
    background-color: transparent !important;
    border: 2px dashed #fd8f41 !important;
    border-radius: 20px;
    opacity: 0.3;
    pointer-events: none;
    position: relative;
    z-index: 1;
    transition: none;
}

.widget-placeholder-invisible:hover {
    transform: none !important;
}

/* Ensure the placeholder doesn't interfere with grid layout */
.widget-placeholder-invisible {
    grid-column: auto;
    grid-row: auto;
}

#swc-ath .widget-header,
#tswcf-ath .widget-header,
#ath-3m8f .widget-header,
#raises-count .widget-header,
#last-raise .widget-header,
#bitcoin-buys-count .widget-header,
#last-bitcoin-buys .widget-header {
    margin-bottom: 12px !important;
    padding-bottom: 0 !important;
}

#swc-ath .widget-value,
#tswcf-ath .widget-value,
#ath-3m8f .widget-value,
#raises-count .widget-value,
#last-raise .widget-value,
#bitcoin-buys-count .widget-value,
#last-bitcoin-buys .widget-value {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

body:not(.edit-mode) .widget.removed {
    display: none !important;
}

/* Ensure ATH widgets are hidden when removed, overriding their !important display rule */
body:not(.edit-mode) #swc-ath.removed,
body:not(.edit-mode) #tswcf-ath.removed,
body:not(.edit-mode) #ath-3m8f.removed,
body:not(.edit-mode) #raises-count.removed,
body:not(.edit-mode) #last-raise.removed,
body:not(.edit-mode) #bitcoin-buys-count.removed,
body:not(.edit-mode) #last-bitcoin-buys.removed {
    display: none !important;
}

@media (max-width: 600px) {
  #last-raise .widget-value,
  #raises-count .widget-value,
  #swc-ath .widget-value,
  #tswcf-ath .widget-value,
  #ath-3m8f .widget-value,
  #bitcoin-buys-count .widget-value,
  #last-bitcoin-buys .widget-value {
    font-size: 18px !important;
  }
  #last-raise .widget-value span:not(.btc-equivalent),
  #raises-count .widget-value span:not(.btc-equivalent),
  #swc-ath .widget-value span:not(.btc-equivalent),
  #tswcf-ath .widget-value span:not(.btc-equivalent),
  #ath-3m8f .widget-value span:not(.btc-equivalent),
  #bitcoin-buys-count .widget-value span:not(.btc-equivalent),
  #last-bitcoin-buys .widget-value span:not(.btc-equivalent) {
    font-size: 18px !important;
  }
}

/* Live update visual feedback */
.live-update {
    animation: liveUpdatePulse 2s ease-in-out;
    background-color: rgba(255, 193, 7, 0.1);
    border-radius: 4px;
    box-shadow: 0 0 0 1px rgba(255, 193, 7, 0.3);
}

@keyframes liveUpdatePulse {
    0% {
        background-color: rgba(255, 193, 7, 0.3);
        box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.5);
    }
    50% {
        background-color: rgba(255, 193, 7, 0.1);
        box-shadow: 0 0 0 1px rgba(255, 193, 7, 0.3);
    }
    100% {
        background-color: transparent;
        box-shadow: none;
    }
}

#swc-ath,
#tswcf-ath,
#ath-3m8f {
    justify-content: flex-start;
    gap: 8px; /* Add some space between the elements */
}

#swc-ath .widget-value,
#tswcf-ath .widget-value,
#ath-3m8f .widget-value {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.live-update-yellow {
    animation: liveUpdateYellowPulse 2s 1;
    background-color: #ffe066 !important;
    color: #000 !important;
    transition: background-color 0.3s, color 0.3s;
}
@keyframes liveUpdateYellowPulse {
    0% { background-color: #ffe066; color: #000; }
    80% { background-color: #ffe066; color: #000; }
    100% { background-color: inherit; color: inherit; }
} 

/* Dropdown styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: var(--widget-background);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    min-width: 200px;
    margin-top: 4px;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.dropdown-item.active {
    background-color: rgba(253, 143, 65, 0.2);
    color: var(--accent-color);
}

.dropdown-item i {
    width: 16px;
    text-align: center;
    font-size: 12px;
}

/* Mobile responsive dropdown */
@media (max-width: 768px) {
    .dropdown-menu {
        right: -10px;
        min-width: 180px;
    }
    .dropdown-item {
        padding: 10px 12px;
        font-size: 13px;
    }
    .dropdown-item i {
        font-size: 11px;
    }
} 