/** 共通 -------------------------------- */
html, body {
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
}

/*.content {*/
/*    flex: 1;*/
/*}*/

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

/* ヘッダーのロゴ色 */
body.dark-theme #header-logo {
    color: white;
    text-decoration: none;
}

body.light-theme #header-logo {
    color: black;
    text-decoration: none;
}

header nav {
    margin: auto 0 auto auto;
}

/* 'src/main/resources/static/css/cmn.css' に追加 */

/* フォーム要素の角丸を統一 */
input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
textarea,
select {
    border-radius: 4px;
    border: 1px solid #cfcfcf;
    /*padding: 8px 10px;*/
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
    outline: none;
    background-color: #fff;
}

/* ボタンの角丸（.base-btn はテンプレートで使用中） */
button,
button.base-btn,
.base-btn {
    border-radius: 4px;
    padding: 5px 14px;
    border: none;
    cursor: pointer;
    transition: transform 0.06s ease, box-shadow 0.12s ease;
    /*background-color: #40A2E3;*/
    background-color: #2b7cff;
    color: #fff;
}

/* ホバー / アクティブ */
button:hover,
.base-btn:hover {
    box-shadow: 0 4px 10px rgba(43, 124, 255, 0.18);
    transform: translateY(-1px);
}

button:active,
.base-btn:active {
    transform: translateY(0);
}

/* フォーカス時のアウトライン代替 */
input:focus,
textarea:focus,
select:focus,
button:focus {
    border-color: #66a3ff;
    box-shadow: 0 0 0 4px rgba(102, 163, 255, 0.12);
}

/* 任意で使えるクラス */
.rounded {
    border-radius: 12px !important;
}

/* Light/Dark テーマ切替 */
body.light-theme {
    background-color: white;
    color: black;
}

body.dark-theme {
    background-color: black;
    color: white;
}

body.light-theme a {
    color: black;
    font-weight: bold;
}

body.dark-theme a {
    color: white;
    font-weight: bold;
}

body.light-theme h1 {
    color: black;
}

body.dark-theme h1 {
    color: white;
}

.theme-btn {
    width: 100px;
    height: 35px;
}

/* カラートグルボタン */
body.light-theme .base-btn {
    border: 5px solid #000;
    background: white;
    font-weight: bold;
    cursor: pointer;
    margin: auto 0;
}

body.dark-theme .base-btn {
    /*border: 5px solid #40A2E3;*/
    background: #40A2E3;
    color: white;
    cursor: pointer;
    margin: auto 0;
}

body.light-theme .base-btn:hover {
    background-color: #8ccaf3;
}

body.dark-theme .base-btn:hover {
    background-color: #0466a8;
}

/* ボタン */
body.light-theme input[type="button"] {
    height: 35px;
    margin: 10px 20px 10px 17px;
    border: 5px solid #000;
    background: white;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

body.dark-theme input[type="button"] {
    height: 35px;
    margin: 10px 20px 10px 17px;
    border: 5px solid white;
    background: black;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

body.light-theme input[type="button"]:hover {
    background-color: #8ccaf3;
}

body.dark-theme input[type="button"]:hover {
    background-color: #2980b9;
}

body.light-theme input[type="number"] {
    border: 5px solid black;
}

body.dark-theme input[type="number"] {
    border: 5px solid white;
}

body.light-theme input[type="email"] {
    border: 5px solid black;
}

body.dark-theme input[type="email"] {
    border: 5px solid white;
}

body.light-theme select {
    border: 5px solid black;
}

body.dark-theme select {
    border: 5px solid white;
}

body.light-theme #baseTable,
body.light-theme #baseTable th,
body.light-theme #baseTable td {
    border: 4px solid black;
    border-collapse: collapse;
}

body.dark-theme #baseTable, #baseTable th, #baseTable td {
    border: 4px solid white;
    border-collapse: collapse;
}

body.light-theme .alert-div {
    background: white;
    border: 5px solid black !important;
}

body.dark-theme .alert-div {
    background: black;
    border: 5px solid white !important;
}

hr {
    margin-top: 20px;
}

.base-div {
    margin-left: 15px;
}

.pagination {
    display: flex;
    justify-content: center;
    width: 50%;
    margin: 30px auto 0 auto;
}

.page-btn {
    width: 30%;
    padding: 4px 8px;
    font-size: 0.8rem;
}

body.light-theme .page-number-btn {
    width: 30%;
    margin: 0 5px;
    padding: 4px 8px;
    font-size: 0.8rem;
    color: black;
    border: 1px solid black;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

body.dark-theme .page-number-btn {
    width: 30%;
    margin: 0 5px;
    padding: 4px 8px;
    font-size: 0.8rem;
    color: white;
    border: 1px solid white;
    background: black;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-number-btn:hover {
    /*background-color: var(--accent-color);*/
    color: white;
}

body.light-theme .page-number-btn:disabled {
    color: white !important;
    background-color: black !important;
    cursor: not-allowed !important;
}

body.dark-theme .page-number-btn:disabled {
    color: black !important;
    background-color: white !important;
    cursor: not-allowed !important;
}

/* ナビゲーションメニュー */
.nav-menu {
    list-style: none;
    padding: 0;
    display: flex;
}

.nav-menu li {
    display: inline;
}

.nav-menu a {
    text-decoration: none;
    color: black;
    font-weight: bold;
    line-height: 1.5;
}

.nav-menu a:hover {
    text-decoration: underline;
}

/* ハンバーガーボタン */
#hamburger {
    display: none;
}

#hamburger span {
    display: block;
    height: 4px;
    margin: 5px 0;
    border-radius: 2px;
    transition: 0.3s;
}

/* ライトモード時のテーブルボーダーを黒に */
body.dark-theme #itemTable,
body.dark-theme #itemTable th,
body.dark-theme #itemTable td {
    border-color: black;
}

/* ダークモード時のテーブルボーダーを白に */
body.dark-theme #itemTable,
body.dark-theme #itemTable th,
body.dark-theme #itemTable td {
    border-color: white;
}

/*** pc用のスタイル ***/
@media (min-width: 769px) {
    body {
        width: 70%;
        margin: 0 auto;
    }

    header {
        /*width: 88%;*/
    }

    #header-logo {
        width: 3%;
        margin-right: 20px;
    }

    .nav-menu {
        margin: auto 30px auto auto;
        gap: 30px;
    }

    .nav-menu a {
        line-height: 1.5;
    }

    #pc-color {
        display: block;
    }

    #sp-color {
        display: none;
    }

    #doFormatJson {
        width: 87%;
    }
}

/*** スマホ用スタイル ***/
@media (max-width: 768px) {
    body {
        width: 95% !important;
        margin: 0 auto;
    }

    #header-div {
        margin-left: 84%;
    }

    #header-logo {
        display: none;
    }

    h1 {
        margin-left: 10px;
    }

    .nav-menu {
        display: none !important;
        position: absolute;
        top: 20px;
        background: lightcyan;
        width: 200px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        flex-direction: column;
        z-index: 1000;
    }

    .nav-menu.active {
        display: flex !important;
    }

    .nav-menu li {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
    }

    .nav-menu a {
        line-height: 2.5;
    }

    body.dark-theme .nav-menu li {
        border-top: 4px solid white;
        border-right: 4px solid white;
        border-left: 4px solid white;
    }

    body.dark-theme .last-child {
        border-bottom: 4px solid white;
    }

    body.light-theme .nav-menu li {
        border-top: 4px solid black;
        border-right: 4px solid black;
        border-left: 4px solid black;
    }

    body.light-theme .last-child {
        border-bottom: 4px solid black;
    }

    #pc-nav {
        display: none;
    }

    #hamburger {
        display: block !important;
        flex-direction: column;
        width: 45px;
        height: 45px;
        margin-right: 10px;
        justify-content: center;
        background: none;
        cursor: pointer;
        z-index: 1001;
    }

    body.light-theme #hamburger {
        border: 4px solid #000 !important;
    }

    body.dark-theme #hamburger {
        border: 4px solid white !important;
    }

    body.light-theme #hamburger span {
        background: black;
    }

    body.dark-theme #hamburger span {
        background: white;
    }

    #pc-color {
        display: none;
    }

    #sp-color {
        display: block;
        border: none;
    }

    #doFormatJson {
        width: 90%;
    }

    body.dark-theme .nav-menu li {
        background: black;
    }

    body.light-theme .nav-menu li {
        background: white;
    }

    .nav-menu li {
        color: black;
        height: 50px;
    }

}

@media screen and (max-width: 480px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 60px;
        right: 0;
        background: #fff;
        width: 200px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        flex-direction: column;
        z-index: 1000;
    }

    .nav-menu.active {
        display: flex;
    }

    #hamburger {
        display: flex;
    }
}