/**
 * 共通レイアウトCSS
 * 全スタジオページ共通のヘッダー・サイドメニュースタイル
 */

/* ===============================================
   基本レイアウト設定
=============================================== */

.common-layout-body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* ===============================================
   共通ヘッダー
=============================================== */

.common-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sidebar-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: rgba(102, 126, 234, 0.1);
}

.hamburger-line {
    width: 20px;
    height: 2px;
    background: #333;
    margin: 2px 0;
    transition: all 0.3s ease;
    border-radius: 1px;
}

.header-title h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
    line-height: 1.2;
}

.header-subtitle {
    margin: 0;
    font-size: 12px;
    color: #666;
    font-weight: 400;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-status {
    display: flex;
    gap: 15px;
}

.status-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.status-label {
    font-size: 10px;
    color: #666;
    margin-bottom: 2px;
    font-weight: 500;
}

.status-value {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    white-space: nowrap;
}

.status-success {
    background: rgba(34, 197, 94, 0.1);
    color: #059669;
}

.status-error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.header-home-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.header-home-btn:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

/* ===============================================
   共通サイドバー
=============================================== */

.common-sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1100;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 5px 0 30px rgba(0, 0, 0, 0.1);
}

.common-sidebar.open {
    left: 0;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

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

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 24px;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.sidebar-close {
    width: 30px;
    height: 30px;
    border: none;
    background: none;
    font-size: 20px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

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

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

.sidebar-item:hover {
    background: rgba(102, 126, 234, 0.05);
    border-left-color: rgba(102, 126, 234, 0.3);
}

.sidebar-item.active {
    background: rgba(102, 126, 234, 0.1);
    border-left-color: #667eea;
    color: #667eea;
}

.sidebar-item-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.sidebar-item-content {
    flex: 1;
}

.sidebar-item-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.sidebar-item-description {
    font-size: 12px;
    color: #666;
    font-weight: 400;
}

.sidebar-item.active .sidebar-item-description {
    color: #5a6fd8;
}

/* セパレーター（区切り線）スタイル */
.sidebar-separator {
    display: flex;
    align-items: center;
    margin: 20px 0;
    padding: 0 20px;
}

.separator-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, #ddd, transparent);
}

.separator-title {
    padding: 0 15px;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    text-align: center;
}

.sidebar-version {
    font-size: 12px;
    color: #999;
    margin-bottom: 5px;
}

.sidebar-info {
    font-size: 14px;
    color: #667eea;
    font-weight: 600;
}

/* ===============================================
   メインコンテンツエリア
=============================================== */

.common-main {
    margin-top: 70px;
    min-height: calc(100vh - 70px);
}

/* 共通レイアウト使用時のメインコンテンツ */
.common-layout-body .main-content {
    margin-top: 70px; /* 固定ヘッダー分のマージン */
    padding: 0px 20px 20px 20px; /* 上部余白を0pxに削減 */
    width: 100%;
    box-sizing: border-box;
    min-height: calc(100vh - 70px);
}

/* ===============================================
   レスポンシブ対応
=============================================== */

/* タブレット */
@media (max-width: 768px) {
    .header-content {
        padding: 0 15px;
    }
    
    .header-status {
        display: none;
    }
    
    .header-title h1 {
        font-size: 20px;
    }
    
    .main-content {
        padding: 0px 15px 15px 15px;
    }
    
    .common-sidebar {
        width: 280px;
        left: -280px;
    }
}

/* スマートフォン */
@media (max-width: 480px) {
    .header-content {
        padding: 0 10px;
    }
    
    .header-title h1 {
        font-size: 18px;
    }
    
    .header-subtitle {
        display: none;
    }
    
    .header-home-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .main-content {
        padding: 0px 10px 10px 10px;
    }
    
    .common-sidebar {
        width: 250px;
        left: -250px;
    }
    
    .sidebar-item {
        padding: 12px 15px;
    }
    
    .sidebar-item-title {
        font-size: 14px;
    }
    
    .sidebar-item-description {
        font-size: 11px;
    }
}

/* ===============================================
   アニメーション・エフェクト
=============================================== */

.sidebar-toggle:active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.sidebar-toggle:active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.sidebar-toggle:active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ===============================================
   既存コンテンツとの調整
=============================================== */

/* 既存のコンテナを調整 */
.main-content .container {
    max-width: 100%;
    padding: 0;
}

/* 既存のヘッダーを非表示 */
.main-content .header {
    display: none;
}

/* カード系コンテンツの調整 */
.main-content .card,
.main-content .panel {
    margin-bottom: 20px;
}

/* フォーム要素の調整 */
.main-content input,
.main-content select,
.main-content textarea,
.main-content button {
    border-radius: 8px;
}

/* ===============================================
   ダークモード対応（将来実装）
=============================================== */

@media (prefers-color-scheme: dark) {
    .common-header {
        background: rgba(30, 30, 30, 0.95);
    }
    
    .common-sidebar {
        background: rgba(30, 30, 30, 0.95);
    }
    
    .header-title h1,
    .sidebar-item-title {
        color: #fff;
    }
    
    .header-subtitle,
    .sidebar-item-description {
        color: #ccc;
    }
    
    .hamburger-line {
        background: #fff;
    }
}
