* {
    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;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

header p {
    opacity: 0.9;
    font-size: 1rem;
}

.tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    background: #f5f5f5;
}

.tab-button {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: #666;
    transition: all 0.3s;
}

.tab-button:hover {
    background: #e8e8e8;
}

.tab-button.active {
    background: white;
    color: #667eea;
    border-bottom: 3px solid #667eea;
}

.tab-content {
    display: none;
    padding: 30px;
}

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

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input[type="file"] {
    padding: 8px;
    cursor: pointer;
    background: #f9f9f9;
}

.form-group input[type="file"]:hover {
    background: #f0f0f0;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.85rem;
}

.sources-info {
    margin-bottom: 1.25rem;
    padding: 12px 16px;
    background: #f0f4ff;
    border: 1px solid #c5d4f7;
    border-radius: 8px;
    font-size: 0.9rem;
}

.sources-info ul {
    margin: 8px 0 0;
    padding-left: 1.25rem;
}

.sources-info a {
    color: #4a5fc1;
    word-break: break-all;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 30px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
    margin-right: 10px;
}

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

.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.results {
    padding: 30px;
    border-top: 2px solid #e0e0e0;
}

.results h2 {
    margin-bottom: 20px;
    color: #333;
}

.actions {
    margin-bottom: 20px;
}

.content-output {
    background: #fafbfc;
    padding: 24px;
    border-radius: 8px;
    border: 1px solid #e4e8ef;
    line-height: 1.75;
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
    font-size: 1rem;
    color: #2c3340;
}

.content-output .rich-content,
.content-text .rich-content {
    max-width: 100%;
}

.content-output .rich-content > h2:first-child,
.content-text .rich-content > h2:first-child {
    margin-top: 0;
}

.content-output h2,
.content-text h2 {
    color: #4a5fc1;
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.35;
    padding-bottom: 0.35rem;
    border-bottom: 2px solid #e8ecf8;
}

.content-output p,
.content-text p {
    margin-bottom: 1rem;
    text-align: left;
}

.content-output ul.content-list,
.content-output ol.content-list,
.content-text ul.content-list,
.content-text ol.content-list {
    margin: 0.75rem 0 1.25rem;
    padding-left: 1.6rem;
}

.content-output ul.content-list,
.content-text ul.content-list {
    list-style-type: disc;
}

.content-output ol.content-list,
.content-text ol.content-list {
    list-style-type: decimal;
}

.content-output ul.content-list li,
.content-output ol.content-list li,
.content-text ul.content-list li,
.content-text ol.content-list li {
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
}

.content-output ul.content-list li::marker,
.content-text ul.content-list li::marker {
    color: #667eea;
}

.content-table-wrap {
    overflow-x: auto;
    margin: 1.25rem 0;
    border-radius: 8px;
    border: 1px solid #d8dee9;
    box-shadow: 0 2px 8px rgba(40, 52, 88, 0.06);
    background: #fff;
}

.content-output table.content-table,
.content-text table.content-table {
    width: 100%;
    border-collapse: collapse;
    display: table;
    table-layout: auto;
    font-size: 0.95rem;
}

.content-output table.content-table th,
.content-text table.content-table th {
    background: linear-gradient(180deg, #667eea 0%, #5a6fd6 100%);
    color: #fff;
    font-weight: 600;
    padding: 12px 14px;
    text-align: left;
    border: 1px solid #5568d3;
    white-space: normal;
}

.content-output table.content-table td,
.content-text table.content-table td {
    padding: 11px 14px;
    border: 1px solid #e2e6ef;
    vertical-align: top;
    background: #fff;
}

.content-output table.content-table tbody tr:nth-child(even) td,
.content-text table.content-table tbody tr:nth-child(even) td {
    background: #f7f9fc;
}

.content-output table.content-table tbody tr:hover td,
.content-text table.content-table tbody tr:hover td {
    background: #eef2ff;
}

.content-diagram {
    display: block;
    margin: 1rem 0;
    padding: 14px 16px;
    background: #f4f6fb;
    border: 1px solid #d5dceb;
    border-radius: 8px;
    overflow-x: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.88rem;
    line-height: 1.45;
    white-space: pre;
    color: #3d4654;
}

.content-callout {
    margin: 1rem 0;
    padding: 12px 16px;
    background: #fff8e6;
    border-left: 4px solid #f5a623;
    border-radius: 0 8px 8px 0;
    font-size: 0.95rem;
}

.error {
    background: #fee;
    color: #c33;
    padding: 15px;
    border-radius: 6px;
    margin: 20px 30px;
    border: 1px solid #fcc;
    white-space: pre-line;
    word-wrap: break-word;
}

.sheets-data {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

.sheets-data h3 {
    margin-bottom: 15px;
}

#sheets-table {
    overflow-x: auto;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

/* Sheets önizleme tabloları (üretilen içerik değil) */
#sheets-table table th,
#sheets-table table td,
#xlsx-table table th,
#xlsx-table table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

#sheets-table table th,
#xlsx-table table th {
    background: #f5f5f5;
    font-weight: 600;
}

/* Scrollbar styling */
.content-output::-webkit-scrollbar {
    width: 8px;
}

.content-output::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.content-output::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.content-output::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

/* Batch Results Styles */
.batch-results {
    width: 100%;
}

.content-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.content-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.content-item.success {
    border-left: 4px solid #4caf50;
}

.content-item.error {
    border-left: 4px solid #f44336;
}

.content-header {
    padding: 15px 20px;
    background: #f9f9f9;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.content-header:hover {
    background: #f0f0f0;
}

.content-header h4 {
    margin: 0;
    flex: 1;
    color: #333;
    font-size: 1.1rem;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-right: 10px;
}

.content-item.success .status-badge {
    background: #e8f5e9;
    color: #2e7d32;
}

.content-item.error .status-badge {
    background: #ffebee;
    color: #c62828;
}

.toggle-icon {
    font-size: 0.9rem;
    color: #666;
    transition: transform 0.2s;
}

.content-body {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
}

.content-actions {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.content-text {
    line-height: 1.8;
    text-align: justify;
}

.content-text h2 {
    color: #667eea;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.content-text p {
    margin-bottom: 15px;
}

.content-text .content-table-wrap {
    margin: 1rem 0;
}

.error-message {
    color: #c62828;
    padding: 10px;
    background: #ffebee;
    border-radius: 4px;
}

/* Brief */
.brief-result {
    margin-top: 20px;
}

.brief-card {
    background: #fff;
    border: 1px solid #e4e8ef;
    border-radius: 10px;
    padding: 18px 18px;
    box-shadow: 0 2px 10px rgba(40, 52, 88, 0.06);
}

.brief-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.brief-head h3 {
    margin: 0;
    color: #333;
}

.brief-meta {
    font-size: 0.85rem;
    color: #667;
}

.brief-row {
    margin: 6px 0;
    color: #2c3340;
}

.brief-section {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #eef1f6;
}

.brief-section h4 {
    margin: 0 0 10px;
    color: #4a5fc1;
    font-size: 1.05rem;
}

.brief-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.brief-actions .btn-primary {
    flex: 1 1 260px;
}

.brief-actions .btn-secondary {
    flex: 1 1 200px;
    margin-right: 0;
}

.brief-batch-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 12px 0 18px;
}

.brief-batch-actions .btn-primary {
    flex: 1 1 320px;
}

.brief-batch-actions .btn-secondary {
    flex: 1 1 220px;
    margin-right: 0;
}

.brief-edit {
    margin-top: 10px;
    padding: 12px 14px;
    border: 1px solid #eef1f6;
    border-radius: 10px;
    background: #fbfcff;
}

.brief-edit-textarea {
    font-size: 0.95rem;
    line-height: 1.4;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial;
}

.keyword-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keyword-chip {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f0f4ff;
    border: 1px solid #c5d4f7;
    color: #2c3340;
    font-size: 0.9rem;
    line-height: 1;
}

/* Blog konu listesi */
.blog-topics-result {
    margin-top: 22px;
}

.blog-topics-disclaimer {
    margin-bottom: 14px;
    padding: 10px 14px;
    background: #fff8e6;
    border-left: 4px solid #f5a623;
    border-radius: 0 8px 8px 0;
    font-size: 0.9rem;
    color: #5a4a20;
}

.blog-topic-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.blog-topic-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border: 1px solid #e4e8ef;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.blog-topic-item:hover {
    border-color: #c5d4f7;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.08);
}

.blog-topic-item.selected {
    border-color: #667eea;
    background: #f8f9ff;
}

.blog-topic-item input[type="checkbox"] {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
}

.blog-topic-body {
    flex: 1;
    min-width: 0;
}

.blog-topic-title {
    font-weight: 600;
    color: #2c3340;
    margin-bottom: 6px;
    line-height: 1.35;
}

.blog-topic-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}

.blog-topic-badge {
    font-size: 0.78rem;
    padding: 3px 8px;
    border-radius: 999px;
    font-weight: 600;
}

.blog-topic-badge.volume-yuksek {
    background: #e8f5e9;
    color: #2e7d32;
}

.blog-topic-badge.volume-orta {
    background: #e3f2fd;
    color: #1565c0;
}

.blog-topic-badge.volume-dusuk {
    background: #f5f5f5;
    color: #616161;
}

.blog-topic-badge.intent {
    background: #f3e8ff;
    color: #6a1b9a;
}

.blog-topic-reason {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 8px;
}

.blog-topics-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #eef1f6;
}

.blog-topics-footer .btn-primary {
    flex: 1 1 280px;
}

.blog-select-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.blog-select-actions button {
    margin-right: 0;
}

.doc-summary-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.doc-summary-item {
    background: #f8f9fb;
    border: 1px solid #e6e9ef;
    border-radius: 8px;
    padding: 12px 14px;
}

.doc-summary-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 6px;
}

.doc-summary-content {
    font-size: 0.92rem;
    color: #555;
    line-height: 1.5;
    white-space: pre-wrap;
}

.doc-attached {
    margin-top: 10px;
    padding: 8px 10px;
    background: #eef6ff;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #1a5276;
}

.brief-doc-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eef1f6;
}

.brief-doc-hint {
    font-size: 0.9rem;
    color: #666;
    margin: 0 0 12px;
}

.brief-doc-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.brief-doc-controls input[type="file"] {
    flex: 1 1 220px;
}

.brief-doc-status {
    font-size: 0.9rem;
    color: #444;
    margin-bottom: 10px;
}

.brief-doc-empty {
    font-size: 0.9rem;
    color: #777;
    margin: 0;
}

