/* custom-popup-style.css */
#custom-popup-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 1); /* 完全な黒に変更 */
    -webkit-backdrop-filter: blur(5px); /* Safari対応 */
    backdrop-filter: blur(5px); /* 背景ぼかし効果 */
    z-index: 99999;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translate(-50%, -60%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

#custom-popup-modal .modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 30px 35px 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 10px 30px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideIn 0.4s ease-out;
}

#custom-popup-modal .close-popup-button {
    color: #999;
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 32px;
    font-weight: 300;
    line-height: 1;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#custom-popup-modal .close-popup-button:hover,
#custom-popup-modal .close-popup-button:focus {
    color: #fff;
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(238, 90, 82, 0.4);
}

#custom-popup-modal h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 2em;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

#custom-popup-modal p {
    color: #555;
    line-height: 1.7;
    margin-bottom: 20px;
    font-size: 1.1em;
    font-weight: 400;
}

#custom-popup-modal img {
    max-width: 100%;
    height: auto;
    max-height: 300px;
    margin: 20px auto;
    display: block;
    border-radius: 15px;
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.15),
        0 5px 15px rgba(0, 0, 0, 0.08);
    object-fit: contain;
    transition: transform 0.3s ease;
}

#custom-popup-modal img:hover {
    transform: scale(1.02);
}

#custom-popup-modal .popup-button {
    display: inline-block;
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-size: 1.1em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    margin-top: 25px;
    box-shadow: 
        0 10px 30px rgba(102, 126, 234, 0.3),
        0 5px 15px rgba(102, 126, 234, 0.2);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

#custom-popup-modal .popup-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

#custom-popup-modal .popup-button:hover::before {
    left: 100%;
}

#custom-popup-modal .popup-button:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-3px);
    box-shadow: 
        0 15px 40px rgba(102, 126, 234, 0.4),
        0 8px 20px rgba(102, 126, 234, 0.3);
}

#custom-popup-modal .popup-button:active {
    transform: translateY(-1px);
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    #custom-popup-modal .modal-content {
        width: 95%;
        padding: 25px 20px 30px;
        max-height: 95vh;
        border-radius: 15px;
    }
    
    #custom-popup-modal h2 {
        font-size: 1.6em;
        margin-bottom: 15px;
    }
    
    #custom-popup-modal p {
        font-size: 1em;
        margin-bottom: 15px;
    }
    
    #custom-popup-modal img {
        max-height: 200px;
        margin: 15px auto;
        border-radius: 12px;
    }
    
    #custom-popup-modal .popup-button {
        padding: 12px 25px;
        font-size: 1em;
        margin-top: 20px;
    }
    
    #custom-popup-modal .close-popup-button {
        top: 12px;
        right: 15px;
        font-size: 28px;
        width: 35px;
        height: 35px;
    }
}

/* 非常に小さな画面用 */
@media (max-width: 480px) {
    #custom-popup-modal .modal-content {
        width: 98%;
        padding: 20px 15px 25px;
        border-radius: 12px;
    }
    
    #custom-popup-modal img {
        max-height: 150px;
        margin: 12px auto;
        border-radius: 10px;
    }
    
    #custom-popup-modal h2 {
        font-size: 1.4em;
        margin-bottom: 12px;
    }
    
    #custom-popup-modal p {
        font-size: 0.9em;
        margin-bottom: 12px;
    }
    
    #custom-popup-modal .popup-button {
        padding: 10px 20px;
        font-size: 0.9em;
        margin-top: 15px;
    }
    
    #custom-popup-modal .close-popup-button {
        top: 10px;
        right: 12px;
        font-size: 24px;
        width: 30px;
        height: 30px;
    }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    #custom-popup-modal .modal-content {
        background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    #custom-popup-modal h2 {
        color: #e2e8f0;
        background: linear-gradient(135deg, #81e6d9 0%, #9f7aea 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
    
    #custom-popup-modal p {
        color: #cbd5e0;
    }
    
    #custom-popup-modal .close-popup-button {
        color: #a0aec0;
    }
    
    #custom-popup-modal .close-popup-button:hover {
        background: linear-gradient(135deg, #f56565, #e53e3e);
    }
}