/* YouTube動画自動生成ツール Pro - カスタムCSS */

/* リセット & ベーススタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* カラーパレット */
:root {
    --primary-color: #667eea;
    --primary-dark: #764ba2;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-dark: #1f2937;
    --text-gray: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

/* ヘッダースタイル */
.gradient-bg {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.glass-effect {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ボタンスタイル */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #059669;
    transform: translateY(-2px);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background-color: #dc2626;
    transform: translateY(-2px);
}

.btn-gray {
    background-color: #6b7280;
    color: white;
}

.btn-gray:hover:not(:disabled) {
    background-color: #4b5563;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* フォームスタイル */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background-color: white;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

/* カードスタイル */
.card {
    background: white;
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.card-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-right: 16px;
}

.card-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
}

/* ステップインジケーター */
.step-indicator {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: #e5e7eb;
    color: #6b7280;
}

.step-indicator.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    transform: scale(1.1);
}

.step-indicator.completed {
    background: linear-gradient(135deg, var(--secondary-color), #059669);
    color: white;
}

/* プログレスバー */
.progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin: 16px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* モーダルスタイル */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-container {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
}

.modal-close, .modal-close-btn {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.modal-close:hover, .modal-close-btn:hover {
    background: #ef4444;
    border-color: #dc2626;
    color: white;
    transform: scale(1.05);
}

/* アラート・メッセージ */
.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background-color: #f0fdf4;
    border-color: var(--secondary-color);
    color: #166534;
}

.alert-error {
    background-color: #fef2f2;
    border-color: var(--danger-color);
    color: #991b1b;
}

.alert-warning {
    background-color: #fffbeb;
    border-color: var(--warning-color);
    color: #92400e;
}

.alert-info {
    background-color: #eff6ff;
    border-color: var(--primary-color);
    color: #1e40af;
}

/* ログエリア */
.log-area {
    background: #1f2937;
    border-radius: 8px;
    padding: 16px;
    max-height: 200px;
    overflow-y: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    color: #f9fafb;
}

.log-entry {
    margin-bottom: 4px;
    padding: 2px 0;
}

.log-entry:last-child {
    margin-bottom: 0;
}

/* アニメーション */
.pulse-animation {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .card {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .card-header {
        flex-direction: column;
        text-align: center;
    }
    
    .card-icon {
        margin-right: 0;
        margin-bottom: 12px;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .modal-content {
        padding: 20px;
        margin: 10px;
    }
}

/* ユーティリティクラス */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mt-4 { margin-top: 16px; }
.p-2 { padding: 8px; }
.p-4 { padding: 16px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.space-x-2 > * + * { margin-left: 8px; }
.space-y-2 > * + * { margin-top: 8px; }
.w-full { width: 100%; }
.hidden { display: none; }

/* Alpine.js x-cloak directive */
[x-cloak] { 
    display: none !important; 
}

/* コンテナ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ヘッダー固有スタイル */
header {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

header .container {
    padding: 32px 24px;
}

header h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
    color: white;
}

header p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 18px;
}

/* メインコンテンツ */
main {
    padding: 32px 0;
}

/* ライセンス情報パネル */
.license-panel {
    min-width: 280px;
}

.license-info {
    margin-bottom: 12px;
}

.license-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.license-info p {
    font-size: 14px;
    color: var(--text-gray);
}

/* タブスタイル */
.tab-container {
    display: flex;
    background-color: #f3f4f6;
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 24px;
}

.tab-button {
    flex: 1;
    padding: 8px 16px;
    background: none;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-button.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 背景画像プレビュー */
.image-preview {
    width: 100%;
    max-width: 300px;
    height: 200px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9fafb;
    overflow: hidden;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.image-preview-placeholder {
    color: var(--text-gray);
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

/* ドラッグ&ドロップ */
.file-drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 24px 16px;
    text-align: center;
    background-color: #f9fafb;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* スマホ対応 */
@media (max-width: 768px) {
    .file-drop-zone {
        padding: 20px 12px;
    }
    
    .file-drop-zone h4 {
        font-size: 14px;
    }
    
    .file-drop-zone p {
        font-size: 11px;
    }
}

.file-drop-zone:hover, 
.file-drop-zone.drag-over {
    border-color: var(--primary-color);
    background-color: rgba(102, 126, 234, 0.05);
}

.file-drop-zone i {
    font-size: 48px;
    color: var(--text-gray);
    margin-bottom: 16px;
}

.file-drop-zone h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.file-drop-zone p {
    font-size: 14px;
    color: var(--text-gray);
}

/* Template Selection Modal */
.template-tab {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-white);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-gray);
    cursor: pointer;
    transition: all 0.2s ease;
}

.template-tab:hover {
    border-color: var(--primary-color);
    color: var(--text-dark);
}

.template-tab-active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-color: var(--primary-color);
}

.template-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    background: var(--bg-white);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.template-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.template-card-selected {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.template-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.template-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
    flex: 1;
}

.template-card-category {
    font-size: 12px;
    font-weight: 500;
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    margin-left: 12px;
}

.template-card-description {
    font-size: 14px;
    color: var(--text-gray);
    margin-bottom: 12px;
    line-height: 1.5;
}

.template-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.template-tag {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-gray);
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    border-radius: 12px;
}

.template-preview {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* New Header Layout */
.header-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 60px;
}

.header-title-section {
    flex: 1;
    min-width: 0; /* 縮小を許可 */
    overflow: hidden;
}

.header-title {
    font-size: 20px;
    font-weight: 700;
    color: white;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    margin: 4px 0 0 0;
    line-height: 1.2;
}

.header-actions-section {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0; /* 縮小を禁止 */
}

.admin-button-container {
    display: flex;
}

.coin-status-compact-mobile {
    display: flex;
    align-items: center;
}

.coin-display-mobile {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(245, 158, 11, 0.25);
    border: 1px solid rgba(245, 158, 11, 0.5);
    border-radius: 12px;
    padding: 6px 10px;
    font-weight: 700;
    color: white;
    font-size: 14px;
}

.coin-display-mobile i {
    color: #f59e0b;
    font-size: 14px;
}

.coin-display-mobile .coin-amount {
    color: #f59e0b;
    font-size: 16px;
    font-weight: 800;
}

/* Responsive Header Actions (Legacy) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.license-status-compact {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.license-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    color: white;
    font-size: 14px;
    font-weight: 600;
}

.license-badge i {
    color: #f59e0b;
    font-size: 16px;
}

.usage-indicator {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.coin-status {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    background: rgba(245, 158, 11, 0.2);
    padding: 4px 8px;
    border-radius: 12px;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* より目立つコイン表示 */
.coin-status-prominent {
    display: flex;
    align-items: center;
    justify-content: center;
}

.coin-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(245, 158, 11, 0.25);
    border: 2px solid rgba(245, 158, 11, 0.5);
    border-radius: 16px;
    padding: 8px 16px;
    font-weight: 700;
    color: white;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    transition: all 0.3s ease;
}

.coin-display:hover {
    background: rgba(245, 158, 11, 0.35);
    border-color: rgba(245, 158, 11, 0.7);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

.coin-amount {
    font-size: 18px;
    font-weight: 800;
    color: #f59e0b;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.coin-label {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

.action-menu {
    position: relative;
}

.menu-toggle-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
}

.menu-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.action-dropdown {
    position: absolute;
    top: 48px;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    min-width: 180px;
    z-index: 10;
}

.action-dropdown[x-show="showActionMenu"] {
    z-index: 5; /* モーダルが開いた時はさらに下に */
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    text-align: left;
    color: var(--text-dark);
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background: var(--bg-light);
}

.dropdown-item i {
    width: 16px;
    text-align: center;
    font-size: 14px;
}

.dropdown-divider {
    border: 0;
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

.logout-item {
    color: var(--danger-color);
}

.logout-item:hover {
    background: rgba(239, 68, 68, 0.05);
}

/* Template Actions */
.template-actions {
    display: flex;
    gap: 6px;
    margin-left: auto;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.template-card:hover .template-actions {
    opacity: 1;
}

.template-action-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-gray);
    transition: all 0.2s ease;
}

.template-action-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.template-delete-btn:hover {
    background: var(--danger-color);
    border-color: var(--danger-color);
}

/* Modal Footer */
.modal-footer {
    background: var(--bg-light);
    padding: 16px 24px;
    display: flex;
    flex-direction: row-reverse;
    gap: 12px;
    border-top: 1px solid var(--border-color);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    /* コンテナ全体 */
    header .container {
        padding-left: 8px;
        padding-right: 8px;
    }
    
    /* 新しいヘッダーレイアウト */
    .header-layout {
        gap: 8px;
        min-height: 56px;
    }
    
    /* タイトルセクション */
    .header-title {
        font-size: 14px !important;
        line-height: 1.1;
    }
    
    .header-subtitle {
        font-size: 11px !important;
        margin-top: 2px;
    }
    
    /* アクションセクション */
    .header-actions-section {
        gap: 4px;
        flex-shrink: 0;
    }
    
    /* 管理画面ボタン */
    .admin-panel-btn {
        padding: 8px 10px !important;
        font-size: 12px;
        min-height: 36px;
        border-radius: 6px;
    }
    
    .admin-btn-text {
        display: none; /* スマホでは「管理画面」テキストを隠す */
    }
    
    /* コイン表示 */
    .coin-display-mobile {
        padding: 4px 8px !important;
        gap: 3px;
        font-size: 12px !important;
        border-radius: 8px;
        min-width: 60px;
    }
    
    .coin-display-mobile i {
        font-size: 12px !important;
    }
    
    .coin-display-mobile .coin-amount {
        font-size: 14px !important;
        font-weight: 700;
    }
    
    /* メニューボタン */
    .menu-toggle-btn {
        width: 36px !important;
        height: 36px !important;
        font-size: 16px !important;
        border-radius: 6px;
        background: rgba(255, 255, 255, 0.25) !important;
    }
    
    .menu-toggle-btn:active {
        background: rgba(255, 255, 255, 0.4) !important;
        transform: scale(0.95);
    }
    
    /* ドロップダウンメニュー */
    .action-dropdown {
        right: 0 !important;
        min-width: 180px;
        margin-top: 4px;
        border-radius: 12px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
        z-index: 9999 !important;
    }
    
    .dropdown-item {
        padding: 12px 16px !important;
        font-size: 15px;
    }
    
    .dropdown-item i {
        font-size: 16px !important;
        width: 20px;
    }
    
    /* Legacy レスポンシブ対応 */
    .license-status-compact {
        display: none;
    }
    
    .header-actions {
        gap: 4px;
    }
    
    .template-actions {
        opacity: 1;
    }
}

/* ============================================
   動画ライブラリのレスポンシブUI
============================================ */

/* 動画ライブラリ項目 */
.video-library-item {
    padding: 16px;
    border: 1px solid #e5e7eb;
    margin-bottom: 8px;
    background: white;
    border-radius: 8px;
    transition: border-color 0.2s ease;
}

.video-library-item:hover {
    border-color: #d1d5db;
}

/* ヘッダー行 */
.video-library-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 12px;
}

.video-checkbox {
    margin-top: 2px;
    flex-shrink: 0;
}

.video-title-section {
    flex: 1;
    min-width: 0; /* 縮小を許可 */
}

.video-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: #111827;
    line-height: 1.4;
    word-wrap: break-word;
}

.video-description {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.3;
    word-wrap: break-word;
}

/* コンテンツ行 */
.video-library-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.video-metadata {
    display: flex;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.video-meta-item {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #6b7280;
    white-space: nowrap;
}

.video-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.video-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    border: 1px solid;
    background: white;
}

.video-action-play {
    border-color: #3b82f6;
    color: #3b82f6;
}

.video-action-play:hover {
    background: #3b82f6;
    color: white;
}

.video-action-copy {
    border-color: #6b7280;
    color: #6b7280;
}

.video-action-copy:hover {
    background: #6b7280;
    color: white;
}

.video-action-qr {
    border-color: #7c3aed;
    color: #7c3aed;
}

.video-action-qr:hover {
    background: #7c3aed;
    color: white;
}

.video-action-edit {
    border-color: #f59e0b;
    color: #f59e0b;
}

.video-action-edit:hover {
    background: #f59e0b;
    color: white;
}

.video-action-delete {
    border-color: #dc2626;
    color: #dc2626;
}

.video-action-delete:hover {
    background: #dc2626;
    color: white;
}

/* 統計情報コンパクト表示 */
.video-stats-compact {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.stats-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.stats-item i {
    font-size: 14px;
}

.stats-number {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.stats-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

/* QR生成ボタンエリア */
.qr-generation-actions {
    display: flex;
    align-items: center;
}

.qr-generate-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
}

.qr-btn-text {
    font-weight: 500;
}

.qr-btn-count {
    font-size: 13px;
    opacity: 0.9;
}

/* スマホ対応 */
@media (max-width: 768px) {
    .video-library-content {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .video-metadata {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .video-meta-item {
        font-size: 12px;
    }
    
    .video-actions {
        justify-content: center;
        gap: 12px;
    }
    
    .video-action-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .video-title {
        font-size: 15px;
    }
    
    .video-description {
        font-size: 13px;
    }
    
    /* QRボタンのスマホ対応 */
    .qr-generate-btn {
        flex-direction: column;
        gap: 4px;
        padding: 12px 16px;
        text-align: center;
    }
    
    .qr-btn-text {
        font-size: 13px;
    }
    
    .qr-btn-count {
        font-size: 12px;
    }
    
    /* バッチ操作エリアの調整 */
    .flex.items-center.justify-between {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .flex.items-center.space-x-4 {
        justify-content: center;
    }
    
    .qr-generation-actions {
        justify-content: center;
    }
    
    /* 統計情報のスマホ対応 */
    .video-stats-compact {
        gap: 16px;
        padding: 10px 12px;
    }
    
    .stats-item {
        gap: 4px;
        padding: 6px 10px;
    }
    
    .stats-item i {
        font-size: 12px;
    }
    
    .stats-number {
        font-size: 16px;
    }
    
    .stats-label {
        font-size: 12px;
    }
}

/* ============================================
   コイン購入UI
============================================ */

/* コイン履歴のスタイル改善 */
.coin-history-item {
    border-bottom: 1px solid var(--border-color);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
    border-radius: 8px;
    margin-bottom: 8px;
    background: var(--bg-white);
}

.coin-history-item:hover {
    background: var(--bg-light);
    transform: translateX(2px);
}

.coin-history-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.coin-history-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
}

.coin-history-icon.income {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.coin-history-icon.expense {
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.coin-history-icon.bonus {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: white;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.coin-history-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.coin-history-amount {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.coin-history-amount.positive {
    color: #10b981;
}

.coin-history-amount.negative {
    color: #ef4444;
}

.coin-history-description {
    font-size: 13px;
    color: var(--text-gray);
    line-height: 1.4;
}

.coin-history-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.coin-history-date {
    font-size: 12px;
    color: var(--text-gray);
    font-weight: 500;
}

.coin-history-time {
    font-size: 11px;
    color: var(--text-gray);
    opacity: 0.8;
}

.coin-history-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-gray);
    background: var(--bg-light);
    border-radius: 8px;
    margin: 16px 0;
}

.coin-history-empty-icon {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.6;
}

.coin-history-empty-text {
    font-size: 14px;
    margin-bottom: 4px;
}

.coin-history-empty-subtext {
    font-size: 12px;
    opacity: 0.8;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .coin-history-item {
        padding: 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .coin-history-left {
        width: 100%;
    }
    
    .coin-history-right {
        align-self: flex-end;
        text-align: right;
    }
    
    .coin-history-icon {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .coin-history-amount {
        font-size: 15px;
    }
}

.coin-package-card {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-white);
    position: relative;
}

.coin-package-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.coin-package-card.selected {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
}

.coin-package-card.popular::before {
    content: '人気';
    position: absolute;
    top: -8px;
    right: 16px;
    background: var(--secondary-color);
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.package-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.package-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

.package-price {
    font-size: 20px;
    font-weight: 700;
    color: #f59e0b;
}

.package-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.coins-amount {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.bonus-tag {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.3);
}

.discount-tag {
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(239, 68, 68, 0.3);
    animation: pulse 2s infinite;
}

.package-description {
    font-size: 12px;
    color: var(--text-gray);
    font-style: italic;
}

/* コイン購入ボタンアニメーション */
.coin-purchase-btn {
    position: relative;
    overflow: hidden;
}

.coin-purchase-btn::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;
}

.coin-purchase-btn:hover::before {
    left: 100%;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .coin-package-card {
        padding: 12px;
    }
    
    .package-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .package-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .package-name {
        font-size: 14px;
    }
    
    .package-price {
        font-size: 18px;
    }
}

/* テキスト長制限・音声時間予測機能のスタイル */
.content-stats {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-top: 12px;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.stat-item i {
    color: var(--primary-color);
    width: 16px;
    text-align: center;
}

.stat-label {
    color: var(--text-gray);
    font-weight: 500;
}

.stat-value {
    color: var(--text-dark);
    font-weight: 600;
    font-size: 16px;
}

.stat-value.stat-warning {
    color: var(--warning-color);
}

.stat-value.stat-error {
    color: var(--danger-color);
}

.stat-limit {
    color: var(--text-gray);
    font-size: 14px;
}

/* 旧スタイル（後方互換性のため残す） */
.text-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    text-align: right;
}

.char-count {
    color: var(--text-gray);
    font-weight: 500;
    transition: color 0.3s ease;
}

.char-count.char-limit-warning {
    color: var(--danger-color);
    font-weight: 600;
}

.duration-estimate {
    color: var(--text-gray);
    font-size: 12px;
}

.text-limit-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 12px;
    margin-top: 8px;
    color: var(--danger-color);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.text-limit-error i {
    font-size: 16px;
}

.form-textarea.text-limit-exceeded {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* 新しい文字数・時間統計表示 */
.text-stats-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.text-stats-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.text-stats-label {
    color: var(--text-gray);
    font-size: 14px;
    font-weight: 500;
}

.text-stats-value {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    transition: color 0.3s ease;
}

.text-stats-value.text-limit-warning {
    color: #f59e0b; /* 警告色（オレンジ） */
}

.text-stats-value.text-limit-exceeded {
    color: var(--danger-color); /* エラー色（赤） */
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .content-stats {
        padding: 12px;
    }
    
    .stats-row {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .stat-item {
        font-size: 13px;
    }
    
    .stat-value {
        font-size: 15px;
    }
    
    .text-stats {
        font-size: 12px;
    }
    
    .text-limit-error {
        font-size: 13px;
        padding: 10px;
    }
    
    .text-stats-container {
        flex-direction: column;
        gap: 8px;
        padding: 10px;
    }
    
    .text-stats-item {
        justify-content: space-between;
        width: 100%;
    }
}

/* ===== 動画ライブラリスタイル ===== */

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 16px;
}

/* 新しい動画リストスタイル */
.video-list {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-top: 16px;
}

.video-list-header {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    color: #374151;
    min-height: 48px;
}

.video-list-item {
    border: 1px solid #e5e7eb;
    border-top: none;
    transition: all 0.2s ease;
    min-height: 80px;
    word-break: break-word;
    white-space: normal;
}

.video-list-item:last-child {
    border-radius: 0 0 8px 8px;
}

.video-list-item:hover {
    background-color: #f9fafb !important;
}

.video-list-item.selected {
    background-color: #eff6ff !important;
    border-left: 3px solid #3b82f6 !important;
}

.video-list-item h4 {
    word-break: break-word;
    white-space: normal;
    overflow-wrap: break-word;
}

.video-list-item p {
    word-break: break-word;
    white-space: normal;
    overflow-wrap: break-word;
}

.video-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.video-thumbnail {
    position: relative;
    height: 180px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.video-thumbnail i {
    font-size: 48px;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.video-card:hover .video-thumbnail i {
    font-size: 56px;
    color: white;
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.video-info {
    padding: 16px;
}

.video-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.video-description {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 12px;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.video-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 12px;
    color: #9ca3af;
    flex-wrap: wrap;
}

.video-meta i {
    margin-right: 4px;
}

.video-date {
    display: flex;
    align-items: center;
}

.video-views {
    display: flex;
    align-items: center;
}

.video-public {
    display: flex;
    align-items: center;
    color: #10b981;
    font-weight: 500;
}

.video-private {
    display: flex;
    align-items: center;
    color: #f59e0b;
    font-weight: 500;
}

.video-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    background: #e5e7eb;
    color: #374151;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
    
    .video-card {
        margin-bottom: 16px;
    }
    
    .modal-content {
        margin: 10px;
        max-width: calc(100vw - 20px) !important;
    }
}

/* チェックボックススタイル */
.form-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    position: relative;
}

.form-checkbox:checked {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

.form-checkbox:checked::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 5px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.form-checkbox:hover {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-checkbox:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* 動画カード内のチェックボックスと国旗のスタイル */
.video-selection-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10;
}

.video-selection-overlay input[type="checkbox"] {
    pointer-events: auto;
}

.video-selection-overlay img {
    pointer-events: none;
}