/* public/css/style.css */

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

:root {
    /* Modern Kurumsal Renk Paleti (Tailwind Slate & Indigo esintili) */
    --primary-color: #0f172a;
    /* Koyu Arduvaz (Sidebar vs) */
    --secondary-color: #1e293b;
    /* Açık Arduvaz */
    --accent-color: #4f46e5;
    /* Çivit Mavisi (Ana Aksiyonlar) */
    --success-color: #10b981;
    /* Zümrüt Yeşili */
    --warning-color: #f59e0b;
    /* Kehribar Sarısı */
    --danger-color: #ef4444;
    /* Yumuşak Kırmızı */

    --bg-color: #f8fafc;
    /* Çok açık gri/mavi arkaplan */
    --surface-color: #ffffff;
    /* Kart arkaplanı */
    --text-color: #334155;
    /* Ana metin */
    --text-muted: #64748b;
    /* Soluk metin */
    --border-color: #e2e8f0;
    /* Genel kenarlıklar */

    --sidebar-width: 260px;
    --header-height: 64px;
    --border-radius: 12px;
    /* Daha modern oval hatlar */
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    /* Yumuşak gölge */
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
}

/* --- LAYOUT (Düzen) --- */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--primary-color);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-size: 1.2rem;
    font-weight: 600;
    background-color: rgba(0, 0, 0, 0.15);
    color: #fff;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    list-style: none;
    padding: 10px 0;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin: 4px 12px;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 6px;
    transition: var(--transition);
}

.sidebar-nav li a .nav-icon {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.sidebar-nav li a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.sidebar-nav li a.active {
    background-color: var(--accent-color);
    color: #fff;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
    font-weight: 500;
}

.sidebar-nav li a.active .nav-icon {
    opacity: 1;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--header-height);
    background-color: var(--surface-color);
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    border-bottom: 1px solid var(--border-color);
}

.content-area {
    padding: 30px;
}

/* --- COMPONENTS (Bileşenler) --- */
.page-title {
    margin-bottom: 20px;
    color: var(--primary-color);
    font-weight: 600;
}

.grid-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
}

.card,
.glass-card,
.widget-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
}

.card-header {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.card-body {
    padding: 20px;
}

/* --- TABLES --- */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background-color: var(--bg-color);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- BADGES & BUTTONS --- */
.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.badge-secondary {
    background-color: var(--text-muted);
}

.badge-warning {
    background-color: var(--warning-color);
    color: #fff;
}

.badge-danger {
    background-color: var(--danger-color);
}

.badge-success {
    background-color: var(--success-color);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
}

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

/* Outline Butonlar */
.btn-outline-primary {
    background-color: transparent;
    color: var(--text-color);
    border-color: var(--border-color);
}

.btn-outline-primary:hover {
    background-color: var(--bg-color);
    border-color: #cbd5e1;
}

.btn-outline-danger {
    background-color: transparent;
    color: var(--danger-color);
    border-color: #fca5a5;
}

.btn-outline-danger:hover {
    background-color: #fef2f2;
    color: var(--danger-color);
}

.btn-outline-secondary {
    background-color: transparent;
    color: var(--text-muted);
    border-color: var(--border-color);
}

.btn-outline-secondary:hover {
    background-color: var(--bg-color);
    color: var(--text-color);
}

/* --- EXTRA LAYOUT & TYPOGRAPHY --- */
.page-header {
    margin-bottom: 25px;
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.font-bold {
    font-weight: 600;
}

.mb-30 {
    margin-bottom: 30px;
}

/* --- MODERN FORMS --- */
.modern-form .form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--surface-color);
    font-size: 0.95rem;
    color: var(--text-color);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* --- TREE VIEW (Dizin Ağacı) --- */
.tree-container {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 15px;
    border: 1px solid var(--border-color);
}

.tree-list {
    list-style: none;
    padding-left: 0;
}

.tree-children {
    padding-left: 25px;
    border-left: 1px dashed var(--border-color);
    margin-left: 10px;
    margin-top: 5px;
}

.tree-item {
    margin-bottom: 5px;
}

.tree-node {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 6px;
    transition: var(--transition);
    cursor: default;
}

.tree-node:hover {
    background-color: var(--bg-color);
}

.tree-name {
    font-weight: 500;
    color: var(--text-color);
}

/* --- ALERTS --- */
.alert {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-info {
    background-color: #e0f2fe;
    color: #075985;
    border: 1px solid #bae6fd;
}

/* --- SIDEBAR SECTION HEADERS --- */
.nav-section {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 1px;
    padding: 24px 20px 8px 20px;
    text-transform: uppercase;
}

/* Diğer mevcut spesifik stillerin (Modal, Timeline, Arama çubuğu vb.) aynı kalıyor,
   sadece renk kodları yukarıdaki root'tan besleneceği için modern görünecekler. */

/* --- DEV ARAMA ÇUBUĞU (HERO SEARCH) --- */
.search-container {
    margin-bottom: 25px;
    padding: 10px;
    border-radius: 50px;
    /* Tam yuvarlak hatlar */
}

.search-form {
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 40px;
    padding: 5px 10px 5px 25px;
    border: 1px solid #e1e8ed;
    transition: box-shadow 0.3s ease;
}

.search-form:focus-within {
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.15);
    border-color: var(--accent-color);
}

.search-icon {
    font-size: 1.2rem;
    color: #a0aec0;
    margin-right: 15px;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.1rem;
    padding: 15px 0;
    background: transparent;
    color: var(--text-color);
}

.search-input::placeholder {
    color: #cbd5e1;
}

.search-btn {
    border-radius: 30px;
    padding: 12px 25px;
    font-size: 1rem;
}

.btn-clear {
    color: #a0aec0;
    text-decoration: none;
    padding: 10px;
    margin-right: 10px;
    transition: color 0.2s;
}

.btn-clear:hover {
    color: var(--danger-color);
}

.search-results-info {
    margin-bottom: 15px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* --- VANILLA PAGINATION (Laravel Bootstrap-4 yapısını ezmek için) --- */
.pagination-wrapper nav {
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 5px;
}

.page-item .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    background: white;
    border: 1px solid #dcdde1;
    border-radius: 6px;
    color: var(--secondary-color);
    text-decoration: none;
    transition: all 0.2s;
}

.page-item .page-link:hover {
    background: #f1f2f6;
    border-color: #cbd5e1;
}

.page-item.active .page-link {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.page-item.disabled .page-link {
    color: #ccc;
    pointer-events: none;
    background: #fafafa;
}

/* --- SMART VERTICAL TABS STYLES --- */
.sidebar-section-title {
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--text-muted);
    padding: 0 20px 10px;
    margin-top: 10px;
    letter-spacing: 1px;
}

.vertical-tabs .tab-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    font-weight: 500;
    color: var(--secondary-color);
    cursor: pointer;
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.02);
}

.vertical-tabs .tab-item .tab-icon {
    margin-right: 12px;
    font-size: 1.1rem;
    opacity: 0.7;
}

.vertical-tabs .tab-item:hover {
    background: #f8fafc;
}

.vertical-tabs .tab-item.active {
    background: #f0fdfa;
    /* Soft mint green / blueish */
    border-left-color: var(--accent-color);
    color: var(--accent-color);
}

.vertical-tabs .tab-item.active .tab-icon {
    opacity: 1;
}

/* Tab Pane Transitions */
.doc-tab-content {
    position: relative;
    overflow: hidden;
}

.tab-pane {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* Meta Data Grid (Tab 2) */
.metadata-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.meta-box {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.meta-box label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.meta-box .meta-value {
    font-size: 1.1rem;
    color: var(--secondary-color);
}

/* Workflow Visual Nodes (Tab 4) */
.workflow-visual {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.workflow-node {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    border-left: 5px solid #ccc;
}

.workflow-node.approved {
    border-left-color: var(--success-color);
    background: #f0fdf4;
}

.workflow-node.rejected {
    border-left-color: var(--danger-color);
    background: #fef2f2;
}

.workflow-node.pending {
    border-left-color: var(--warning-color);
    background: #fffbeb;
}

.node-step {
    font-weight: bold;
    margin-right: 20px;
    color: var(--text-muted);
    min-width: 60px;
}

.node-user {
    flex: 1;
    font-weight: 500;
}

.node-status {
    font-weight: bold;
    margin-right: 20px;
}

.node-comment {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

.unsupported-preview-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    background: #f8fafc;
    border: 2px dashed #e2e8f0;
    border-radius: 12px;
    text-align: center;
}

.unsupported-preview-box .icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.unsupported-preview-box h3 {
    color: var(--secondary-color);
    margin-bottom: 8px;
}

/* --- FORM ERROR TEXT --- */
.form-error-text {
    color: var(--danger-color);
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 5px;
    animation: fadeIn 0.3s ease;
}

.mt-15 {
    margin-top: 15px;
}

/* --- DOCUMENT INFO METADATA GRID --- */
.metadata-wrapper {
    background: #fff;
    border-radius: var(--border-radius);
}

.metadata-section-title {
    font-size: 1.05rem;
    color: var(--primary-color);
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-weight: 600;
}

.metadata-grid-2col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 15px;
}

.meta-item {
    background: #f8fafc;
    padding: 14px 18px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.meta-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.meta-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.meta-value {
    font-size: 0.95rem;
    color: var(--secondary-color);
    font-weight: 600;
    text-align: right;
    max-width: 60%;
    word-break: break-word;
}

/* --- REVISION TIMELINE --- */
.revision-timeline {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.version-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px 20px;
    transition: all 0.3s;
    border-left: 4px solid #cbd5e1;
}

.version-card.current-version {
    border-left-color: var(--success-color);
    background: #f0fdf4;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.v-badge {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--secondary-color);
    margin-right: 10px;
}

.revision-note {
    background: #fff;
    border: 1px dashed #cbd5e1;
    padding: 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #475569;
}

.revision-note strong {
    color: var(--warning-color);
    display: block;
    margin-bottom: 5px;
}

.empty-note {
    background: transparent;
    border: none;
    padding: 0;
    color: #94a3b8;
}

/* --- 3D MATRIX TABS & CHECKBOXES --- */
.matrix-container {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.matrix-tabs {
    display: flex;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
}

.matrix-tab {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.matrix-tab:hover {
    background: #e2e8f0;
    color: var(--secondary-color);
}

.matrix-tab.active {
    background: #fff;
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.matrix-content {
    display: none;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

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

.matrix-table th {
    background: #f8fafc;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Pure CSS Custom Checkbox */
.custom-checkbox {
    display: inline-block;
    position: relative;
    padding-left: 25px;
    cursor: pointer;
    font-size: 1rem;
    user-select: none;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: -5px;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: #e2e8f0;
    border-radius: 4px;
    transition: all 0.2s;
}

.custom-checkbox:hover input~.checkmark {
    background-color: #cbd5e1;
}

.custom-checkbox input:checked~.checkmark {
    background-color: var(--primary-color);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-checkbox input:checked~.checkmark:after {
    display: block;
}

/* --- PULSE ANIMATION (ACİL DİKKAT ÇEKİCİ) --- */
@keyframes pulseGlow {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

.pulse-animation {
    animation: pulseGlow 2s infinite;
}

/* --- FILE EXPLORER (GOOGLE DRIVE STYLE) --- */
.explorer-breadcrumb {
    align-items: center;
    border-radius: 8px;
    padding: 15px 20px;
}

.breadcrumb-path {
    font-size: 1.1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.crumb-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.crumb-link:hover {
    color: var(--primary-color);
}

.crumb-separator {
    margin: 0 10px;
    color: #cbd5e1;
    font-size: 1.2rem;
}

.crumb-current {
    color: var(--text-color);
    font-weight: 700;
}

.explorer-section-title {
    font-size: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 5px;
}

.explorer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.explorer-item {
    display: flex;
    align-items: center;
    padding: 15px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.explorer-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    border-color: #cbd5e1;
}

.item-icon {
    font-size: 2.5rem;
    margin-right: 15px;
    line-height: 1;
}

.item-details {
    flex: 1;
    overflow: hidden;
}

.item-name {
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.item-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.folder-item {
    background: #f8fafc;
    border-left: 4px solid #94a3b8;
}

.folder-item:hover {
    border-left-color: var(--primary-color);
    background: #f1f5f9;
}

.document-item {
    background: #fff;
    border-top: 3px solid transparent;
}

.document-item:hover {
    border-top-color: var(--secondary-color);
}

.item-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--success-color);
    color: #fff;
    font-size: 0.6rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Sidebar gizlendiğinde sola doğru kayarak ekran dışına çıkar */
html.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
}

/* Sidebar gizlendiğinde ana içerik ekranı kaplar */
html.sidebar-collapsed .main-content {
    margin-left: 0;
    width: 100%;
}

/* Hamburger Menü Butonu Stili */
.hamburger-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.hamburger-btn:hover {
    background: var(--bg-color);
    /* Hover efekti, kendi renk değişkenini kullan */
}
.layout-split {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
    transition: all 0.3s ease;
}

/* Sidebar kapalıyken */
.sidebar-collapsed .layout-split {
    grid-template-columns: 1fr; /* tek kolon */
}

/* Sağ kart aşağı insin */
.sidebar-collapsed .layout-split > div:last-child {
    order: 2;
}