body {
    font-family: 'Noto Sans JP', sans-serif;
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    background-color: #f4f4f4;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.1rem 0.3rem;
    background-color: #fff;
    border-bottom: 1px solid #ddd;
    position: relative;
    min-height: 35px;
}

header h1 {
    font-size: 24px;
    margin: 0;
    font-weight: 600;
}

#hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

#hamburger-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 5px 0;
    transition: 0.3s;
}

#nav-menu {
    display: flex;
    gap: 0.15rem;
}

main {
    flex-grow: 1;
    overflow: hidden;
}

.container {
    display: flex;
    height: 100%;
}

.control-panel {
    width: 300px;
    padding: 0.7rem;
    background-color: #fff;
    border-right: 1px solid #2F3E46;
    height: calc(100vh - 60px);
    overflow-y: auto;
    box-sizing: border-box;
}

.control-section {
    margin-bottom: 0.7rem;
    padding: 0.7rem;
    background: #F4F3EE;
    border: 2px solid #2F3E46;
    border-radius: 12px;
}

.control-section h2 {
    font-size: 0.8rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: #2F3E46;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #2F3E46;
    padding-bottom: 0.4rem;
}

input[type="text"],
textarea,
select {
    width: 100%;
    padding: 0.5rem 0.8rem;
    margin-bottom: 0.4rem;
    border: 2px solid #2F3E46;
    border-radius: 8px;
    background: #F4F3EE;
    color: #2F3E46;
    font-size: 12px;
    font-weight: 500;
    font-family: 'Noto Sans JP', sans-serif;
    transition: all 0.2s ease;
    box-sizing: border-box;
    letter-spacing: 0.3px;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #2F3E46;
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(47, 62, 70, 0.1);
}

input[type="text"]:hover,
textarea:hover,
select:hover {
    border-color: #2F3E46;
}

label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 600;
    font-size: 12px;
    color: #2F3E46;
    letter-spacing: 0.5px;
}

button {
    padding: 0.4rem 0.8rem;
    border: 2px solid #2F3E46;
    border-radius: 8px;
    background: #F4F3EE;
    color: #2F3E46;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

button:hover {
    background: #2F3E46;
    color: #F4F3EE;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(47, 62, 70, 0.3);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(47, 62, 70, 0.2);
}

button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(92, 124, 250, 0.3);
}

button:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

button:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* ダブルクリック編集可能なテキストのスタイル */
.stakeholder-goal:hover,
.stakeholder-role:hover,
.stakeholder-name:hover,
.purpose-title:hover {
    opacity: 0.7;
    filter: brightness(1.2);
}

.svg-container {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: auto;
}

#model-svg {
    width: 100%;
    height: 100%;
}



.purpose-circle { 
    fill: #f0f0f0; 
    stroke: #ccc;
    stroke-width: 2;
}

.purpose-title { 
    font-weight: bold; 
    font-size: 16px;
    fill: #333;
}

.stakeholder-name { 
    font-weight: bold; 
    font-size: 14px;
    fill: #fff;
}

.stakeholder-role { 
    font-weight: normal; 
    font-size: 12px;
    fill: #333;
}

.stakeholder-goal { 
    font-weight: normal; 
    font-size: 11px;
    fill: #333;
}

/* Responsive Styles */
/* アニメーション用スタイル */
.arc-group {
    opacity: 0;
}

.text-group {
    opacity: 0;
}

.purpose-circle {
    transform-origin: center;
}

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

.slide-in {
    animation: slideIn 0.8s ease-out forwards;
}

.scale-in {
    animation: scaleIn 0.5s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* カスタムモーダルダイアログ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(47, 62, 70, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: #F4F3EE;
    margin: 15% auto;
    border: 3px solid #2F3E46;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 8px 32px rgba(47, 62, 70, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.5rem;
    border-bottom: 2px solid #A8A196;
    background: linear-gradient(135deg, #F4F3EE 0%, #E8E6E0 100%);
    border-radius: 13px 13px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: #2F3E46;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #2F3E46;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #2F3E46;
    color: #F4F3EE;
    transform: rotate(90deg);
}

.modal-body {
    padding: 1.5rem;
}

.modal-body label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 600;
    font-size: 14px;
    color: #2F3E46;
    letter-spacing: 0.3px;
}

.modal-body textarea {
    width: 100%;
    min-height: 80px;
    padding: 0.8rem;
    border: 2px solid #A8A196;
    border-radius: 8px;
    background: #FFFFFF;
    color: #2F3E46;
    font-size: 14px;
    font-family: 'Noto Sans JP', sans-serif;
    resize: vertical;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.modal-body textarea:focus {
    outline: none;
    border-color: #2F3E46;
    box-shadow: 0 0 0 3px rgba(47, 62, 70, 0.1);
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    padding: 1.2rem 1.5rem;
    border-top: 2px solid #A8A196;
    background: #F4F3EE;
    border-radius: 0 0 13px 13px;
}

.modal-footer-right {
    display: flex;
    gap: 0.8rem;
}

.modal-btn {
    padding: 0.6rem 1.2rem;
    border: 2px solid;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
    min-width: 80px;
}

.modal-btn-cancel {
    background: #F4F3EE;
    color: #2F3E46;
    border-color: #A8A196;
}

.modal-btn-cancel:hover {
    background: #A8A196;
    color: #F4F3EE;
}

.modal-btn-save {
    background: #2F3E46;
    color: #F4F3EE;
    border-color: #2F3E46;
}

.modal-btn-save:hover {
    background: #1F2A30;
    border-color: #1F2A30;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(47, 62, 70, 0.3);
}

.modal-btn-delete {
    background: #FF6B6B;
    color: #FFFFFF;
    border-color: #FF6B6B;
}

.modal-btn-delete:hover {
    background: #FF5252;
    border-color: #FF5252;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

@media (max-width: 768px) {
    .modal-content {
        margin: 20% auto;
        width: 95%;
        max-width: none;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .modal-footer-right {
        flex-direction: column;
        width: 100%;
    }
    
    .modal-btn {
        width: 100%;
    }

    .container {
        flex-direction: column;
    }

    .control-panel {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #2F3E46;
        height: auto;
        max-height: 50vh;
    }

    #hamburger-btn {
        display: block;
    }

    #nav-menu {
        position: absolute;
        top: 100%;
        right: 0;
        background-color: white;
        border: 1px solid #ddd;
        flex-direction: column;
        padding: 0.5rem;
        transform: translateY(-150%);
        transition: transform 0.3s ease-in-out;
        z-index: 1000;
    }

    #nav-menu.active {
        transform: translateY(0);
    }
}
