/* drive-styles.css */

/* Google Drive連携用スタイル */

/* ドライブ接続セクション */
.drive-connection-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.drive-status-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.drive-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.drive-status-text {
    font-weight: 500;
}

.drive-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.drive-profile-image {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.drive-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ファイル操作セクション */
.file-operations-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;  /* ボタンの高さと同程度の間隔 */
    margin: 0 auto 20px;  /* 中央寄せ */
    padding: 15px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    max-width: 590px;  /* ボタン間距離を50pxに調整 */
}

.local-file-section,
.cloud-file-section {
    text-align: center;
}

.section-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #4a5568;
    margin-top: 0;         /* 上部余白を0に追加 */
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

.file-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

/* コンパクトなボタンサイズに修正 */
.file-actions .file-input-button,
.file-actions .btn-create,
.file-actions .btn-save,
.file-actions .btn-drive-primary,
.file-actions .btn-drive-save {
    width: 100%;
    max-width: 250px; /* よりコンパクトに */
    padding: 10px 16px; /* パディングを縮小 */
    font-size: 14px; /* フォントサイズを縮小 */
    min-height: 40px; /* 高さを縮小 */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap; /* テキストの改行を防ぐ */
}

/* Google Drive ボタンスタイル */
.btn-drive,
.btn-drive-secondary,
.btn-drive-primary,
.btn-drive-save {
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-drive {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    font-size: 14px;
}

.btn-drive:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.btn-drive-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    font-size: 14px;
}

.btn-drive-secondary:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.btn-drive-primary {
    background: linear-gradient(135deg, #4285f4 0%, #1976d2 100%);
    color: white;
}

.btn-drive-primary:hover {
    background: linear-gradient(135deg, #3367d6 0%, #1565c0 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

.btn-drive-save {
    background: linear-gradient(135deg, #34a853 0%, #137333 100%);
    color: white;
}

.btn-drive-save:hover {
    background: linear-gradient(135deg, #2d9648 0%, #0f5132 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 168, 83, 0.3);
}

.btn-icon {
    font-size: 16px;
}

/* アクションボタンセクション */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
}

/* ドライブファイルモーダル */
.drive-file-modal {
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
}

.drive-file-list {
    max-height: 50vh;
    overflow-y: auto;
    margin: 15px 0;
}

.file-list-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.drive-file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8f9fa;
    transition: all 0.2s ease;
}

.drive-file-item:hover {
    background: #e3f2fd;
    border-color: #2196f3;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);
}

.file-info {
    flex: 1;
    text-align: left;
}

.file-name {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 4px;
}

.file-details {
    display: flex;
    gap: 15px;
    font-size: 0.85em;
    color: #718096;
}

.file-size::before {
    content: "📄 ";
}

.file-date::before {
    content: "🕒 ";
}

.file-actions {
    flex-shrink: 0;
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-load {
    background-color: #4299e1;
    color: white;
}

.btn-load:hover {
    background-color: #3182ce;
}

.no-files-message {
    text-align: center;
    color: #718096;
    font-style: italic;
    padding: 40px 20px;
}

/* レスポンシブ対応 */
@media screen and (max-width: 768px) {
    /* 768px以下でも横並びを維持 */
    .file-operations-section {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
        padding: 12px 15px;  /* 上下paddingをさらに削減 */
        margin-top: 0;        /* 上部余白を0に */
    }
    
    .section-title {
        font-size: 1.1em;
        margin-top: 0;        /* 上部余白を0に追加 */
        margin-bottom: 12px;
    }
    
    .file-actions {
        gap: 10px;
    }
    
    .file-actions .file-input-button,
    .file-actions .btn-create,
    .file-actions .btn-save,
    .file-actions .btn-drive-primary,
    .file-actions .btn-drive-save {
        max-width: none;
        width: 100%;
        padding: 8px 12px;
        font-size: 13px;
        min-height: 36px;
    }
    
    .drive-status-container {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .drive-buttons {
        justify-content: center;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .drive-file-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .file-details {
        justify-content: center;
    }
    
    .file-actions {
        align-self: center;
    }
}

/* 非常に小さな画面でのみ縦並びに変更 */
@media screen and (max-width: 480px) {
    .file-operations-section {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 10px 15px;  /* paddingをさらに削減 */
        margin-top: 0;        /* 上部余白を0に */
    }
    
    .file-actions .file-input-button,
    .file-actions .btn-create,
    .file-actions .btn-save,
    .file-actions .btn-drive-primary,
    .file-actions .btn-drive-save {
        width: calc(100% - 20px);
        margin: 0 10px;
    }
}