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

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: #fafafa;
    color: #333;
    overflow-x: hidden;
}

.app {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background: white;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid #e0e0e0;
}

.sidebar-header h1 {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
}

.sidebar-content {
    padding: 24px;
    flex: 1;
}

.btn-primary, .btn-secondary {
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #ecf0f1;
    color: #2c3e50;
    border: 1px solid #bdc3c7;
}

.btn-secondary:hover {
    background: #d5dbdb;
}

.icon {
    font-size: 16px;
    font-weight: bold;
}

.section {
    margin-top: 32px;
}

.section h3 {
    font-size: 14px;
    font-weight: 600;
    color: #7f8c8d;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}

.filter-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #3498db;
}

select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #bdc3c7;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.toolbar {
    padding: 24px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toolbar h2 {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
}

.view-controls {
    display: flex;
    gap: 4px;
    background: #ecf0f1;
    border-radius: 8px;
    padding: 4px;
}

.view-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #7f8c8d;
}

.view-btn.active {
    background: white;
    color: #2c3e50;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.content-area {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.view {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
}

.view.active {
    opacity: 1;
}

/* Timeline */
.timeline {
    padding: 32px;
    max-width: 800px;
    margin: 0 auto;
}

.timeline-item {
    position: relative;
    margin-bottom: 32px;
    padding-left: 40px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.timeline-item:before {
    content: '';
    position: absolute;
    left: 12px;
    top: 0;
    bottom: -32px;
    width: 2px;
    background: #e0e0e0;
}

.timeline-item:last-child:before {
    display: none;
}

.timeline-dot {
    position: absolute;
    left: 6px;
    top: 12px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 2px #3498db;
}

.timeline-dot.idea {
    box-shadow: 0 0 0 2px #f39c12;
}

.timeline-dot.award {
    box-shadow: 0 0 0 2px #e74c3c;
}

.timeline-dot.adoption {
    box-shadow: 0 0 0 2px #27ae60;
}

.timeline-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
    position: relative;
}

.timeline-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.record-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.record-type {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.record-type.idea {
    background: #fff3cd;
    color: #856404;
}

.record-type.award {
    background: #f8d7da;
    color: #721c24;
}

.record-type.adoption {
    background: #d4edda;
    color: #155724;
}

.record-date {
    font-size: 14px;
    color: #7f8c8d;
    font-weight: 500;
}

.record-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.record-description {
    color: #5d6d7e;
    line-height: 1.6;
    margin-bottom: 16px;
}

.record-image {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-top: 12px;
}

.record-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.timeline-card:hover .record-actions {
    opacity: 1;
}

.action-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
}

.edit-btn {
    background: #3498db;
    color: white;
}

.edit-btn:hover {
    background: #2980b9;
    transform: scale(1.1);
}

.delete-btn {
    background: #e74c3c;
    color: white;
}

.delete-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.record-content {
    cursor: pointer;
}

/* Slides View */
.slides-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.slide-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
}

.nav-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #3498db;
    color: white;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: #2980b9;
    transform: scale(1.1);
}

.nav-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

#slideCounter {
    font-weight: 500;
    color: #7f8c8d;
}

.slide-display {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.slide {
    background: white;
    border-radius: 16px;
    padding: 48px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    max-width: 800px;
    width: 100%;
    text-align: center;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.slide.active {
    transform: scale(1);
}

.slide-title {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 16px;
}

.slide-meta {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 32px;
}

.slide-type, .slide-date {
    font-size: 14px;
    font-weight: 500;
}

.slide-description {
    font-size: 16px;
    line-height: 1.8;
    color: #5d6d7e;
    margin-bottom: 32px;
}

.slide-image {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 12px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 24px;
    color: #7f8c8d;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #ecf0f1;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #bdc3c7;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

form {
    padding: 24px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 32px;
}

.form-actions .btn-primary,
.form-actions .btn-secondary {
    width: auto;
    min-width: 100px;
}

.export-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.export-group .btn-secondary {
    font-size: 13px;
    padding: 10px 14px;
}

/* Hidden slide for export */
.export-slide {
    position: fixed;
    top: -9999px;
    left: -9999px;
    width: 1920px;
    height: 1080px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px;
    box-sizing: border-box;
    font-family: 'Noto Sans JP', sans-serif;
}

.slide-frame {
    background: white;
    border-radius: 24px;
    padding: 80px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    max-width: 1400px;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 700px;
    border: 2px solid #e9ecef;
}

.export-slide-title {
    font-size: 48px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 32px;
    text-align: center;
    line-height: 1.2;
}

.export-slide-meta {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 48px;
}

.export-slide-type {
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.export-slide-type.idea {
    background: #fff3cd;
    color: #856404;
}

.export-slide-type.award {
    background: #f8d7da;
    color: #721c24;
}

.export-slide-type.adoption {
    background: #d4edda;
    color: #155724;
}

.export-slide-date {
    font-size: 20px;
    color: #7f8c8d;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.export-slide-description {
    font-size: 24px;
    line-height: 1.6;
    color: #5d6d7e;
    text-align: center;
    margin-bottom: 48px;
    max-width: 1200px;
}

.export-slide-image {
    max-width: 800px;
    max-height: 400px;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    flex-direction: column;
    gap: 16px;
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 16px;
    color: #7f8c8d;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .app {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        order: 2;
    }
    
    .main-content {
        order: 1;
    }
    
    .toolbar {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .timeline-item {
        padding-left: 32px;
    }
    
    .slide {
        padding: 32px;
    }
    
    .slide-title {
        font-size: 24px;
    }
}