body {
    font-family: sans-serif;
    background-color: #f0f2f5;
    color: #333;
    margin: 0;
    padding: 20px;
}

.header-actions {
    text-align: left;
    margin-bottom: 20px;
    padding: 0 20px;
}

.home-button {
    display: inline-block;
    padding: 12px 20px;
    background-color: #3f51b5;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.home-button:hover {
    background-color: #303f9f;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.home-button:active {
    transform: translateY(0);
}

h1 {
    text-align: center;
    color: #1a237e;
    margin-bottom: 30px;
}

.container {
    display: flex;
    gap: 30px; /* gapを少し広げました */
    max-width: 1400px; /* 最大幅を少し広げました */
    margin: 20px auto;
    background-color: #fff;
    padding: 30px; /* パディングを増やしました */
    border-radius: 8px;
    box-shadow: 0 6px 12px rgba(0,0,0,0.1); /* シャドウを少し強くしました */
}

.controls {
    width: 280px; /* コントロールパネルの幅を広げました */
    display: flex;
    flex-direction: column;
    gap: 25px; /* gapを増やしました */
    padding-right: 20px;
    border-right: 1px solid #eee; /* コントロールパネルとの区切り線 */
}

.controls h2 {
    color: #3f51b5;
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 10px; /* gapを増やしました */
}

.control-group label {
    font-weight: bold;
    color: #555;
}

/* キャンバスのラッパーにスタイルを追加 */
.canvas-wrapper {
    flex-grow: 1;
    display: flex; /* 中央寄せのために追加 */
    justify-content: center; /* 水平中央寄せ */
    align-items: center; /* 垂直中央寄せ */
    background-color: #e0e0e0; /* 周囲をグレーにしてキャンバスを際立たせる */
    border-radius: 4px;
    padding: 20px; /* キャンバス周囲の余白 */
    min-height: 600px; /* 高さを確保 */
}

#cardCanvas {
    /* サイズはHTMLで指定。ここでは追加のスタイル */
    background-color: #ffffff; /* キャンバス自体の背景は白 */
    border: 2px solid #3f51b5; /* NFCカードの境界線を強調 */
    box-shadow: 0 0 15px rgba(0,0,0,0.2); /* 浮き上がって見えるようにシャドウを追加 */
    border-radius: 31.8px; /* ★ この行を追加 ★ */
}

input[type="text"], input[type="file"], input[type="color"], select {
    width: 100%;
    padding: 10px; /* パディングを増やしました */
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
}

select {
    background-color: white;
    cursor: pointer;
}

.font-size-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.font-size-control input[type="range"] {
    flex: 1;
    margin: 0;
}

.font-size-control span {
    min-width: 40px;
    text-align: center;
    font-weight: bold;
    color: #3f51b5;
}

button {
    padding: 12px 18px; /* パディングを増やしました */
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background-color: #3f51b5;
    color: white;
    font-weight: bold;
    font-size: 1em;
    transition: background-color 0.3s, transform 0.1s;
}

button:hover {
    background-color: #303f9f;
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

button.danger {
    background-color: #d32f2f;
}

button.danger:hover {
    background-color: #c62828;
}

button.primary {
    background-color: #4caf50;
}
button.primary:hover {
    background-color: #388e3c;
}

button.secondary {
    background-color: #6c757d;
    margin-bottom: 10px;
}

button.secondary:hover {
    background-color: #5a6268;
}

.export-group {
    margin-top: auto; /* 一番下に配置 */
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.design-actions {
    margin: 20px 0;
    padding: 20px 0;
    border-top: 1px solid #e0e0e0;
}

.design-actions button {
    width: 100%;
    margin-bottom: 10px;
}

.order-section {
    margin-top: 20px;
    padding: 20px 0;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.order-section h3 {
    color: #3f51b5;
    margin: 0 0 10px 0;
    font-size: 18px;
}

.order-section p {
    color: #666;
    margin: 0 0 15px 0;
    font-size: 14px;
    line-height: 1.4;
}

.order-section .btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: #4caf50;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.order-section .btn:hover {
    background-color: #388e3c;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

#previewArea {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

#previewArea img {
    max-width: 300px; /* プレビュー画像の最大幅を調整 */
    height: auto;
    margin-top: 15px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#previewArea a {
    display: inline-block;
    margin-top: 10px;
    color: #3f51b5;
    text-decoration: none;
    font-weight: bold;
}

#previewArea a:hover {
    text-decoration: underline;
}

/* モバイル対応 */
@media (max-width: 768px) {
    body {
        padding: 20px;
    }
    
    .header-actions {
        padding: 0 20px;
        margin-bottom: 20px;
    }
    
    h1 {
        font-size: 32px;
        margin-bottom: 30px;
    }
    
    .container {
        flex-direction: row;
        gap: 30px;
        padding: 30px;
        margin: 20px auto;
    }
    
    .controls {
        width: 280px;
        padding-right: 20px;
        border-right: 1px solid #eee;
        border-bottom: none;
        padding-bottom: 0;
    }
    
    .canvas-wrapper {
        min-height: 600px;
        padding: 20px;
    }
    
    #cardCanvas {
        max-width: 100%;
        height: auto;
    }
    
    .control-group {
        gap: 10px;
    }
    
    .control-group input,
    .control-group select,
    .control-group button {
        padding: 12px 16px;
        font-size: 16px;
    }
    
    .font-size-control {
        flex-direction: row;
        gap: 10px;
    }
    
    .export-group {
        margin-top: auto;
    }
}

@media (max-width: 480px) {
    body {
        padding: 20px;
    }
    
    .container {
        padding: 30px;
        margin: 20px auto;
    }
    
    h1 {
        font-size: 32px;
    }
    
    .controls h2 {
        font-size: 24px;
    }
    
    .canvas-wrapper {
        min-height: 600px;
        padding: 20px;
    }
    
    #previewArea img {
        max-width: 300px;
    }
}
