/* ベーススタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* アプリケーションコンテナ */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* ヘッダー */
.app-header {
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1920px;
    margin: 0 auto;
}

.app-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

.logo-icon {
    color: #764ba2;
}

.header-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.control-select {
    padding: 0.5rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.control-select:hover {
    border-color: #667eea;
}

.control-button {
    padding: 0.5rem 1.25rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.control-button:hover {
    background: #f7fafc;
    transform: translateY(-1px);
}

.control-button.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.control-button.primary:hover {
    opacity: 0.9;
}

/* メインコンテンツ */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* エディタパネル */
.editor-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    border-right: 1px solid #e2e8f0;
}

.panel-header {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-size: 1.1rem;
    color: #495057;
    font-weight: 600;
}

/* エディタツールバー */
.editor-toolbar {
    display: flex;
    gap: 0.25rem;
}

.toolbar-btn {
    padding: 0.5rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toolbar-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-1px);
}

/* Markdownエディタ */
.markdown-editor {
    flex: 1;
    padding: 1.5rem;
    border: none;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    outline: none;
    background: white;
}

/* プレビューパネル */
.preview-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
}

/* スライドコントロール */
.slide-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.slide-nav-btn {
    padding: 0.5rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide-nav-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.slide-counter {
    font-weight: 600;
    color: #495057;
    min-width: 60px;
    text-align: center;
}

/* スライドコンテナ */
.slide-container {
    flex: 1;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
}

.slide {
    background: white;
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-width: 900px;
    width: 100%;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* スライド内のスタイル */
.slide h1 {
    color: #2d3748;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.slide h2 {
    color: #4a5568;
    font-size: 2rem;
    margin-bottom: 1.25rem;
    margin-top: 1.5rem;
}

.slide h3 {
    color: #718096;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    margin-top: 1.25rem;
}

.slide p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1rem;
    color: #4a5568;
}

.slide ul, .slide ol {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1rem;
    padding-left: 2rem;
    color: #4a5568;
}

.slide li {
    margin-bottom: 0.5rem;
}

.slide code {
    background: #f7fafc;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9em;
    color: #e53e3e;
}

.slide pre {
    background: #2d3748;
    color: #f7fafc;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.slide pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.slide blockquote {
    border-left: 4px solid #667eea;
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #718096;
}

.slide img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem auto;
    display: block;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.slide table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.slide th {
    background: #f7fafc;
    padding: 0.75rem;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
}

.slide td {
    padding: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

/* サムネイル */
.slide-thumbnails {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    background: white;
    border-top: 1px solid #e2e8f0;
    overflow-x: auto;
}

.thumbnail {
    min-width: 120px;
    padding: 0.5rem;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.8rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thumbnail:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
}

.thumbnail.active {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

/* フルスクリーンモード */
.preview-panel.fullscreen-mode {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background: #1a202c;
}

.fullscreen-mode .slide-container {
    background: #1a202c;
}

.fullscreen-mode .slide {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* テーマ: ダーク */
body.theme-dark {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
}

body.theme-dark .app-header {
    background: rgba(45, 55, 72, 0.98);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.theme-dark .app-title {
    color: #90cdf4;
}

body.theme-dark .control-select,
body.theme-dark .control-button {
    background: #2d3748;
    color: #f7fafc;
    border-color: #4a5568;
}

body.theme-dark .editor-panel {
    background: #2d3748;
    border-right-color: #4a5568;
}

body.theme-dark .markdown-editor {
    background: #2d3748;
    color: #f7fafc;
}

body.theme-dark .panel-header {
    background: #1a202c;
    border-bottom-color: #4a5568;
    color: #f7fafc;
}

body.theme-dark .slide {
    background: #2d3748;
    color: #f7fafc;
}

body.theme-dark .slide h1,
body.theme-dark .slide h2,
body.theme-dark .slide h3 {
    color: #f7fafc;
}

body.theme-dark .slide p,
body.theme-dark .slide ul,
body.theme-dark .slide ol {
    color: #e2e8f0;
}

/* テーマ: ミニマル */
body.theme-minimal {
    background: #ffffff;
}

body.theme-minimal .app-header {
    background: #ffffff;
    border-bottom: none;
    box-shadow: none;
}

body.theme-minimal .app-title {
    color: #000000;
}

body.theme-minimal .slide {
    box-shadow: none;
    border: 1px solid #e2e8f0;
}

/* テーマ: カラフル */
body.theme-colorful {
    background: linear-gradient(135deg, #ff6b6b 0%, #4ecdc4 50%, #45b7d1 100%);
}

body.theme-colorful .app-title {
    color: #ff6b6b;
}

body.theme-colorful .control-button.primary {
    background: linear-gradient(135deg, #ff6b6b 0%, #4ecdc4 100%);
}

body.theme-colorful .slide h1 {
    background: linear-gradient(135deg, #ff6b6b 0%, #4ecdc4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.theme-colorful .slide blockquote {
    border-left-color: #ff6b6b;
}

body.theme-colorful .thumbnail.active {
    border-color: #ff6b6b;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1) 0%, rgba(78, 205, 196, 0.1) 100%);
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .editor-panel {
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        max-height: 40vh;
    }
    
    .header-controls {
        flex-wrap: wrap;
    }
    
    .slide {
        padding: 1.5rem;
    }
    
    .slide h1 {
        font-size: 1.8rem;
    }
    
    .slide h2 {
        font-size: 1.5rem;
    }
}