@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-primary: #0b0f19;
    --bg-secondary: #131b2e;
    --bg-card: #1e2942;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --color-primary: #6366f1; /* Indigo Accent */
    --color-primary-hover: #4f46e5;
    --border-color: #334155;
    
    /* Risk Renkleri */
    --risk-high: #f43f5e;
    --risk-medium: #f59e0b;
    --risk-low: #10b981;
    --risk-none: #64748b;
    
    --font-main: 'Outfit', sans-serif;
    --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Glassmorphism Efekti */
.glass-panel {
    background: rgba(19, 27, 46, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    box-shadow: var(--shadow-premium);
}

/* Header */
header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #a5b4fc, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo span {
    font-weight: 300;
    color: var(--text-secondary);
}

.user-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.user-info strong {
    color: var(--text-primary);
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-main);
    font-weight: 500;
    font-size: 0.85rem;
    transition: var(--transition-smooth);
}

.btn-logout:hover {
    border-color: var(--risk-high);
    color: var(--risk-high);
    background: rgba(244, 63, 94, 0.1);
}

/* Container */
.container {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Ana Grid */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}
/* Form Alanları */
.input-section, .output-section {
    padding: 2rem;
    min-height: 550px;
    display: flex;
    flex-direction: column;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

select, textarea {
    width: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-main);
    transition: var(--transition-smooth);
}

select {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.95rem;
}

textarea {
    padding: 1rem;
    resize: none;
    height: 300px;
    font-size: 0.95rem;
    line-height: 1.5;
}

select:focus, textarea:focus, .content-editable-editor:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.content-editable-editor {
    width: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-main);
    transition: var(--transition-smooth);
    padding: 1rem;
    height: 300px;
    font-size: 0.95rem;
    line-height: 1.5;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    outline: none;
}

.content-editable-editor:empty:before {
    content: attr(placeholder);
    color: var(--text-secondary);
    opacity: 0.7;
    cursor: text;
}

/* Butonlar */
.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), #4f46e5);
    border: none;
    color: #fff;
    padding: 1rem;
    border-radius: 10px;
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    margin-top: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

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

.btn-primary:disabled {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Yükleme Animasyonu */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Çıktı Bölümü Raporu */
.report-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
    font-size: 0.95rem;
}

.report-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    gap: 1rem;
    text-align: center;
    margin: auto;
}

.report-placeholder svg {
    width: 64px;
    height: 64px;
    opacity: 0.3;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Markdown Render Stilleri */
.report-content h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.5rem;
}

.report-content h3:first-of-type {
    margin-top: 0;
}

.report-content ul {
    list-style-type: none;
    padding-left: 0;
    margin-bottom: 1.5rem;
}

.report-content li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.report-content li::before {
    content: "•";
    color: var(--color-primary);
    font-weight: bold;
    font-size: 1.25rem;
    position: absolute;
    left: 0.25rem;
    top: -0.1rem;
}

.report-content p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* Risk Badge */
.risk-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.risk-1 {
    background-color: rgba(244, 63, 94, 0.15);
    color: var(--risk-high);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.risk-2 {
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--risk-medium);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.risk-3 {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--risk-low);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.risk-4 {
    background-color: rgba(100, 116, 139, 0.15);
    color: var(--risk-none);
    border: 1px solid rgba(100, 116, 139, 0.3);
}



/* Sürümleme Bileşeni */
.version-tracker {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    font-family: var(--font-main);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.version-badge {
    background: rgba(30, 41, 66, 0.9);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.version-badge:hover {
    border-color: var(--color-primary);
    color: var(--text-primary);
}

.version-badge.new-update {
    color: var(--risk-low);
    font-weight: 800;
    border-color: var(--risk-low);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.version-history {
    position: absolute;
    bottom: 2.5rem;
    right: 0;
    width: 250px;
    padding: 1rem;
    background: #131b2e;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow-premium);
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.version-history h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.version-item {
    font-size: 0.75rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.version-item:last-child {
    border-bottom: none;
}

.version-item.latest {
    font-weight: 800;
    color: var(--text-primary);
}

.version-item.latest-new {
    font-weight: 800;
    color: var(--risk-low);
}

.version-item span {
    display: block;
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 0.7rem;
}

/* Geçmiş Analizler Listesi */
.history-section {
    padding: 2rem;
}

.history-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.history-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.history-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-primary);
}

.history-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
}

.history-card-title {
    font-size: 0.95rem;
    font-weight: 700;
}

.history-card-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.history-card-preview {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Madde Vurgulama Animasyonu */
@keyframes highlight-pulse {
    0% { background-color: rgba(99, 102, 241, 0.6); color: #fff; box-shadow: 0 0 12px rgba(99, 102, 241, 0.8); }
    50% { background-color: rgba(99, 102, 241, 0.3); }
    100% { background-color: transparent; }
}
.highlight-flash {
    animation: highlight-pulse 2.5s ease-out;
    border-radius: 4px;
    padding: 2px 6px;
}

.clause-link {
    color: var(--color-primary);
    text-decoration: underline;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    padding: 0 2px;
}

.clause-link:hover {
    color: var(--color-primary-hover);
    text-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
}

.contract-paragraph:hover {
    background-color: rgba(99, 102, 241, 0.05);
}

/* Rapor Başlık Alanı */
.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.report-header h2 {
    font-size: 1.3rem;
    font-weight: 800;
}

/* Rapor Modu Seçici Barı (Özet / Detay) */
.report-mode-selector {
    display: flex;
    gap: 0.5rem;
    padding: 0.25rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: fit-content;
}


.mode-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1.25rem;
    border-radius: 9px;
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.mode-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.mode-btn.active {
    background: linear-gradient(135deg, var(--color-primary), #4f46e5);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

/* Satır İçi Risk Etiketleri */
.inline-risk {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.inline-risk.risk-1 {
    background-color: rgba(244, 63, 94, 0.15);
    color: var(--risk-high);
    border: 1px solid rgba(244, 63, 94, 0.25);
}

.inline-risk.risk-2 {
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--risk-medium);
    border: 1px solid rgba(245, 158, 11, 0.25);
}


