body {
    font-family: sans-serif;
    margin: 0;
    background-color: #f4f4f4;
    color: #333;
    display: flex;
    justify-content: center;
    padding: 20px;
}

.container {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 700px;
}

h1, h2 {
    color: #333;
    text-align: center;
}

h1 {
    margin-bottom: 10px;
}

h2 {
    margin-top: 30px;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
}

.controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.controls button {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

#toggle-form-button {
    background-color: #007bff;
    color: white;
}
#toggle-form-button:hover {
    background-color: #0056b3;
}

#toggle-edit-mode-button {
    background-color: #ffc107;
    color: #212529;
}
#toggle-edit-mode-button:hover {
    background-color: #e0a800;
}
#toggle-edit-mode-button.active { /* 編集モード中のスタイル */
    background-color: #fd7e14;
    color: white;
}


.form-container {
    border: 1px solid #ddd;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 30px;
    background-color: #f9f9f9;
}

.form-container.hidden { /* 非表示クラス */
    display: none;
}

.form-container label {
    display: block;
    margin-top: 15px;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-container input[type="text"] {
    width: calc(100% - 22px); /* padding + border */
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

#save-card-button {
    background-color: #28a745;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    /* display: block; */ /* 削除または変更 */
    /* width: 100%; */ /* 削除または変更 */
    margin-top: 20px;
    margin-right: 10px; /* ボタン間のスペース */
}

#save-card-button:hover {
    background-color: #218838;
}

#cancel-form-button { /* キャンセルボタンのスタイル */
    background-color: #6c757d;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 20px;
}
#cancel-form-button:hover {
    background-color: #5a6268;
}


.saved-cards-container {
    margin-top: 30px;
}

.card-item {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 5px;
    position: relative; /* ドラッグハンドルのため */
}

.card-item.dragging { /* ドラッグ中のスタイル */
    opacity: 0.5;
    background: #e9ecef;
    border: 2px dashed #007bff;
}

.card-item h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #007bff;
    display: flex; /* アイコンとテキストを横並びにするため */
    align-items: center;
}

.drag-handle { /* ドラッグハンドル */
    cursor: grab;
    margin-right: 10px;
    font-size: 1.2em;
    color: #6c757d;
    display: none; /* 通常時は非表示 */
}
.card-item.edit-mode .drag-handle { /* 編集モード時のみ表示 */
    display: inline-block;
}


.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dotted #eee;
}

.info-item:last-child {
    border-bottom: none;
}

.info-item span:first-child {
    font-weight: bold;
    margin-right: 10px;
    color: #555;
}

.info-item span.value {
    flex-grow: 1;
    word-break: break-all; /* 長い場合に折り返す */
}

.copy-button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 10px;
    min-width: 60px;
}

.copy-button:hover {
    background-color: #0056b3;
}

.delete-card-button {
    background-color: #dc3545;
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: none; /* 通常時は非表示 */
    width: auto;
    margin-top: 15px;
    float: right;
}

.card-item.edit-mode .delete-card-button { /* 編集モード時のみ表示 */
    display: block;
}


/* Clearfix for floated elements */
.card-item::after {
    content: "";
    clear: both;
    display: table;
}


/* ... 認証用 ... */

#auth-section {
    text-align: center;
    padding: 30px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
    margin-bottom: 30px;
}

#auth-section h1, #auth-section h2 {
    margin-bottom: 20px;
}

#auth-section button {
    background-color: #007bff;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
}
#auth-section button:hover {
    background-color: #0056b3;
}

#auth-status {
    margin-top: 20px;
    font-weight: bold;
}

.hidden {
    display: none !important;
}

#logout-button {
    background-color: #6c757d;
    color: white;
}
#logout-button:hover {
    background-color: #545b62;
}
