﻿@charset "utf-8";

body {
    font-family: 'Poppins', 'Noto Sans JP', sans-serif;
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

header {
    background-color: #f0f0f0;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ccc;
    flex-shrink: 0;
    height: 40px;
}

#logo {
    margin: 0;
    padding: 0;
    padding-left: 10px;
}

#logo img {
    display: block;
    width: 180px;
}

.header-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.container {
    display: flex;
    flex-grow: 1;
    overflow: hidden;
}

/* --- Layout Columns --- */
#toolbar {
    width: 240px;
    padding: 20px;
    background-color: #f8f8f8;
    border-right: 1px solid #ccc;
    flex-shrink: 0;
    overflow-y: auto;
}

#workspace {
    position: relative;
    flex-grow: 1;
    padding: 20px;
    background-color: #e9e9e9;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

#canvas-container {
    background-image: linear-gradient(45deg, #eee 25%, transparent 25%), linear-gradient(-45deg, #eee 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #eee 75%), linear-gradient(-45deg, transparent 75%, #eee 75%);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

#editor-panel {
    width: 250px;
    padding: 20px;
    background-color: #f8f8f8;
    border-left: 1px solid #ccc;
    flex-shrink: 0;
    overflow-y: auto;
}

/* --- Modals --- */
#size-modal-overlay,
#template-modal-overlay,
#shape-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#size-modal-content,
#template-modal-content,
#shape-modal-content {
    background-color: white;
    padding: 20px 40px;
    border-radius: 10px;
    width: 80%;
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto;
}

#size-modal-content h2 {
    text-align: center;
    margin-top: 0;
}

.size-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.size-btn {
    flex-basis: 150px;
    flex-grow: 1;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: #f9f9f9;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.size-btn:hover {
    border-color: #007bff;
    background-color: #e9f5ff;
}

.size-btn strong {
    display: block;
    font-size: 16px;
    margin-bottom: 5px;
}

.size-btn span {
    font-size: 12px;
    color: #555;
}

/* --- General Button Styles --- */
button {
    border: 1px solid #ccc;
    background-color: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    color: #333;
}

button:hover {
    border-color: #999;
    background-color: #f7f7f7;
}

button:disabled {
    opacity: 0.5; /* ボタンを半透明にする */
    cursor: not-allowed; /* 禁止カーソルを表示 */
}

/* 無効なボタンのホバー効果を上書き（元のスタイルに戻す） */
button:disabled:hover {
    border-color: #ccc;
    background-color: #ffffff;
}

button:active {
    transform: translateY(1px);
    background-color: #eee;
}

.active-btn {
    background-color: #cce5ff;
    border-color: #007bff;
}

/* --- Specific Buttons --- */
#download-btn {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
    font-weight: bold;
}

#download-btn:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

#toolbar button {
    width: 100%;
    text-align: left;
    margin-bottom: 8px;
}

.template-btn {
    text-align: center;
    padding: 10px;
}

#editor-panel button {
    width: 40px;
    height: 35px;
    padding: 5px;
}

/* --- Zoom Controls --- */
#zoom-controls {
    position: fixed;
    bottom: 20px;
    right: 290px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    display: flex;
    z-index: 2000;
}

#zoom-controls button {
    width: 40px;
    height: 40px;
    border: none;
    background-color: transparent;
    font-size: 18px;
    font-weight: bold;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

#zoom-controls button:not(:last-child) {
    border-right: 1px solid #ccc;
}

#zoom-controls button:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

#zoom-reset-btn {
    font-size: 12px !important;
}

/* --- Editor Panel --- */
#editor-panel>h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

#editor-panel>div>p {
    font-weight: bold;
    color: #333;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 15px;
}

/* Text Controls */
#text-controls>div {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

#text-controls label {
    width: 80px;
    font-size: 14px;
    flex-shrink: 0;
}

#text-controls select,
#text-controls input,
#text-controls button {
    font-family: inherit;
}

#text-controls .control-group {
    display: flex;
    align-items: center;
}

#no-text-stroke-btn {
    margin-left: 8px;
    padding: 0 15px;
}

#writing-mode-btn {
    margin-left: 5px;
    font-weight: bold;
}

/* Shape Controls */
#shape-controls>div {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

#shape-controls label {
    width: 80px;
    font-size: 14px;
    flex-shrink: 0;
}

#shape-controls .control-group {
    display: flex;
    align-items: center;
}

#shape-controls input[type="color"],
#shape-controls input[type="number"],
#shape-controls button {
    height: 35px;
    border-radius: 6px;
    border: 1px solid #ccc;
    padding: 0 5px;
    box-sizing: border-box;
}

#shape-controls input[type="number"] {
    width: 60px;
}

#shape-controls input[type="color"] {
    width: 60px;
    height: 35px;
    padding: 2px;
}

#no-fill-btn,
#no-stroke-btn {
    margin-left: 8px;
    padding: 0 15px;
}

/* Gradient Panel */
#gradient-panel {
    margin-top: 15px;
    padding-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px; /* 8pxから12pxに変更し、行間を広げました */
}

.grad-row {
    display: flex; /* flexboxレイアウトに変更 */
    align-items: center;
    margin-bottom: 12px; /* 各行の間にスペースを確保 */
}

.grad-row label {
    width: 80px;         /* 他のラベルの幅と統一 */
    font-size: 14px;
    text-align: left;    /* 左寄せに変更 */
    color: #555;
    flex-shrink: 0;      /* ラベル幅が縮まないようにする */
}

.grad-color-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.grad-color-group input[type="color"] {
    flex: 1; /* 幅100%の代わりに、利用可能なスペースを分け合うように変更 */
    height: 35px;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 2px;
    box-sizing: border-box; /* paddingが幅に影響しないようにする */
}

#gradient-panel select {
    width: 100%;
    height: 35px;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 0 5px;
}

#angle-control,
#radius-control {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* 左寄せに */
    margin-bottom: 12px;
}

#angle-control label,
#radius-control label {
    text-align: left;
    margin-bottom: 4px; /* ラベルとスライダーの間に少しスペースを */
}

#angle-control .control-group,
#radius-control .control-group {
    width: 100%; /* コントロールグループを親要素の幅いっぱいに広げる */
}

#gradient-panel .control-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

#gradient-panel .control-group input[type="range"] {
    flex: 1;
}

#gradient-panel .control-group button {
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 18px;
    line-height: 28px;
    text-align: center;
    flex-shrink: 0;
}

#gradient-panel .control-group span {
    width: 40px;
    text-align: right;
    font-size: 14px;
    color: #333;
}

/* Opacity Controls */
#opacity-controls>div {
    display: grid;
    grid-template-columns: 1fr 45px;
    gap: 12px;
    align-items: center;
}

#opacity-controls input[type="range"] {
    width: 100%;
}

#opacity-controls span {
    font-size: 14px;
    text-align: right;
    color: #333;
}

/* Shadow Controls */
#shadow-options>div {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

#shadow-options label {
    font-size: 14px;
    text-align: right;
    padding-right: 10px;
}

#shadow-options input[type="number"] {
    height: 35px;
    border-radius: 6px;
    border: 1px solid #ccc;
    padding: 0 8px;
    box-sizing: border-box;
    width: 100%;
}

#shadow-options input[type="color"] {
    padding: 2px;
}


/* --- Dropdown Menu --- */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #f1f1f1;
    min-width: 120px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    z-index: 1;
    border-radius: 6px;
}

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.dropdown-content a:hover {
    background-color: #ddd;
}

.show {
    display: block;
}


/* --- Media Queries --- */
@media (max-width: 1200px) {
    #zoom-controls {
        right: auto;
        left: 20px;
    }
}