/**
 * LGT Vote Plugin - Frontend Styles
 * v2.1.1 - CSS優先度修正
 */

.lgt-vote-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif !important;
    margin: 2rem 0 !important;
    padding: 0 !important;
    line-height: 1.5 !important;
}

.lgt-vote-widget * {
    box-sizing: border-box !important;
}

.lgt-vote-container {
    background: #FFFFFF !important;
    border: 4px solid #000000 !important;
    box-shadow: 8px 8px 0px #000000 !important;
    padding: 24px !important;
    max-width: 400px !important;
    margin: 0 auto !important;
    position: static !important;
    border-radius: 0 !important;
}

/* 質問文 - 完全リセット（疑似要素も） */
.lgt-vote-question {
    display: block !important;
    position: static !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif !important;
    font-size: 1.4rem !important;
    font-weight: 900 !important;
    color: #000000 !important;
    margin: 0 0 16px 0 !important;
    padding: 0 !important;
    text-align: center !important;
    line-height: 1.4 !important;
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    border-top: none !important;
    border-bottom: none !important;
    text-decoration: none !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

.lgt-vote-question::before,
.lgt-vote-question::after {
    content: none !important;
    display: none !important;
    position: static !important;
    background: none !important;
}

/* メッセージ（投票ありがとう！など） */
.lgt-vote-message {
    text-align: center !important;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
    margin-bottom: 16px !important;
    min-height: 1.5em !important;
    color: #000000 !important;
}

/* ボタンエリア */
.lgt-vote-buttons {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 投票ボタン共通 - 背景色はインラインスタイルから継承 */
.lgt-vote-btn {
    display: block !important;
    width: 100% !important;
    padding: 16px 24px !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif !important;
    font-size: 1.1rem !important;
    font-weight: 800 !important;
    text-transform: none !important;
    letter-spacing: 0.5px !important;
    border: 3px solid #000000 !important;
    border-radius: 0 !important;
    box-shadow: 4px 4px 0px #000000 !important;
    cursor: pointer !important;
    transition: all 0.1s ease !important;
    color: #000000 !important;
    text-align: center !important;
    box-sizing: border-box !important;
    text-decoration: none !important;
    line-height: 1.4 !important;
    /* 背景色はインラインで指定されるのでここでは設定しない */
}

.lgt-vote-btn:hover {
    transform: translate(2px, 2px) !important;
    box-shadow: 2px 2px 0px #000000 !important;
    filter: brightness(1.1) !important;
}

.lgt-vote-btn:active {
    transform: translate(4px, 4px) !important;
    box-shadow: 0px 0px 0px #000000 !important;
}

.lgt-vote-btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: 4px 4px 0px #000000 !important;
}

/* 結果表示エリア */
.lgt-vote-results {
    margin-top: 20px !important;
}

.lgt-vote-result-item {
    margin-bottom: 16px !important;
}

.lgt-vote-result-item:last-child {
    margin-bottom: 0 !important;
}

.lgt-vote-result-label {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 6px !important;
    font-weight: 700 !important;
    font-size: 0.9rem !important;
}

.lgt-vote-result-text {
    color: #000000 !important;
}

.lgt-vote-result-percent {
    color: #000000 !important;
    font-weight: 900 !important;
}

/* 結果バー */
.lgt-vote-result-bar {
    position: relative !important;
    height: 36px !important;
    background: #FFFFFF !important;
    border: 3px solid #000000 !important;
    overflow: hidden !important;
    border-radius: 0 !important;
}

.lgt-vote-result-fill {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    height: 100% !important;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

.lgt-vote-result-count {
    position: absolute !important;
    top: 50% !important;
    left: 12px !important;
    transform: translateY(-50%) !important;
    font-weight: 800 !important;
    font-size: 0.9rem !important;
    color: #000000 !important;
    z-index: 1 !important;
}

/* ローディング */
.lgt-vote-loading {
    text-align: center !important;
    padding: 20px !important;
    font-weight: 700 !important;
    color: #000000 !important;
}

.lgt-vote-spinner {
    display: inline-block !important;
    width: 20px !important;
    height: 20px !important;
    border: 3px solid #000000 !important;
    border-top-color: transparent !important;
    border-radius: 50% !important;
    animation: lgt-spin 0.8s linear infinite !important;
    margin-right: 8px !important;
    vertical-align: middle !important;
}

@keyframes lgt-spin {
    to {
        transform: rotate(360deg);
    }
}

/* フッター */
.lgt-vote-footer {
    margin-top: 20px !important;
    padding-top: 16px !important;
    border-top: 2px dashed #CCCCCC !important;
    text-align: center !important;
}

.lgt-vote-footer-text {
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    color: #666666 !important;
    margin-bottom: 6px !important;
}

.lgt-vote-footer-stats {
    font-size: 0.75rem !important;
    color: #999999 !important;
}

.lgt-vote-current-time {
    font-weight: 600 !important;
}

.lgt-vote-total-count {
    font-weight: 700 !important;
    color: #333333 !important;
}

/* エラー表示 */
.lgt-vote-error {
    background: #FFE5E5 !important;
    border: 2px solid #FF6B6B !important;
    padding: 16px !important;
    color: #CC0000 !important;
    font-weight: 600 !important;
    text-align: center !important;
    margin: 1rem 0 !important;
}

/* アニメーションはJSで制御 */
.lgt-vote-results {
    margin-top: 20px !important;
}

/* レスポンシブ */
@media (max-width: 480px) {
    .lgt-vote-container {
        margin: 0 10px !important;
        padding: 20px 16px !important;
        box-shadow: 6px 6px 0px #000000 !important;
    }
    
    .lgt-vote-question {
        font-size: 1.2rem !important;
    }
    
    .lgt-vote-btn {
        padding: 14px 20px !important;
        font-size: 1rem !important;
    }
}

/* ダークモード対応（オプション） */
@media (prefers-color-scheme: dark) {
    .lgt-vote-container {
        background: #1a1a1a !important;
        border-color: #ffffff !important;
        box-shadow: 8px 8px 0px #ffffff !important;
    }
    
    .lgt-vote-question,
    .lgt-vote-result-text,
    .lgt-vote-result-percent,
    .lgt-vote-result-count,
    .lgt-vote-message {
        color: #ffffff !important;
    }
    
    .lgt-vote-result-bar {
        background: #333333 !important;
        border-color: #ffffff !important;
    }
    
    .lgt-vote-btn {
        border-color: #ffffff !important;
        box-shadow: 4px 4px 0px #ffffff !important;
        color: #000000 !important;
    }
    
    .lgt-vote-spinner {
        border-color: #ffffff !important;
        border-top-color: transparent !important;
    }
    
    .lgt-vote-footer {
        border-top-color: #444444 !important;
    }
    
    .lgt-vote-footer-text {
        color: #aaaaaa !important;
    }
    
    .lgt-vote-footer-stats {
        color: #888888 !important;
    }
    
    .lgt-vote-total-count {
        color: #ffffff !important;
    }
}
