/* サイドバーのスタイリング */
.sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background: #1E2939;
    color: white;
    transition: left 0.3s ease;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar.open {
    left: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
    align-items: center;
    width: 32px;
    height: 32px;
    position: relative;
}

.hamburger {
    width: 20px;
    height: 2px;
    background: white;
    transition: 0.3s;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-left: -10px;
}

.hamburger:nth-child(1) {
    margin-top: -6px;
}

.hamburger:nth-child(2) {
    margin-top: -1px;
}

.hamburger:nth-child(3) {
    margin-top: 4px;
}

.sidebar.open .hamburger:nth-child(1) {
    transform: rotate(45deg);
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -1px;
}

.sidebar.open .hamburger:nth-child(2) {
    opacity: 0;
}

.sidebar.open .hamburger:nth-child(3) {
    transform: rotate(-45deg);
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -1px;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.sidebar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-item {
    margin: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: #2662F0;
    transform: translateX(5px);
}

.sidebar-link.active {
    background: rgba(255, 255, 255, 0.2);
    border-left-color: #2662F0;
}

.sidebar-link i {
    margin-right: 0;
    font-size: 1.1rem;
    width: 0;
    text-align: center;
}

.sidebar-link span {
    font-weight: 500;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.user-info {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.user-email {
    font-size: 0.8rem;
    opacity: 0.8;
}

.logout-form {
    width: 100%;
}

.logout-btn {
    width: 100%;
    background: #2662F0;
    border: 1px solid #2662F0;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
}

.logout-btn:hover {
    background: #1C64F2;
    border-color: #1C64F2;
    transform: translateY(-1px);
}

.logout-btn i {
    font-size: 1rem;
}

/* サイドバーオーバーレイ */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* メインコンテンツの調整 */
.main-content {
    transition: margin-left 0.3s ease;
    margin-left: 0;
}

.main-content.sidebar-open {
    margin-left: 300px;
}

/* サイドバートグルボタン（ヘッダー用） */
.header-sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-right: 15px;
}

.header-sidebar-toggle .hamburger {
    width: 20px;
    height: 2px;
    background: #1E2939;
    transition: 0.3s;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .sidebar {
        width: 280px;
        left: -280px;
    }
    
    .main-content.sidebar-open {
        margin-left: 0;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 100%;
        left: -100%;
    }
}

/* アイコンのスタイリング */
.icon-home::before { content: ""; }
.icon-datalink::before { content: ""; }
.icon-partner::before { content: ""; }
.icon-chat::before { content: ""; }
.icon-logout::before { content: ""; }
.icon-guide::before { content: ""; }
.icon-media::before { content: ""; }

/* アニメーション */
@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

.sidebar.open {
    animation: slideIn 0.3s ease;
}

/* スクロールバーのカスタマイズ */
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: #2662F0;
    border-radius: 2px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: #1C64F2;
}
