@media (hover: none) and (pointer: coarse) {
    /* 호버 효과 제거 */
    .image-select-checkbox:hover,
    .download-button:hover,
    .instagram-button:hover,
    .share-button:hover {
        transform: none;
        background-color: #ffffffe0;
    }

    .image-select-checkbox:hover::after {
        color: #666;
    }

    .download-button:hover i,
    .instagram-button:hover i,
    .share-button:hover i {
        color: #666;
    }

    .download-button,
    .instagram-button,
    .share-button,
    .image-select-checkbox {
        background-color: #ffffffe0;
    }

    .download-button i {
        color: #1f40a1;
    }
    
    .instagram-button i {
        color: #e4405f;
    }
    
    .share-button i {
        color: #dba134;
    }

    /* 체크된 상태는 유지 */
    .image-select-checkbox:checked {
        background-color: #4e5e8f;
    }

    .image-select-checkbox:checked::after {
        color: white;
    }
}

@media (max-width: 768px) and (orientation: portrait) {
    #compression-modal {
        position: fixed;
        -webkit-overflow-scrolling: touch;
    }
    
    #compression-modal .window-frame {
        max-height: 90vh;
        overflow-y: auto;
    }
}

@media only screen and (max-width: 720px) {

    #compression-modal .window-frame {
        width: 85%;
        max-width: 400px;
    }

    .compression-content {
        padding: 20px;
    }

    #compression-title {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .progress-bar {
        height: 8px;
    }

    .compression-status {
        font-size: 14px;
    }

    .loading-text {
        font-size: 12px;
    }

    .live-status {
        position: absolute;
        top: 3px;
        left: 3px;
        padding: 2px 7px;
        font-size: 9px;
        height: 15px;
        line-height: 15px;
        text-align: center;
    }

    .tag-suggestions {
        width: calc(100% - 7.2rem);
        font-size: 0.9rem;
    }

    .tag-suggestions li {
        padding: 7px;
        cursor: pointer;
    }

    .tag-suggestions li:hover {
        background-color: #eee;
    }

    .tag-filter label {
        background-color: #ddd;
        color: #444;
        padding: 12px 12px;
        border-radius: 12px;
    }

    .easysearch button {
        padding: 9px 14px;
        font-size: 0.9rem;
        border-radius: 12px;
        margin: 4px;
    }

    .tag-filter {
        display: flex;
        justify-content: left;
        margin: 0 calc(0.2rem + 5px);
        font-size: 0.8rem;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        margin-bottom: 10px;
    }

    .tag-filter::-webkit-scrollbar {
        display: none;
    }

    .easysearch {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        margin-left: 0.2rem;
        padding: 0px 1px;
    }

    .search-form-flex {
        padding: 0 5px;
    }

    .search-form {
        justify-content: center;
        margin: 0.2rem;
    }

    .search-input {
        padding: 9px;
        font-size: 16px;
        height: 2.4rem;
        width: 82%;
    }

    .search-button,
    .clear-search-button {
        padding: 9px 14px;
        font-size: 16px;
        height: 2.4rem;
        width: 2.6rem;
    }

    .search-button i,
    .clear-search-button i {
        font-size: 0.8rem;
    }

    .page-setting {
        width: 100%;
        display: flex;
        justify-content: center;
        margin-bottom: 20px;
    }

    .page-setting input {
        padding: 5px;
        font-size: 16px;
        margin-right: 1px;
        width: 60px;
    }

    .image-container:hover {
        transform: scale(1);
    }

    .page-setting button {
        padding: 5px 10px;
        font-size: 16px;
        background-color: #2d465f;
        color: white;
        border: none;
        cursor: pointer;
    }

    .gallery {
        padding: 0px;
        text-align: center;
        font-size: 0;
        margin: 0 auto;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 2px;
    }

    .gallery img {
        height: 220px;
        width: 10px;
        border-radius: 13px 13px 3px 3px;
        object-fit: contain;
        min-height: 220px;
        max-height: 220px;
    }

    .image-container {
        margin: 0;
        border-radius: 15px;
        text-align: center;
        border: 1px solid #ccc;
        padding: 1px;
        /* display: inline-flex; */
        flex-direction: column;
        align-items: center;
        box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
        transition: transform 0.3s ease;
        position: relative;
        height: 255px;
        min-height: 255px;
        max-height: 255px;
        justify-content: space-between;
        min-width: 10px;
    }

    .hover-menu {
        bottom: 10px;
        right: 10px;
        width: 180px;
    }

    .hover-menu .selection-count-container {
        font-size: 14px;
        margin: 10px 0 10px 0;
    }

    .hover-menu button {
        font-size: 11px;
        padding: 10px 15px;
        margin-bottom: 5px;
    }

    .hover-menu-body {
        padding: 0 8px;
        margin-bottom: 5px;
    }

    .date-filter {
        justify-content: center;
        margin-left: 0.2rem;
        margin-top: 14px;
        margin-bottom: 8px;
        padding: 0px 1px;
        height: 35px;
    }

    .date-filter input:first-child {
        margin-left: 0;
    }

    .date-filter .label {
        font-size: 16px;
    }

    .date-filter input {
        box-sizing: border-box;
        font-size: 15px;
        box-shadow: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        height: 35px;
    }

    .reset-button {
        box-sizing: border-box;
        box-shadow: none;
        height: 35px;
    }

    .reset-button i {
        font-size: 13px;
    }

    .pagination-container {
        width: calc(100% - 1.6rem);
    }

    .pagination a,
    .pagination span {
        flex-basis: calc(10% - 10px);
        margin: 0 1px;
        font-size: 0.8rem;
        padding: 6px 5px;
    }

    .pagination {
        width: 100%;
        margin-bottom: 10px;
        align-items: center;
    }

    .image-container b {
        top: 8px;
        right: 8px;
        gap: 4px;
    }

    .download-button,
    .instagram-button,
    .share-button,
    .image-select-checkbox {
        width: 29px;
        height: 29px;
        font-size: 13px;
    }


    .image-name {
        font-size: 0.62rem;
    }

    .navbar {
        padding: 0;
        margin-bottom: 14px;
    }

    .navbar .title {
        font-size: 1.55rem;
        margin-left: 0.8rem;
        margin-top: 1rem;
    }

    .navbar .subtitle,
    .navbar .update-status {
        color: #585858;
        font-size: 0.75rem;
        margin-left: 0.8rem;
        margin-top: 0.1rem;
    }

    .navbar .page-number {
        font-size: 0.95rem;
        margin-right: 0.8rem;
        margin-top: 2rem;
    }

    .metadata {
        font-size: 0.48rem;
        line-height: 0.5;
    }

    .alert-popup {
        bottom: 5%;
        padding: 8px 16px;
        font-size: 12px;
        border-radius: 4px;
        width: auto;
        max-width: 90vw;
        text-align: center;
    }

    .popup img,
    .popup video {
        max-height: 70vh;
    }

    .window-frame {
        width: 95%;
    }

    #close-button {
        width: 12px;
        height: 12px;
    }

    .window-header-button {
        width: 12px;
        height: 12px;
    }

    footer {
        margin: 20px 0;
    }

    footer p {
        font-size: 0.75rem;
    }

    .search-result-nav {
        flex-direction: column;
        padding: 10px;
        margin: 10px;
        align-items: center;
    }

    .search-preview-container {
        width: 160px;
        margin-right: 0;
        margin-bottom: 10px;
    }

    .search-buttons {
        width: 100%;
        justify-content: center;
        gap: 8px;
    }

    .search-again-button,
    .reset-search-button {
        padding: 6px 12px;
        font-size: 12px;
    }

    .search-again-button i,
    .reset-search-button i {
        font-size: 12px;
    }

    .similarity-badge {
        top: 5px;
        left: 5px;
        padding: 2px 6px;
        font-size: 11px;
        border-radius: 3px;
    }

}

@media only screen and (max-width: 385px) {

    #compression-modal .window-frame {
        width: 90%;
        max-width: 320px;
    }

    .compression-content {
        padding: 15px;
    }

    #compression-title {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .progress-bar {
        height: 6px;
    }

    .compression-status {
        font-size: 13px;
    }

    .search-preview-container {
        width: 140px;
    }

    .search-again-button,
    .reset-search-button {
        padding: 5px 10px;
        font-size: 11px;
    }

    .image-container {
        height: 215px;
        min-height: 215px;
        max-height: 215px;
    }

    .gallery img {
        height: 180px;
        min-height: 180px;
        max-height: 180px;
    }

    .image-container b {
        top: 8px;
        right: 8px;
        gap: 3px;
    }

    .download-button,
    .instagram-button,
    .share-button,
    .image-select-checkbox {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }
}

@media only screen and (max-width: 375px) {
    .image-container {
        height: 175px;
        min-height: 175px;
        max-height: 175px;
    }

    .gallery img {
        height: 140px;
        min-height: 140px;
        max-height: 140px;
    }

}

@media only screen and (max-width: 350px) {
    .image-container {
        height: 135px;
        min-height: 135px;
        max-height: 135px;
    }

    .gallery img {
        height: 100px;
        min-height: 100px;
        max-height: 100px;
    }

}

@media only screen and (max-width: 320px) {
    .image-container {
        height: 135px;
        min-height: 135px;
        max-height: 135px;
    }

    .gallery img {
        height: 100px;
        min-height: 100px;
        max-height: 100px;
    }

    .search-preview-container {
        width: 120px;
    }

    .search-buttons {
        gap: 5px;
    }

    .search-again-button,
    .reset-search-button {
        padding: 4px 8px;
        font-size: 10px;
    }

}