/* Apple風ダッシュボードCSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #F5F5F7;
    color: #1D1D1F;
    line-height: 1.5;
}

.dashboard-container {
    min-height: 100vh;
    background: #F5F5F7;
}

/* Header */
.dashboard-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.app-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #000000;
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-title i {
    color: #007AFF;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.version-badge {
    background: #007AFF;
    color: white;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
}

.settings-btn {
    background: transparent;
    border: none;
    color: #666666;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.settings-btn:hover {
    background: #EEEEEE;
    color: #000000;
}

/* Main Content */
.dashboard-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* Stats Section */
.stats-section {
    margin-bottom: 32px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s ease;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #007AFF;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.success {
    background: #4CD964;
}

.stat-icon.warning {
    background: #FF9500;
}

.stat-icon.error {
    background: #FF3B30;
}

.stat-number {
    font-size: 2rem;
    font-weight: 600;
    color: #000000;
    margin-bottom: 4px;
}

.stat-label {
    color: #666666;
    font-size: 0.9rem;
}

/* Upload Section */
.upload-section {
    margin-bottom: 32px;
}

.upload-card {
    background: white;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.upload-header {
    text-align: center;
    margin-bottom: 24px;
}

.upload-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #000000;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.upload-header p {
    color: #666666;
    font-size: 0.9rem;
}

.upload-area {
    border: 2px dashed #CBD5E0;
    border-radius: 16px;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #F7FAFC;
}

.upload-area:hover, .upload-area.drag-over {
    border-color: #007AFF;
    background: #F0F8FF;
}

.upload-icon {
    font-size: 3rem;
    color: #CBD5E0;
    margin-bottom: 16px;
}

.upload-text {
    font-size: 1.1rem;
    color: #1D1D1F;
    margin-bottom: 8px;
}

.upload-subtext {
    color: #666666;
    margin-bottom: 16px;
}

.upload-btn {
    background: #007AFF;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-btn:hover {
    background: #0056CC;
    transform: translateY(-1px);
}

/* Format Extract Area */
.format-extract-area {
    border: 2px dashed #CBD5E0;
    border-radius: 16px;
    padding: 32px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #F7FAFC;
    margin-top: 12px;
}

.format-extract-area:hover, .format-extract-area.drag-over {
    border-color: #28A745;
    background: #F0FFF0;
}

.extract-icon {
    font-size: 2rem;
    color: #CBD5E0;
    margin-bottom: 12px;
}

.extract-text {
    font-size: 1rem;
    color: #1D1D1F;
    margin-bottom: 6px;
}

.extract-subtext {
    color: #666666;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.extract-btn {
    background: #28A745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.extract-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

.extract-progress {
    margin-top: 12px;
    text-align: center;
}

.setting-description {
    color: #666666;
    font-size: 0.9rem;
    margin-bottom: 12px;
    line-height: 1.4;
}

.upload-progress {
    margin-top: 16px;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #EEEEEE;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: #007AFF;
    animation: progress 1s ease-in-out infinite;
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 100%; }
    100% { width: 0%; }
}

.progress-text {
    color: #666666;
    font-size: 0.9rem;
}

/* Results Section */
.results-section {
    margin-bottom: 32px;
}

.results-card {
    background: white;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.results-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #000000;
    display: flex;
    align-items: center;
    gap: 8px;
}

.export-btn {
    background: transparent;
    border: 1px solid #007AFF;
    color: #007AFF;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.export-btn:hover {
    background: #007AFF;
    color: white;
}

.success-message, .warning-message, .error-message {
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 16px;
    text-align: center;
}

.success-message {
    background: #F0FFF4;
    border: 1px solid #9AE6B4;
}

.success-message h3 {
    color: #22543D;
    margin-bottom: 8px;
}

.success-message p {
    color: #2F855A;
}

.warning-message {
    background: #FFFBEB;
    border: 1px solid #F6E05E;
}

.warning-message h3 {
    color: #744210;
    margin-bottom: 8px;
}

.error-message {
    background: #FED7D7;
    border: 1px solid #FEB2B2;
}

.error-message h3 {
    color: #742A2A;
    margin-bottom: 8px;
}

/* エラーレベル別スタイル */
.error-level {
    color: #E53E3E;
    font-weight: 600;
}

.error-level i {
    color: #E53E3E;
    margin-right: 8px;
}

.warning-level {
    color: #DD6B20;
    font-weight: 500;
}

.warning-level i {
    color: #DD6B20;
    margin-right: 8px;
}

.info-level {
    color: #3182CE;
    font-weight: 400;
}

.info-level i {
    color: #3182CE;
    margin-right: 8px;
}

.issues-list {
    margin-top: 16px;
}

.issue-item {
    background: #F8F9FA;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}

.issue-item h4 {
    color: #2D3748;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.issue-item ul {
    margin-left: 20px;
}

.issue-item li {
    color: #4A5568;
    margin-bottom: 4px;
}

/* Settings Panel */
.settings-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

.settings-panel.active {
    right: 0;
}

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

.settings-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #000000;
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-btn {
    background: transparent;
    border: none;
    color: #666666;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #EEEEEE;
    color: #000000;
}

.settings-content {
    padding: 24px;
}

.settings-group {
    margin-bottom: 32px;
}

.settings-group h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #000000;
    margin-bottom: 16px;
}

.setting-item {
    margin-bottom: 16px;
}

.setting-item label {
    display: block;
    font-size: 0.9rem;
    color: #666666;
    margin-bottom: 8px;
}

.setting-item input {
    width: 100%;
    padding: 12px;
    border: 1px solid #CBD5E0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.setting-item input:focus {
    outline: none;
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.settings-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-primary {
    background: #007AFF;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.btn-secondary {
    background: transparent;
    border: 1px solid #CBD5E0;
    color: #666666;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: #F7FAFC;
    color: #000000;
}

.btn-info {
    background: #17A2B8;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-info:hover {
    background: #138496;
    transform: translateY(-1px);
}

/* Settings Actions Grid */
.settings-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 24px;
}

/* Style Tabs */
.style-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 1px solid #E2E8F0;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 8px 16px;
    border-radius: 8px 8px 0 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: #666666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn.active {
    background: #007AFF;
    color: white;
}

.tab-btn:hover:not(.active) {
    background: #F0F8FF;
    color: #007AFF;
}

/* Style Tab Content */
.style-tab-content {
    display: none;
}

.style-tab-content.active {
    display: block;
}

.style-section {
    margin-bottom: 16px;
    padding: 12px;
    background: #F8F9FA;
    border-radius: 8px;
}

.style-section h5 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1D1D1F;
    margin-bottom: 8px;
}

.style-controls {
    display: grid;
    grid-template-columns: 2fr 1fr auto 1fr;
    gap: 8px;
    align-items: center;
}

.style-controls input[type="text"],
.style-controls input[type="number"],
.style-controls select {
    padding: 6px 8px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-size: 0.85rem;
    background: white;
}

.style-controls input[type="text"]:focus,
.style-controls input[type="number"]:focus,
.style-controls select:focus {
    outline: none;
    border-color: #007AFF;
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2);
}

.style-controls label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    color: #666666;
}

.style-controls input[type="checkbox"] {
    margin: 0;
}

/* Section Tabs */
.section-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 1px solid #E2E8F0;
}

.section-tab-content {
    display: none;
    padding: 16px;
    background: #FAFBFC;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
    margin-bottom: 16px;
}

.section-tab-content.active {
    display: block;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #E2E8F0;
}

.section-header h5 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1D1D1F;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-header i {
    color: #007AFF;
}

.section-description {
    font-size: 0.9rem;
    color: #6B7280;
    font-style: italic;
}

/* Content Check Grid */
.content-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.check-item {
    background: #FAFBFC;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 12px;
    transition: all 0.2s ease;
}

.check-item:hover {
    border-color: #007AFF;
    background: #F0F8FF;
}

.check-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #1D1D1F;
    cursor: pointer;
    margin-bottom: 4px;
}

.check-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #007AFF;
}

.check-description {
    font-size: 0.85rem;
    color: #6B7280;
    margin-left: 24px;
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .style-controls {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .style-tabs {
        flex-wrap: wrap;
    }

    .tab-btn {
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    .settings-actions {
        grid-template-columns: 1fr;
    }

    .dashboard-main {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .settings-panel {
        width: 100%;
        right: -100%;
    }

    .header-content {
        padding: 0 16px;
    }

    .upload-card, .results-card {
        padding: 16px;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.stat-card, .upload-card, .results-card {
    animation: fadeIn 0.3s ease;
}
