* {
    box-sizing: border-box;
}

.errorlist li, p.red {
    color: red;
    font-weight: bold;
}

/* メッセージ表示のスタイル */
.messages {
    margin: 10px 0;
}
.messages button {
    box-shadow: initial;
}

.alert {
    padding: 12px 24px;
    margin: 8px 0;
    border: 1px solid transparent;
    border-radius: 4px;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alert-error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.messages #close-top-message {
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    margin-right: 30px;
    width: inherit;
    padding: 0;
    margin: 0;
}

#close-top-message:hover {
    opacity: 1;
}
*:not(textarea, .footer, .header) {
    box-sizing: border-box;
    transition: 0.3s;
    color: rgb(48, 48, 48);
}
h1 {
    text-align: center;
    padding: 6px 60px;
    border: solid rgb(93, 138, 117);
    border-width: 3px 0 3px 0;
}
h2, h3 {
    text-align: center;
    padding: 6px 60px;
    border: solid rgb(177, 202, 192);
    border-width: 3px 0 3px 0;
}
h2.red, h3.red {
    border: solid rgb(202, 177, 177);
    border-width: 3px 0 3px 0;
}
p, span {
    color: rgb(48, 48, 48);
    margin: 6px;
}
input, button, textarea, select {
    border: rgb(199, 199, 199) solid 1px;
    border-radius: 3px;
    padding: 15px;
    font-size: 18px;
    outline: none;
    box-shadow: 0 0 6px rgb(173, 173, 173);
}
input:placeholder-shown {
    background-color: gainsboro;
}
button {
    width: 100%;
    max-width: 600px;
    padding: 9px 30px;
    cursor: pointer;
    margin: 9px 0;
    background-color: #007bff;
    border: none;
    border-radius: 9px;
    color: white !important;
}
button.red {
    background-color: red;
}
button:hover {
    background-color: #70b1f7;
}
button.red:hover {
    background-color: rgb(255, 143, 143);
}
form button {
    height: 100%;
}
body {
    display: flex;
    flex-flow: column;
    background-color: whitesmoke;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    position: relative;
}
a {
    color: rgb(48, 48, 48);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}
.con {
    padding: 6px 120px;
    width: 100%;
    display: flex;
    flex-flow: column;
    align-items: center;
    margin-bottom: 60px;
}

/* ヘッダーの調整 */
.header {
    color: white;
    background-color: rgb(93, 138, 117);
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
    height: 60px;
    justify-content: center;
    align-items: center;
}
.header li {
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: white;
    width: 150px;
    height: inherit;
}
.header li a {
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: inherit;
    text-decoration: none;
}
.header button {
    padding: 6px;
}
.header > li:hover {
    background-color: rgb(151, 183, 168);
}
.logoutbutton button {
    background-color: inherit;
    color: white;
    border: none;
    font-size: 15px;
    cursor: pointer;
    box-shadow: initial;
}

/* ドロップダウンメニューのスタイル */
.header .dropdown {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dropdown p {
    color: white;
}
.header .dropdown-toggle {
    cursor: pointer;
}
.header .dropdown-menu {
    display: none;
    flex-flow: column;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 100%;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1000;
    min-width: 210px;
    list-style: none;
    padding: 0;
    margin: 0;
    opacity: 0;
    transition: opacity 0.3s;
}

.header .dropdown-menu li {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border-bottom: 1px solid #f0f0f0;
    text-align: center;
}

.header .dropdown-menu li:last-child {
    border-bottom: none;
}

.header .dropdown-menu a {
    display: flex;
    padding: 10px 15px;
    text-decoration: none;
    color: #333;
    transition: background-color 0.3s;
}

.header .dropdown-menu a:hover {
    background-color: #e3e3e3;
}

.header .dropdown:hover .dropdown-menu {
    display: flex;
    animation: dropdown-fadein 0.3s linear forwards;
}

.header .dropdown:hover .dropdown-toggle i {
    transform: rotate(180deg);
    transition: transform 0.3s;
}
@keyframes dropdown-fadein {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.pageForm {
    width: 600px;
}
.pageForm div {
    display: flex;
    flex-flow: column;
    margin: 15px 0;
}
.pageForm input, .pageForm select, .pageForm textarea {
    width: 100%;
}
.footer {
    width: 100%;
    padding: 6px;
    font-size: 12px;
    display: flex;
    position: absolute;
    background-color: gray;
    bottom: 0;
}
.footer p {
    margin: 0;
    color: rgb(49, 49, 49);
}
.highlight {
    font-size: 24px;
    font-weight: bold;
    margin: 0 6px;
}
.hrLine {
    width: 60%;
    border: solid 1px gainsboro;
    border-width: 1px 0 0 0;
    margin: 30px 0;
}
.con ul {
    margin: 6px;
    padding: 0;
}

/*  メインコンテンツエリア */
.bord, .tools {
    margin: 15px 0;
    width: 100%;
    max-width: 900px;
    padding: 30px;
    padding-top: 6px;
    background-color: rgb(236, 236, 236);
    border-radius: 3px;
}
.bord .messagelist {
    background-color: whitesmoke;
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
}
.tools .toolButtons {
    display: flex;
    width: 100%;
}
.tools .toolButtons div {
    border: solid 1px gray;
    border-radius: 3px;
    margin: 6px;
    font-size: 18px;
    cursor: pointer;
    background: rgb(212,233,230);
    background: linear-gradient(0deg, rgba(212,233,230,1) 0%, rgba(179,214,208,1) 100%);
}
.tools .toolButtons div:hover {
    opacity: 0.6;
}
.tools a {
    display: flex;
    padding: 15px;
    width: 100%;
    text-decoration: none;
}

/* ローディング */
#loading {
    display: flex;
    flex-flow: column;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    background-color: rgba(0, 0, 0, 0.5);
}
#loading .spinner-border {
    display: flex;
    gap: 18px;
    flex-flow: column;
    align-items: center;
    justify-content: center;
}
#loading p, #loading i {
    color: white;
}
#loading i {
    font-size: 75px;
}

/* お知らせウィンドウ */
.infoWindow {
    background-color: #e3f1e6;
    width: 100%;
    padding: 15px;
    border: solid 0.5px green;
    border-radius: 15px;
    display: flex;
    flex-flow: column;
    align-items: center;
    margin: 30px 0;
}
.infoWindow hr {
    width: 60%;
}

/* フォームの整形 */
form {
    display: flex;
    flex-flow: column;
    align-items: center;
    width: 100%;
}
form div {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-flow: column;
    align-items: flex-start;
    margin: 6px 0;
    position: relative;
}
form label {
    width: 100%;
    color: rgb(102, 102, 102) !important;
}
form .helptext {
    color: dimgray;
}
form input:not(form input[type=checkbox]), form select, form textarea, form select {
    width: 100%;
    min-width: 300px;
    max-width: 600px;
    display: flex;
    justify-content: flex-start;
    padding: 15px;
}
form input[type=checkbox] {
    width: 30px;
    height: 30px;
}
/* 必須項目の強調 */
label:has(+ input:required)::after,
label:has(+ textarea:required)::after,
label:has(+ select:required)::after {
    content: " *";
    color: red;
    margin-left: 5px;
    font-weight: bold;
}

.ai-button {
    background-image: linear-gradient(90deg, #d55a6f, #616acf, #874fb8, #d55a6f);
    background-size: 200% 200%;
    background-repeat: repeat;
    border: none;
    color: white;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 15px 0px;
    cursor: pointer;
    border-radius: 16px;
    box-shadow: 0 0 9px rgb(133, 85, 143);
}
.ai-button.generating {
    animation: rainbow 1s linear infinite;  
}


/* ページネーションスタイル */
.pagination {
    width: 100%;
    display: flex;
    list-style: none;
    flex-wrap: wrap;
}
.pagination .page-item {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 45px;
    background-color: white;
    border: solid 1px rgb(191, 222, 191);
    border-collapse: collapse;
}
.pagination .page-item.active {
    background-color: gray;

}
.pagination .page-item a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    color: #007bff;
}
.pagination li:first-child {
    border-radius: 9px 0 0 9px;
}
.pagination li:last-child {
    border-radius: 0 9px 9px 0;
}

@keyframes rainbow {
    0% { background-position: 0% 100%; }
    100% { background-position: 200% 100%; }
}

@media screen and (max-width: 600px) {
    .con {
        padding: 6px 15px;
    }
    .header {
        height: 45px;
    }
    .header li, .header button {
        font-size: 12px;
        font-weight: bold;
        width: 100%;
    }
}

form textarea {
    max-width: initial;
    resize: both;
}