:root {
    --primary-bg: #ffffff;
    --secondary-bg: #f9f9f9;
    --text-color: #3a3c3c;
    --secondary-text: #606060;
    --hover-color: #e5e5e5;
    --border-color: #e0e0e0;
    --active-tab-color: #e8e8e8;
    --header-bg: #f8f9fa;
    --sidebar-width: 240px;
    --chapter-list-width: 300px;
    --header-height: 50px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    list-style: none;
}

body {
    font-family: 'Noto Sans JP', 'Arial', sans-serif;
    background-color: #eee9e6;
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
    -webkit-backface-visibility: hidden;
    word-spacing: 1px;
}

img {
    width: 100%;
    display: block;
}

.btn-wrap {
    margin: 10px 0;
}

.btn {
    color: white;
    padding: 20px 1.5rem;
    text-align: center;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 16px;
    font-weight: 500;
    width: 220px;
    margin: 0 auto;
    display: block;
    text-decoration: none;
    font-weight: bold;
}

.btn--download {
    background-color: #c95e99;
    width: auto;
}

.btn:hover {
    opacity: 0.7;
}

.btn.btn--primary {
    background-color: #c95e99;
}

.header {
    position: relative;
    padding: 10px 20px;
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--header-height);
}

.sidebar-toggle {
    /*ボタン内側の基点となるためrelativeを指定。
追従するナビゲーションの場合はfixed＋top、rightといった位置をセットで指定*/
    position: relative;
    background: #57a2c7;
    cursor: pointer;
    width: 50px;
    height: 50px;
    border-radius: 5px;
}

/*ボタン内側*/
.sidebar-toggle span {
    display: inline-block;
    transition: all .4s;
    /*アニメーションの設定*/
    position: absolute;
    left: 14px;
    height: 1px;
    border-radius: 2px;
    background: #da81b2;
    width: 45%;
}

.sidebar-toggle span:nth-of-type(1) {
    top: 15px;
}

.sidebar-toggle span:nth-of-type(2) {
    top: 23px;
}

.sidebar-toggle span:nth-of-type(3) {
    top: 31px;
}

/*activeクラスが付与されると線が回転して×に*/

.sidebar-toggle.active span:nth-of-type(1) {
    top: 18px;
    left: 18px;
    transform: translateY(6px) rotate(-45deg);
    width: 50%;
}

.sidebar-toggle.active span:nth-of-type(2) {
    opacity: 0;
    /*真ん中の線は透過*/
}

.sidebar-toggle.active span:nth-of-type(3) {
    top: 30px;
    left: 18px;
    transform: translateY(-6px) rotate(45deg);
    width: 50%;
}

.logo {
    width: 150px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    font-weight: bold;
    color: #ff6600;
}

.user-icon {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    cursor: pointer;
}

.user-icon img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #e1e1e1;
}

.container {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--header-height));
    margin-top: var(--header-height);
    max-width: var(--max-content-width);
    margin-left: auto;
    margin-right: auto;
    padding-bottom: 4rem;
    padding-top: 2rem;
}

.grid-container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 2rem;
    width: 100%;
}

.main-wrapper {
    display: flex;
    flex-grow: 1;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--primary-bg);
    color: var(--text-color);
    padding: 12px 0;
    height: 100vh;
    overflow-y: auto;
    position: fixed;
    top: var(--header-height);
    left: -100%;
    transition: left 0.3s ease;
    z-index: 1001;
    /* オーバーレイより上に表示 */
    border-right: 1px solid var(--border-color);
}

.sidebar.active {
    left: 0;
}

.sidebar-toggle {
    position: absolute;
    background: none;
    border: none;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    cursor: pointer;
    padding: 5px 10px;
    color: #d3b9ba;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    cursor: pointer;
    text-decoration: none;
    color: #333;
    font-size: 13px;
}

.sidebar-item a {
    text-decoration: none;
}

.sidebar-item:hover {
    background-color: var(--hover-color);
}

.sidebar-icon {
    width: 18px;
    margin-right: 8px;
}

.main-content {
    flex-grow: 1;
    display: flex;
    padding: 0 24px;
    max-width: 1280px;
    margin: 0 auto;
}

.inner {
    width: 60%;
    margin: 0 auto;
    padding: 0 2rem;
}

.page-title {
    text-align: center;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 700;
}

.video-tab:focus,
.chapter-item:focus,
.sidebar-item:focus {
    outline: 2px solid var(--active-tab-color);
    outline-offset: -2px;
}


.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background-color: var(--primary-bg);
}

.login-container {
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--primary-bg);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    margin: 0 auto;
}

.login-container h1 {
    font-size: 18px;
    text-align: center;
    margin-bottom: 20px;
}

.login-form {
    display: flex;
    flex-direction: column;
}

.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}

.forgot-password {
    text-align: center;
    margin-top: 1rem;
    font-size: 13px;
}

.forgot-password a {
    color: var(--accent-color);
    text-decoration: none;
}

.forgot-password a:hover {
    text-decoration: underline;
}

.or-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
}

.or-divider::before,
.or-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.or-divider span {
    padding: 0 10px;
    color: var(--secondary-text);
    font-size: 0.9rem;
}

.btn-gmail {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    color: var(--text-color);
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-bottom: 1rem;
    text-decoration: none;
}

.btn-gmail img {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

@media (max-width: 1080px) {
    .main-wrapper {
        flex-direction: column;
    }

    .main-content {
        flex-direction: column;
        padding: 0 0;
        width: 100%;
        max-width: 960px;
    }

}





.profile-edit-form {
    display: grid;
    gap: 1.5rem;
    width: 100%;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group textarea {
    padding: 20px 14px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 16px;
}

.avatar-upload {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
    position: relative;
    width: 120px;
    height: 120px;
    margin-left: auto;
    margin-right: auto;
}

.avatar-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.avatar-upload-button {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.avatar-upload-button::before {
    content: "+";
    color: white;
    font-size: 40px;
}

#avatar {
    display: none;
}

.profile-edit-card {
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    padding: 2rem;
    transition: all 0.3s ease;
    width: 980px;
    margin: 0 auto;
    max-width: 980px;
}

.profile-edit-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #2c3e50;
    text-align: center;
}

.pp-container {
    max-width: 980px;
    width: 980px;
    margin: 0 auto 20px auto;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.pp-banner {
    background-color: #fcebd8;
    background: linear-gradient(135deg, #f4d3f9, #ffd6a5);
    overflow: hidden;
    display: flex;
    align-items: stretch;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.pp-content {
    flex: 1;
    padding: 40px;
}

.pp-subtitle {
    font-size: 14px;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.pp-title {
    font-size: 20px;
    color: #4a4a4a;
    margin: 0 0 20px;
    font-weight: bold;
    text-align: center;
}

.pp-description {
    font-size: 16px;
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
}

.pp-button {
    display: inline-block;
    background-color: #d7517b;
    color: white;
    padding: 12px 24px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
    width: 210px;
    margin: 0 auto;
    display: block;
}

.pp-button:hover {
    opacity: 0.8;
}

.pp-image {
    flex: 0 0 300px;
    background-image: url('/assets/img/top/key.jpg');
    background-size: cover;
    background-position: right;
}

.footer {
    padding: 30px 0;
    background-color: #5d6d7b;
    text-align: center;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    margin: 0 50px;
    justify-content: center;
    line-height: 2;
}

.footer a {
    color: #fff;
    font-size: 11px;
    text-decoration: none;
    margin-right: 10px;
}

.footer a:last-child {
    margin-right: 0;
}

.footer p {
    margin-top: 6px;
    font-size: 12px;
    color: #fff;
}

.flash-message {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #37c384;
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    transition: all 0.3s ease;
    opacity: 1;
    font-size: 13px;
    visibility: visible;
    transition: opacity 1s ease, visibility 0.3s ease;
}

.flash-message--error {
    background-color: #db3333;
}

.flash-message.hide {
    opacity: 0;
    visibility: hidden;
}

@keyframes fadeOut {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

.flash-message {
    animation: fadeOut 0.3s ease 3s forwards;
}


@media (max-width: 768px) {
    .header {
        flex-wrap: wrap;
    }

    .container {
        margin-left: 1rem;
        margin-right: 1rem;
        padding-top: 1.4rem;
    }

    .grid-container {
        padding: 0 0;
        width: 100%;
    }

    .mypage-container {
        width: 100%;
        padding: 0 10px;
    }

    .profile-edit-card {
        padding: 1.5rem;
        width: 100%;
    }

    .pp-container {
        width: 100%;
    }

    .pp-content {
        padding: 20px;
    }

    .pp-title {
        font-size: 16px;
    }
}




@media (max-width: 600px) {
    .logo {
        width: 140px;
    }

    .video-tab {
        flex: 1 0 25%;
        text-align: center;
        font-size: 14px;
        padding: 10px 10px;
    }

    .video-controls {
        align-items: stretch;
        justify-content: space-between;
    }

    .video-controls button {
        margin-right: 0;
    }

    .video-title-overlay {
        font-size: 18px;
    }

    .video-controls button:nth-child(2) {
        padding-right: 40px;
        padding-left: 40px;
    }
}