/* Global Styles */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #000;
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
    user-select: none;
    -webkit-user-select: none;
}

/* Service Mode Styles */
body.service-mode {
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}



body.service-mode .video-container,
body.service-mode .search-container,
body.service-mode .next-video-preview,
body.service-mode .action-buttons,
body.service-mode .video-progress-bar,
body.service-mode .video-title-bar,
body.service-mode .overlay,
body.service-mode .main-content {
    display: none !important;
}



.service-wrapper {
    display: none;
    /* Hidden by default */
}

body.service-mode .service-wrapper {
    display: flex;
    /* Show in service mode */
    width: 100%;
    max-width: 480px;
    /* Mobile width */
    height: 100%;
    background: #1a1a1a;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    margin: 0 auto;
}

/* PC Vertical Layout for Service Mode */
@media (min-width: 769px) {
    body.service-mode .service-wrapper {
        height: 90vh;
        border-radius: 20px;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
        border: 1px solid #333;
    }
}

.header {
    padding: 20px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    border-bottom: 1px solid #333;
}

.input-group {
    padding: 20px;
}

.url-input {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #444;
    background: #2a2a2a;
    color: white;
    font-size: 16px;
    outline: none;
}

.preview-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #000;
    margin: 0 20px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #333;
}

.preview-tabs {
    display: flex;
    background: #2a2a2a;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: white;
    border-bottom-color: #fff;
}

.preview-content {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.title-input-area {
    padding: 20px;
}

.title-input {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: none;
    border-bottom: 1px solid #444;
    color: white;
    font-size: 16px;
    text-align: center;
    outline: none;
}

.share-btn-area {
    padding: 20px;
    padding-top: 0;
}

.share-btn {
    width: 100%;
    padding: 16px;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

/* Main Content Styles */
.search-container {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

@media (min-aspect-ratio: 9/16) {
    .search-container {
        width: 25vw;
    }
}

@media (max-aspect-ratio: 9/16) and (min-aspect-ratio: 1/2) {
    .search-container {
        width: 90vw;
    }
}

@media (max-aspect-ratio: 1/2) {
    .search-container {
        width: calc(90vh * 9 / 16);
    }
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 24px;
    padding: 9px 0px 9px 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    height: 44px;
    box-sizing: border-box;
}

#search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-size: 18px;
    padding: 0 16px;
    outline: none;
    height: 100%;
    line-height: 1;
    vertical-align: top;
    transform: translateY(-1px);
}

#search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
    font-size: 17px;
}

#search-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    padding: 0;
    margin: 0;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.2s ease;
    height: calc(100% + 18px);
    width: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 23px 23px 0;
    position: relative;
    margin: -9px -1px -9px 0;
    transform: translateY(-1px);
}

#search-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.15);
    border-left-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.02);
}

#search-btn:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.2);
}

@media (max-width: 768px) {
    .search-container {
        top: 12px;
        width: 92vw !important;
        z-index: 100;
    }

    .search-box {
        height: 52px;
        padding: 8px 4px 8px 18px;
        border-radius: 26px;
        background: rgba(0, 0, 0, 0.75);
        border: 2px solid rgba(255, 255, 255, 0.3);
    }

    #search-input {
        font-size: 18px;
        padding: 0 16px;
        line-height: 1.2;
        color: white;
        font-weight: 500;
    }

    #search-input::placeholder {
        font-size: 18px;
        color: rgba(255, 255, 255, 0.8);
        font-weight: 500;
    }

    #search-btn {
        font-size: 22px;
        width: 52px;
        height: 44px;
        margin: 0;
        border-radius: 22px;
        background: rgba(255, 255, 255, 0.15);
        border: none;
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #search-btn:hover {
        background: rgba(255, 255, 255, 0.25);
    }
}

@media (max-width: 768px) {

    html,
    body {
        width: 100vw !important;
        height: 100vh !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        position: fixed !important;
    }

    .main-content {
        height: 100vh !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
    }

    .search-container {
        position: fixed !important;
        top: 12px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        z-index: 1000 !important;
    }
}

.main-content {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .main-content {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        margin: 0 !important;
        padding: 0 !important;
        align-items: stretch !important;
        justify-content: stretch !important;
    }
}

.video-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    background: #000;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-frame {
    position: relative;
    background: #000;
    border-radius: 20px;
    border: 2px solid #333;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    margin: 0 auto;
    --frame-width: 25vw;
}

@media (min-aspect-ratio: 9/16) {
    .video-frame {
        width: 25vw;
        height: calc(25vw * 16 / 9 * 0.96);
        margin-top: 4vh;
        --frame-width: 25vw;
    }
}

@media (max-aspect-ratio: 9/16) and (min-aspect-ratio: 1/2) {
    .video-frame {
        width: 90vw;
        height: calc(90vw * 16 / 9);
        margin-top: calc((100vh - 90vw * 16 / 9) / 2);
        border-radius: 15px;
        --frame-width: 90vw;
    }
}

@media (max-aspect-ratio: 1/2) {
    .video-frame {
        width: calc(90vh * 9 / 16);
        height: 90vh;
        margin-top: 3vh;
        border-radius: 15px;
        --frame-width: calc(90vh * 9 / 16);
    }
}

@media (max-width: 768px) {
    .video-container {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
        align-items: stretch !important;
        justify-content: stretch !important;
    }

    .video-frame {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        margin: 0 !important;
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
        z-index: 1 !important;
        --frame-width: 100vw;
    }

    .video-wrapper {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
    }

    #player {
        width: 100vw !important;
        height: calc(100vw * 16 / 9) !important;
        min-height: 100vh !important;
        top: 50% !important;
        left: 0 !important;
        transform: translateY(-50%) !important;
        position: absolute !important;
    }

    .next-video-preview {
        display: none !important;
    }
}

.next-video-preview {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    border-radius: 20px 20px 0 0;
    border: 2px solid #444;
    border-bottom: none;
    opacity: 0.7;
    z-index: 1;
    overflow: hidden;
    display: none;
}

@media (min-aspect-ratio: 9/16) {
    .next-video-preview {
        display: block;
        top: calc(4vh + 25vw * 16 / 9 * 0.96 + 6vh);
        width: 25vw;
        height: calc(25vw * 16 / 9 * 0.96 * 0.3);
    }
}

@media (max-width: 768px) {
    .next-video-preview {
        display: none;
    }
}

@media (max-width: 768px) {
    .video-container {
        width: 100vw;
        height: 100vh;
    }
}

@media (min-width: 769px) {
    .video-container {
        width: 100vw;
        height: 100vh;
    }
}

.video-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
    object-fit: cover;
}

#player {
    width: 100% !important;
    height: 100% !important;
    top: 0 !important;
    position: relative !important;
}

@media (min-aspect-ratio: 9/16) {
    #player {
        height: 120% !important;
        top: -10% !important;
    }
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.action-buttons {
    position: absolute;
    right: calc(var(--frame-width) / 30);
    bottom: calc(var(--frame-width) / 25 + var(--frame-width) / 10 * 2 / 3);
    display: flex;
    flex-direction: column;
    gap: calc(var(--frame-width) / 25);
    z-index: 10;
    padding: calc(var(--frame-width) / 50) calc(var(--frame-width) / 50) calc(var(--frame-width) / 80) calc(var(--frame-width) / 50);
    background: rgba(0, 0, 0, 0.15);
    border-radius: calc(var(--frame-width) / 12);
    backdrop-filter: blur(15px);
}

.action-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-button:active {
    transform: scale(0.9);
}

.action-button:hover .action-icon {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

@media (hover: none) and (pointer: coarse) {
    .action-button:hover .action-icon {
        background: rgba(255, 255, 255, 0.15);
        transform: none;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    }
}

.video-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: calc(var(--frame-width) / 15);
    background: rgba(128, 128, 128, 0.6);
    z-index: 3;
}

.video-title-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(var(--frame-width) / 10);
    background: rgb(32, 32, 32);
    z-index: 5;
    display: flex;
    align-items: center;
    padding: 0 calc(var(--frame-width) / 25);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.video-title-bar.marquee-active {
    overflow: visible;
}

.video-title-text {
    color: white;
    font-size: calc(var(--frame-width) / 18);
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    width: 100%;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
    line-height: 1;
    position: relative;
}

.video-title-text.marquee {
    text-align: left;
    overflow: visible;
    animation: marquee-scroll 10s linear 3s infinite;
}

@keyframes marquee-scroll {
    0% {
        transform: translateX(0%);
    }

    20% {
        transform: translateX(0%);
    }

    80% {
        transform: translateX(-50%);
    }

    100% {
        transform: translateX(-50%);
    }
}

.video-progress-segment {
    position: absolute;
    top: 0;
    height: 100%;
    background: rgba(255, 255, 0, 0.3);
    z-index: 4;
    overflow: hidden;
}

.video-progress-current {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgb(65, 105, 145);
    z-index: 5;
    width: 0%;
    transition: width 0.1s ease;
}

.action-icon {
    width: calc(var(--frame-width) / 10);
    height: calc(var(--frame-width) / 10);
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(var(--frame-width) / 20);
    margin-bottom: calc(var(--frame-width) / 200);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.action-count {
    color: white;
    font-size: calc(var(--frame-width) / 30);
    font-weight: 700;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
    min-width: calc(var(--frame-width) / 18);
    letter-spacing: 0.5px;
}

.like-button.active .action-icon {
    background: rgba(255, 20, 147, 0.9);
    transform: scale(1.1);
}

.share-button:active {
    transform: scale(0.95);
}

.share-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.share-popup-content {
    background: white;
    color: black;
    border-radius: 20px;
    width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

@media screen and (max-width: 768px) {
    .share-popup {
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        background: rgba(0, 0, 0, 0.75) !important;
        backdrop-filter: blur(10px) !important;
        box-sizing: border-box !important;
    }

    .share-popup-content {
        width: 90vw !important;
        height: auto !important;
        max-width: 90vw !important;
        min-width: 90vw !important;
        max-height: 85vh !important;
        border-radius: 20px !important;
        margin: 0 auto !important;
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;
        transform: translate(-50%, -50%) !important;
        box-sizing: border-box !important;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
    }
}

@keyframes slideUpMobile {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media screen and (max-width: 480px) {
    .share-popup-content {
        width: 95vw !important;
        max-width: 95vw !important;
        min-width: 95vw !important;
        margin: 0 2.5vw !important;
    }
}

@media screen and (max-width: 360px) {
    .share-popup-content {
        width: 95vw !important;
        max-width: 95vw !important;
        min-width: 95vw !important;
        margin: 0 2.5vw !important;
    }
}

@media (min-width: 769px) {
    .share-popup-content {
        width: 60vh;
        border-radius: 2vh;
    }
}

.popup-header {
    padding: 20px 20px 15px;
    border-bottom: 1px solid #eee;
}

@media (max-width: 768px) {
    .popup-header {
        padding: 20px 24px 16px !important;
        border-bottom: 1px solid #f0f0f0 !important;
        position: relative !important;
        background: white !important;
        border-radius: 20px 20px 0 0 !important;
    }

    .popup-header::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 4px;
        background: #e0e0e0;
        border-radius: 2px;
    }
}

@media (min-width: 769px) {
    .popup-header {
        padding: 3vh 3vh 2vh;
    }
}

.popup-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .popup-header h3 {
        font-size: 18px !important;
        font-weight: 600 !important;
        color: #1a1a1a !important;
        margin: 12px 0 0 0 !important;
        text-align: center !important;
        letter-spacing: -0.2px !important;
    }
}

@media (min-width: 769px) {
    .popup-header h3 {
        font-size: 2.5vh;
    }
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

@media (max-width: 768px) {
    .close-btn {
        top: 16px !important;
        right: 20px !important;
        width: 28px !important;
        height: 28px !important;
        font-size: 20px !important;
        color: #8e8e93 !important;
        background: rgba(142, 142, 147, 0.12) !important;
        border-radius: 14px !important;
    }
}

@media (min-width: 769px) {
    .close-btn {
        top: 2vh;
        right: 3vh;
        font-size: 3vh;
        width: 4vh;
        height: 4vh;
    }
}

.close-btn:hover {
    color: #333;
    background: rgba(0, 0, 0, 0.05);
}

.popup-video {
    width: 100%;
    height: 200px;
    background: #000;
    position: relative;
}

@media (max-width: 768px) {
    .popup-video {
        height: 200px !important;
        margin: 0 !important;
        border-radius: 12px !important;
        overflow: hidden !important;
        background: #000 !important;
        position: relative !important;
    }
}

@media (min-width: 769px) {
    .popup-video {
        height: 33vh;
    }
}

.popup-video iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    cursor: pointer;
}

.time-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 4vw;
    max-font-size: 20px;
    min-font-size: 14px;
    font-weight: 600;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    z-index: 4;
    letter-spacing: 0.5px;
}

@media (min-width: 769px) {
    .time-display {
        font-size: 2.2vh;
    }
}

.current-time {
    color: #ffffff;
}

.total-time {
    color: #ff6b9d;
}

.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: rgba(180, 180, 180, 0.8);
    cursor: pointer;
    overflow: hidden;
    touch-action: none;
    z-index: 1000;
}

.progress-fill {
    height: 100%;
    background: rgba(135, 206, 235, 0.75);
    width: 0%;
    transition: width 0.1s ease;
    position: relative;
}

.segment-info {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.6);
    padding: 5px 10px;
    border-radius: 15px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.segment-overlay {
    position: absolute;
    top: 0;
    height: 100%;
    background: rgba(255, 245, 157, 0.6);
    display: block;
}

.segment-handle {
    position: absolute;
    top: 0;
    width: 3px;
    height: 100%;
    background: #ffffff;
    cursor: ew-resize;
    transition: all 0.2s ease;
}

.segment-handle:hover {
    width: 5px;
    background: #ff6b9d;
}

.segment-handle.start {
    left: 0;
}

.segment-handle.end {
    right: 0;
}

.segment-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.segment-btn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.segment-btn:hover {
    background: linear-gradient(135deg, white, rgba(255, 255, 255, 0.9));
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.segment-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.segment-info {
    color: white;
    font-size: 13px;
    font-weight: 500;
    flex-grow: 1;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.3);
    padding: 6px 12px;
    border-radius: 15px;
}

.share-form {
    padding: 20px;
}

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

.form-group select,
.form-group input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    margin-bottom: 10px;
}

.title-input {
    width: 100%;
    font-size: 16px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
    margin-bottom: 15px;
}

.share-result {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-top: 1px solid #eee;
    display: none;
}

@media (max-width: 768px) {
    .share-result {
        margin-top: 16px !important;
        padding: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        border: none !important;
    }
}

.result-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

@media screen and (max-width: 768px) {
    .share-result .result-container {
        gap: 12px !important;
        margin-bottom: 0 !important;
        display: flex !important;
        align-items: stretch !important;
        height: auto !important;
    }
}

.result-url {
    flex: 1;
    background: white;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: monospace;
    word-break: break-all;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: all;
}

@media screen and (max-width: 768px) {
    div.share-result div.result-container div.result-url {
        padding: 16px 20px !important;
        border-radius: 12px !important;
        font-size: 16px !important;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
        border: 1px solid #e1e1e1 !important;
        background: #f8f9fa !important;
        color: #1a1a1a !important;
        display: flex !important;
        align-items: center !important;
        box-sizing: border-box !important;
        line-height: 1.4 !important;
        font-weight: 400 !important;
    }
}

@media screen and (max-width: 768px) {
    .share-result .result-container .result-url {
        padding: 16px 20px !important;
        border-radius: 12px !important;
        font-size: 16px !important;
        border: 1px solid #e1e1e1 !important;
        background: #f8f9fa !important;
        color: #1a1a1a !important;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
        line-height: 1.4 !important;
        box-sizing: border-box !important;
        display: flex !important;
        align-items: center !important;
        font-weight: 400 !important;
        transition: all 0.2s ease !important;
        word-break: break-all !important;
    }

    .share-result .result-container .result-url:hover {
        background: white !important;
        border-color: #007aff !important;
    }
}

.result-url:hover {
    background: #f0f8ff;
    border-color: #007bff;
}

.copy-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media screen and (max-width: 768px) {
    .share-result .result-container .copy-btn {
        padding: 16px 20px !important;
        border-radius: 12px !important;
        font-size: 16px !important;
        width: 60px !important;
        background: #007aff !important;
        border: 1px solid #007aff !important;
        color: white !important;
        font-weight: 600 !important;
        transition: all 0.2s ease !important;
        box-sizing: border-box !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
    }

    .share-result .result-container .copy-btn:hover {
        background: #0056cc !important;
        border-color: #0056cc !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 12px rgba(0, 122, 255, 0.35) !important;
    }
}

.copy-btn:hover {
    background: #0056b3;
    transform: scale(1.05);
}

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

.mobile-share-buttons {
    display: none;
    gap: 10px;
}

@media (max-width: 768px) {
    .mobile-share-buttons {
        gap: 16px;
    }
}

.mobile-share-btn {
    flex: 1;
    padding: 12px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .mobile-share-btn {
        padding: 18px;
        border-radius: 12px;
        font-size: 18px;
        font-weight: 700;
    }
}

.tooltip {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 2000;
    display: none;
}

.share-btn {
    width: 100%;
    background: #007cba;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.share-btn:hover {
    background: #005a87;
}

.share-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

.share-btn:disabled:hover {
    background: #6c757d;
    transform: none;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.loading-spinner {
    width: 12vw;
    height: 12vw;
    max-width: 60px;
    max-height: 60px;
    min-width: 40px;
    min-height: 40px;
    border: 0.8vw solid rgba(255, 255, 255, 0.3);
    border-top: 0.8vw solid #fff;
    max-border-width: 4px;
    min-border-width: 2px;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@media (min-width: 769px) {
    .loading-spinner {
        width: 8vh;
        height: 8vh;
        border-width: 0.5vh;
    }
}

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

    100% {
        transform: rotate(360deg);
    }
}

.loading-overlay.hidden {
    display: none;
}

.share-form {
    padding: 20px;
}

@media (max-width: 768px) {
    .share-form {
        padding: 24px 24px 32px !important;
        background: white !important;
    }
}

@media (min-width: 769px) {
    .share-form {
        padding: 3vh;
    }
}

.title-input {
    width: 100%;
    font-size: 16px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .title-input {
        font-size: 16px !important;
        padding: 16px 20px !important;
        border-radius: 12px !important;
        margin-bottom: 20px !important;
        border: 1px solid #e1e1e1 !important;
        background: #f8f9fa !important;
        color: #1a1a1a !important;
        font-weight: 400 !important;
        line-height: 1.4 !important;
        transition: all 0.2s ease !important;
    }

    .title-input:focus {
        border-color: #007aff !important;
        background: white !important;
        outline: none !important;
        box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1) !important;
    }

    .title-input::placeholder {
        color: #8e8e93 !important;
        font-weight: 400 !important;
    }
}

@media (min-width: 769px) {
    .title-input {
        font-size: 2vh;
        padding: 2vh;
        border-radius: 1vh;
        margin-bottom: 2vh;
    }
}

.share-btn {
    width: 100%;
    background: #007cba;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .share-btn {
        padding: 16px 24px !important;
        border-radius: 12px !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        margin-bottom: 16px !important;
        background: #007aff !important;
        border: none !important;
        color: white !important;
        letter-spacing: -0.2px !important;
        transition: all 0.2s ease !important;
        box-shadow: 0 2px 8px rgba(0, 122, 255, 0.25) !important;
    }

    .share-btn:hover {
        background: #0056cc !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 12px rgba(0, 122, 255, 0.35) !important;
    }

    .share-btn:active {
        transform: translateY(0) !important;
        box-shadow: 0 1px 4px rgba(0, 122, 255, 0.25) !important;
    }
}

@media (min-width: 769px) {
    .share-btn {
        padding: 2vh;
        border-radius: 1vh;
        font-size: 2vh;
    }
}

.share-btn:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.share-btn:active {
    transform: translateY(0);
}

@media (hover: none) and (pointer: coarse) {
    .action-button:hover .action-icon {
        transform: none;
    }

    .share-btn:hover {
        transform: none;
    }

    .close-btn:hover {
        background: none;
    }
}

.view-count {
    position: absolute;
    bottom: calc(var(--frame-width) / 25 + var(--frame-width) / 10 * 2 / 3);
    left: calc(var(--frame-width) / 25);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: calc(var(--frame-width) / 50) calc(var(--frame-width) / 36);
    border-radius: calc(var(--frame-width) / 40);
    font-size: calc(var(--frame-width) / 30);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: calc(var(--frame-width) / 60);
    z-index: 5;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    letter-spacing: 0.5px;
    opacity: 0;
    transform: scale(0.8) translateY(10px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.view-count.show {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.view-count.hidden {
    display: none;
}

.view-count .eye-icon {
    font-size: 1.1em;
    opacity: 0.9;
}

.view-count .count-number {
    font-weight: 700;
    letter-spacing: 0.02em;
}

.view-count .eye-icon {
    font-size: 16px;
}

.view-count .count-number {
    font-weight: 600;
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 30, 30, 0.95);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 300px;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(10px);
}

.toast-content {
    text-align: center;
}

.toast-title {
    font-size: 14px;
    color: #aaa;
    margin-bottom: 4px;
}

.toast-message {
    font-size: 18px;
    font-weight: bold;
}

.toast.hidden {
    display: none !important;
    visibility: hidden;
}

/* Version Label */
.version-label {
    position: fixed;
    top: 8px;
    left: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    z-index: 99999;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}