:root {
    --notes-yellow: #FFCC00;
    --notes-yellow-text: #FF9500;
    --notes-bg: #FFFFFF;
    --notes-text: #000000;
    --notes-secondary: #8E8E93;
    --notes-border: #E5E5EA;
    --notes-tag: #FF9500;
}


html, body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;    /* ✅ Prevent scroll chaining */
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.lucide {
    stroke: var(--notes-yellow-text);
}

.uk-container {
    padding: 0;
}

.header {
    background: var(--notes-bg) !important;
    border-bottom: 1px solid var(--notes-border);
    height: 44px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.back-button {
    color: var(--notes-yellow-text);
    text-decoration: none;
    font-size: 15px;
    display: flex;
    align-items: center;
    padding-left: 8px;
}

.back-button:hover {
    color: var(--notes-yellow-text);
    text-decoration: none;
}

.header-icon {
    color: var(--notes-yellow-text) !important;
    width: 24px;
    height: 24px;
    padding: 0 8px;
}

.main-content {
    padding: 0 16px;
    display: flex;
    flex-direction: column;
}

.title-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    padding: 8px 16px;
    position: fixed;
    top: 44px;
    left: 0;
    right: 0;
    background: white;
    z-index: 900;
    border-bottom: 1px solid var(--notes-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.title-animate {
    animation: bgPulse 1.8s infinite;
}

@keyframes bgPulse {
    0% { background: #fffbe6; }
    50% { background: #fff3c1; }
    100% { background: #fffbe6; }
}

.title-container.no-animate {
    animation: none !important;
}

.notes-title {
    font-size: 28px;
    font-weight: bold;
    color: var(--notes-text);
    border: none;
    background: transparent;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    flex-grow: 1;        /* ✅ Let it fill the space */
    margin-right: 8px;   /* ✅ Add spacing between title and button */
}

.animate-button {
    border: none;
    background: none;
    cursor: pointer;
    color: var(--notes-yellow-text);
    min-width: 36px;      /* ✅ Increased size for better tap target */
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;       /* ✅ Prevent the button from shrinking */
}

.animate-button:hover {
    opacity: 0.8;
    transform: scale(1.1); /* Optional hover effect */
}

.animate-button:focus {
    outline: none;
}

.notes-title::placeholder {
    color: var(--notes-secondary);
}

.notes-title:focus {
    outline: none;
}

.notes-title:empty::before {
    content: 'Title';
    color: var(--notes-secondary);
}

.notes-tag {
    color: var(--notes-tag);
    font-size: 15px;
    margin-bottom: 8px;
}

.notes-subtitle {
    font-size: 17px;
    font-weight: 500;
    color: var(--notes-text);
    margin-bottom: 16px;
}

.uk-form-label {
    color: var(--notes-yellow-text);
    font-size: 17px;
    font-weight: 500;
}

.uk-input,
.uk-select,
.uk-textarea {
    border: none !important;
    background: var(--notes-bg) !important;
    font-size: 17px;
    padding: 12px 16px;
}

.uk-button-text {
    color: var(--notes-yellow-text);
    font-size: 17px;
    font-weight: 500;
}

.uk-button-text:hover {
    color: var(--notes-yellow-text);
}

.uk-modal-title {
    font-size: 20px;
    color: var(--notes-yellow-text);
}

#animationOutput {
    position: fixed;
    top: 92px;
    left: 0;
    right: 0;
    bottom: 40px;
    padding: 0 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 17px;
    line-height: 24px;
    border: none !important;
    background: var(--notes-bg) !important;
    color: var(--notes-text);
    white-space: pre;
    overflow-y: auto;
    overflow-x: hidden;
    resize: none;
    transition: color 0.3s ease;
    z-index: 100;
    overscroll-behavior: contain;  /* ✅ Contains the scroll */
    padding-top: 10px;
}

#animationOutput::placeholder {
    color: var(--notes-secondary);
}

.bottom-toolbar {
    border-top: 1px solid var(--notes-border);
    padding: 8px 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95) !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200; /* Ensure toolbar is above the text */
}

.toolbar-icon {
    color: var(--notes-yellow-text) !important;
    width: 24px;
    height: 24px;
}

.uk-navbar-right {
    margin-right: 8px;
}

.uk-iconnav li {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 24px;
    cursor: pointer;
} 

.uk-iconfooter {
    gap: 48px !important;
}

.icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 24px;
  }

.debug-info {
    font-family: monospace;
    font-size: 12px;
    color: var(--notes-secondary);
    padding: 0 16px;    
}

.debug-controls select {
    height: 32px !important;
    padding: 4px 8px !important;
    font-size: 12px !important;
    border: 1px solid var(--notes-border) !important;
    border-radius: 6px;
    background-color: var(--notes-bg) !important;
}

.debug-controls select:focus {
    border-color: var(--notes-yellow-text) !important;
}

#debugText {
    margin: 0;
    padding: 8px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 6px;
}

@media (max-width: 600px) {
    .main-content {
        padding: 0 16px 80px 16px;
    }
}

@keyframes rainbow {
    0% { color: #ff0000; }
    16.666% { color: #ff8000; }
    33.333% { color: #ffff00; }
    50% { color: #00ff00; }
    66.666% { color: #0080ff; }
    83.333% { color: #8000ff; }
    100% { color: #ff0000; }
}

.rainbow-text {
    --rainbow-duration: 3000ms;
    animation: rainbow var(--rainbow-duration) linear infinite;
}

.color-transition {
    transition: color 0.3s ease;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 100ms ease-in-out;
}

.loading-overlay.visible {
    opacity: 1;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-text {
    margin-top: 1rem;
    font-size: 1.4rem;
    font-weight: 600;
    color: #FFCC00;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
    animation: textGlow 2s ease-in-out infinite alternate;
    letter-spacing: 0.5px;
}

.countdown-number {
    font-size: 4rem;
    font-weight: bold;
    color: #FFCC00;
    margin-top: 0.5rem;
    animation: countdownPulse 1s ease-in-out;
}

@keyframes countdownPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes textGlow {
    0% {
        text-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
        transform: scale(1);
    }
    100% {
        text-shadow: 0 0 20px rgba(255, 204, 0, 0.8), 0 0 30px rgba(255, 204, 0, 0.3);
        transform: scale(1.02);
    }
}

.scroll-indicator {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 100ms ease-in-out;
}

.scroll-indicator.visible {
    opacity: 1;
}

.scroll-arrow {
    color: var(--notes-yellow-text);
    font-size: 24px;
    margin-bottom: 8px;
    /* animation: bounce 2s infinite; */ /* Remove bounce from arrow */
    /* text-shadow: 0 0 10px rgba(255, 204, 0, 0.5); */ /* Remove shadow */
}


/* New styles for the autoscroll button */
#autoscroll-button {
    border: 3px solid var(--notes-yellow-text);
    border-radius: 16px;
    padding: 10px 20px;
    background-color: #fff;
    color: #333;
    font-weight: 500;
    font-size: 1rem;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    animation: bounce 2s infinite;
}
#autoscroll-button:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
  }

#autoscroll-button:active {
    transform: scale(0.98); /* Slight shrink on click */
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15); /* Inner shadow on click */
}

/* Ensure text inside the button is white */
#autoscroll-button .uk-text-small {
    color: black;
    margin-bottom: 4px; /* Add space between text and arrow */
       font-weight: 500;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes fadeInOut {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
} 

/* Desktop Mockup Layout */
@media (min-width: 768px) {
    body {
        display: flex;
        justify-content: center;
        align-items: center;
        background-color: #f5f5f5;
        padding: 0;
        height: 100vh;
        overflow: auto;
    }

    /* Mobile mockup container */
    .app-container {
        width: 100%;
        max-width: 390px;
        height: 85vh;
        margin: 0 auto;
        position: relative;
        overflow: hidden;
        border-radius: 32px;
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15),
                   0 1px 3px rgba(0, 0, 0, 0.1),
                   inset 0 0 0 2px rgba(0, 0, 0, 0.05);
        background-color: var(--notes-bg);
        display: flex;
        flex-direction: column;
        border: 12px solid #1f1f1f;
        border-width: 12px 5px;
    }

    /* Position fixed elements within the container */
    .header {
        position: absolute;
        width: 100%;
        max-width: 390px;
        top: 0;
        left: 0;
        right: 0;
    }

    .title-container {
        position: absolute;
        gap: 8px;
        width: calc(100% - 32px); /* Account for padding */
        max-width: 390px;
        top: 44px; /* Match the original position */
        left: 0;
        right: 0;
    }

    #animationOutput {
        position: absolute;
        top: 92px;
        right: 0;
        width: 100%;
        overflow-y: auto;
        margin-bottom: 0;
        padding-bottom: 8px;
    }

    .bottom-toolbar {
        position: absolute;
        width: 100%;
        max-width: 390px;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 200;
        background: var(--notes-bg) !important;
        border-bottom-left-radius: 27px;
        border-bottom-right-radius: 27px;
    }
    
    /* Add device notch styling for more realism */
    .app-container::before {
        content: '';
        position: absolute;
        width: 120px;
        height: 25px;
        background-color:rgb(48, 46, 46);
        border-radius: 0 0 16px 16px;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1000;
    }
}

/* Copy Notification */
.copy-notification {
    position: fixed; /* Will be overridden in script for specific positioning */
    transform: translateX(-50%); /* Center horizontally on the specified point */
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    --arrow-position: 50%; /* Default arrow position */
}

/* Add arrow pointing down */
.copy-notification::after {
    content: '';
    position: absolute;
    top: 100%; /* Position at the bottom of the notification */
    left: var(--arrow-position);
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid rgba(0, 0, 0, 0.8);
}

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

/* Desktop-specific notification styling */
@media (min-width: 768px) {
    .copy-notification {
        font-size: 14px;
        padding: 8px 14px;
    }
}

/* Mobile styles */
@media (max-width: 767px) {
    .app-container {
        height: 100%;
        width: 100%;
        overflow: hidden;
    }
    
    .bottom-toolbar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
    }
}

/* Dance Editor Styles */
.dance-editor {
    padding: 10px;
    font-size: 0.9rem;
}

/* Overriding some UIkit defaults for our compact design */
.uk-form-label {
    font-size: 0.9rem;
    margin-bottom: 3px;
}

#dance-list {
    max-height: 70vh;
    overflow-y: auto;
}

/* Remove the following classes as they're no longer needed with UIkit sortable */
.dance-item.dragging,
.dance-item.dragging-active,
.dance-item.drag-over,
.dance-item,
.dance-item:hover,
.dance-item .uk-button-small,
.dance-item-container,
.dance-type-row,
.dance-details-row,
.dance-position-container, 
.dance-cycles-container,
.dance-actions,
.dance-drag-handle,
.dance-drag-handle:hover,
.remove-dance {
    /* These styles are no longer needed */
}

/* Update UIkit modal styles for mobile */
.uk-modal-dialog {
    max-width: 95vw;
    width: 95vw;
}

.uk-modal-title {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--notes-yellow-text);
}

/* Dance Editor Compact Styles */
#dance-list > li {
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 6px;
    margin-bottom: 8px !important;
    padding: 10px;
    background: #fff;
}

#dance-list .uk-sortable-drag {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

#dance-list .uk-sortable-placeholder {
    opacity: 0.3;
}

.uk-form-small {
    font-size: 0.85rem !important;
    height: 30px !important;
}

.uk-text-small {
    font-size: 0.85rem !important;
}

.uk-sortable-handle {
    cursor: move;
}

/* Remove the old dance editor styles as they're no longer needed */
.dance-editor {
    /* These styles are no longer needed */
}

/* Ensure lists have proper spacing */
.uk-list-divider > li:nth-child(n+2) {
    margin-top: 5px;
    padding-top: 5px;
    border-top-color: rgba(0,0,0,0.05);
}

/* Force modal to fill most of the viewport on mobile */
@media (max-width: 640px) {
    .uk-modal-body {
        padding: 10px;
    }
    
    .uk-modal-dialog {
        margin: 10px;
    }
}

/* Styling for the new Dance Edit Panel */
#dance-edit-panel {
    background-color: var(--notes-bg);
    z-index: 9999 !important;
    border: 1px solid var(--notes-border);
}

#dance-edit-panel .uk-form-label {
    color: var(--notes-yellow-text);
    font-weight: 500;
    font-size: 14px;
    display: block;
}

#dance-edit-panel .uk-select,
#dance-edit-panel .uk-input {
    border: 1px solid var(--notes-border) !important;
    border-radius: 6px;
    background-color: #F2F2F7 !important;
    font-size: 14px;
    padding: 0 8px;
    height: 38px !important;
}

#dance-edit-panel .uk-card-title {
    font-weight: 600;
    font-size: 16px;
}

#segment-counter {
    color: var(--notes-secondary);
    font-weight: 500;
}

#prev-segment-btn, 
#next-segment-btn {
    color: var(--notes-yellow-text);
    transition: transform 0.2s ease;
}

#prev-segment-btn:hover, 
#next-segment-btn:hover {
    transform: scale(1.2);
}

#prev-segment-btn:disabled, 
#next-segment-btn:disabled {
    color: var(--notes-secondary);
    opacity: 0.5;
}

#add-segment-btn {
    border: none;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 12px;
}
#add-segment-btn:disabled {
    background-color: #F2F2F2; /* Light gray, neutral */
    color: #B3B3B3;           /* Medium gray for readable text */
    cursor: not-allowed;
    box-shadow: none;
    opacity: 1; /* Important: don't fade the text too much */
}

#add-segment-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

#delete-segment-btn {
    background-color: #FF3B30;
    border: none;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 12px;
}

#delete-segment-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

#delete-segment-btn:disabled {
    opacity: 0.5;
}

/* Ensure the grid has proper spacing */
#dance-edit-panel .uk-grid-small {
    margin-left: -8px;
}

#dance-edit-panel .uk-grid-small > * {
    padding-left: 8px;
}

@media (max-width: 640px) {
    #dance-edit-panel {
        width: 85% !important;
        max-width: 280px;
    }
}

@media (min-width: 768px) {
    #dance-edit-panel {
        bottom: 100px !important;
    }
}

/* Autoscroll Control */
.autoscroll-control {
    background-color: var(--notes-bg) !important;
    border: 1px solid var(--notes-border);
    padding: 12px !important;
    text-align: center;
    opacity: 0;
    transition: opacity 200ms ease-in-out, transform 200ms ease-in-out;
    transform: translateX(-50%) translateY(10px);
    position: fixed;
    bottom: 50px;
    left: 50%;
    z-index: 980;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.1);
    width: 250px !important;
}

.autoscroll-control.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.autoscroll-header {
    font-size: 16px;
    font-weight: 600;
    color: var(--notes-yellow-text);
    margin: 0 0 8px 0;
    text-align: center;
}

.autoscroll-control .uk-form-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--notes-secondary);
    margin-bottom: 6px;
}

.autoscroll-control .uk-range {
    width: 100%;
    margin-top: 2px;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    margin-top: 2px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--notes-yellow-text);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--notes-yellow-text);
}

input:checked + .slider:before {
    transform: translateX(18px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

@media (min-width: 768px) {
    .autoscroll-control {
        bottom: 120px !important;
    }
}

/* Share Modal Styles */
#share-modal .uk-modal-dialog {
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    margin: 0 auto;
}

#share-modal .uk-modal-title {
    font-size: 1.5rem;
    color: var(--notes-yellow-text);
    font-weight: 700;
}

#share-dance-btn {
    background-color: var(--notes-yellow-text);
    border-radius: 6px;
    font-weight: 600;
    color: #000;
    max-width: 100%;
}

#share-app-btn {
    background-color: #f3f3f3;
    color: #333;
    border-radius: 6px;
    font-weight: 600;
    max-width: 100%;
}

#copy-link-btn {
    background-color: var(--notes-yellow-text);
    color: #000;
    border-radius: 6px;
    font-weight: 600;
}

#share-link {
    border-radius: 6px;
    resize: none;
    font-size: 14px;
    font-family: monospace;
    padding: 10px;
    background-color: #f5f5f5;
    color: #333;
    width: 100%;
    max-height: 80px;
    overflow-y: auto;
}

/* Make share icon cursor pointer */
#share-button {
    cursor: pointer;
}

/* Copy notification styling */
#copy-status {
    margin-top: 5px;
    text-align: center;
}

/* Share modal icons container */
.share-icons-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: 0;
    gap: 12px;
}

/* New share icon buttons styling */
.share-icon-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 4px;
    border-radius: 8px;
    transition: background-color 0.2s;
    width: 52px;
}

.share-icon-btn:hover {
    background-color: #f5f5f5;
}

.share-icon-btn svg {
    stroke: var(--notes-yellow-text);
    margin-bottom: 5px;
    width: 24px;
    height: 24px;
}

.share-icon-btn span {
    font-size: 11px;
    color: #555;
}

/* Desktop share modal adjustments */
@media (min-width: 768px) {
    #share-modal .uk-modal-dialog {
        width: 450px;
    }
    
    .share-icons-container {
        gap: 16px;
    }
    
    .share-icon-btn {
        width: 64px;
        padding: 8px;
    }
    
    .share-icon-btn span {
        font-size: 12px;
    }
}

/* Mobile share modal adjustments */
@media (max-width: 767px) {
    .share-icons-container {
        justify-content: space-around;
        width: 100%;
    }
    
    .share-icon-btn {
        width: auto;
        min-width: 40px;
    }
}

.interactive-title {
    background: transparent;
    border: none;
    box-shadow: none;
    padding-left: 0;
    font-size: 28px;
    font-weight: bold;
    color: var(--notes-text);
    outline: none;
    transition: background-color 0.3s ease;
}

.interactive-title:focus, .interactive-title:hover {
    background: transparent;
    border: none;
    box-shadow: none;
}

.interactive-title:focus ~ .title-helper-text,
.interactive-title:hover ~ .title-helper-text {
    display: block;
    animation: fadeInOut 1.2s;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}