/**
 * シェアモーダル改善CSS
 * より洗練されたデザインと完璧なレスポンシブ対応
 */

/* シェアオプションコンテナ */
.share-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin: 20px 0;
    padding: 0 5px;
}

/* シェアボタン基本スタイル */
.share-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    border: none;
    border-radius: 12px;
    background: #f8f9fa;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-height: 80px;
}

.share-button:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.share-button:hover:before {
    width: 300px;
    height: 300px;
}

.share-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.share-button:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* アイコンスタイル */
.share-button i {
    font-size: 24px;
    margin-bottom: 8px;
    transition: transform 0.3s ease;
}

.share-button:hover i {
    transform: scale(1.1);
}

.share-button span {
    font-size: 12px;
    margin-top: 4px;
    white-space: nowrap;
}

/* 各SNSのブランドカラー */
.share-button.twitter {
    background: linear-gradient(135deg, #1DA1F2, #1a91da);
    color: white;
}

.share-button.twitter:hover {
    background: linear-gradient(135deg, #1a91da, #1681c4);
    box-shadow: 0 8px 20px rgba(29, 161, 242, 0.3);
}

.share-button.line {
    background: linear-gradient(135deg, #00C300, #00b200);
    color: white;
}

.share-button.line:hover {
    background: linear-gradient(135deg, #00b200, #00a000);
    box-shadow: 0 8px 20px rgba(0, 195, 0, 0.3);
}

.share-button.facebook {
    background: linear-gradient(135deg, #1877F2, #166fe5);
    color: white;
}

.share-button.facebook:hover {
    background: linear-gradient(135deg, #166fe5, #1461d1);
    box-shadow: 0 8px 20px rgba(24, 119, 242, 0.3);
}

.share-button.email {
    background: linear-gradient(135deg, #EA4335, #dc3e31);
    color: white;
}

.share-button.email:hover {
    background: linear-gradient(135deg, #dc3e31, #c5362a);
    box-shadow: 0 8px 20px rgba(234, 67, 53, 0.3);
}

/* コピーボタン（追加） */
.share-button.copy {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
}

.share-button.copy:hover {
    background: linear-gradient(135deg, #5a6268, #4e555b);
    box-shadow: 0 8px 20px rgba(108, 117, 125, 0.3);
}

.share-button.copy.success {
    background: linear-gradient(135deg, #28a745, #24963e);
    animation: successPulse 0.5s ease;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* シェアテキストエリア */
.share-text {
    margin: 20px 0;
    padding: 0 5px;
}

.share-text textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.3s ease;
    font-family: inherit;
    background: #f8f9fa;
}

.share-text textarea:focus {
    outline: none;
    border-color: #4a90e2;
    background: white;
}

/* モーダルヘッダーの改善 */
.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.modal-header h3 i {
    color: #4a90e2;
}

/* クローズボタンの改善 */
.modal-header .close-button {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: #f1f3f5;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-header .close-button:hover {
    background: #e9ecef;
    transform: rotate(90deg);
}

/* タブレット対応 */
@media (max-width: 768px) {
    .share-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .share-button {
        min-height: 70px;
        padding: 12px 8px;
    }
    
    .share-button i {
        font-size: 20px;
    }
    
    .share-button span {
        font-size: 11px;
    }
}

/* スマートフォン対応 */
@media (max-width: 480px) {
    .share-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin: 15px 0;
    }
    
    .share-button {
        min-height: 65px;
        padding: 10px 6px;
        border-radius: 10px;
    }
    
    .share-button i {
        font-size: 18px;
        margin-bottom: 6px;
    }
    
    .share-button span {
        font-size: 10px;
    }
    
    .share-text textarea {
        font-size: 13px;
        padding: 10px;
    }
    
    .modal-header h3 {
        font-size: 16px;
    }
}

/* 超小型デバイス対応 */
@media (max-width: 360px) {
    .share-options {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    
    .share-button {
        min-height: 60px;
        padding: 8px 4px;
    }
    
    .share-button i {
        font-size: 16px;
    }
    
    .share-button span {
        font-size: 9px;
    }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    .modal-content {
        background: #2b2b2b;
        color: #e0e0e0;
    }
    
    .share-button:not(.twitter):not(.line):not(.facebook):not(.email):not(.copy) {
        background: #3a3a3a;
        color: #e0e0e0;
    }
    
    .share-text textarea {
        background: #3a3a3a;
        border-color: #4a4a4a;
        color: #e0e0e0;
    }
    
    .modal-header .close-button {
        background: #3a3a3a;
        color: #e0e0e0;
    }
    
    .modal-header .close-button:hover {
        background: #4a4a4a;
    }
}

/* アクセシビリティ改善 */
.share-button:focus-visible {
    outline: 3px solid #4a90e2;
    outline-offset: 2px;
}

/* アニメーション無効化（アクセシビリティ） */
@media (prefers-reduced-motion: reduce) {
    .share-button,
    .share-button:before,
    .share-button i,
    .modal-header .close-button {
        transition: none;
    }
    
    .share-button:hover {
        transform: none;
    }
    
    @keyframes successPulse {
        0%, 100% { transform: none; }
    }
}