/* ==========================================================================
   KOMİTE SORGULAMA SİSTEMİ - KURUMSAL TEMA (Siyah / Beyaz / Gri)
   ========================================================================== */

:root {
    --bg-main: #f8f9fa;
    --bg-card: #ffffff;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;
    --border-color: #d1d5db;
    --border-light: #e5e7eb;
    --primary-black: #111111;
    --hover-black: #262626;
    --table-header-bg: #1f2937;
    --table-header-text: #ffffff;
    --table-zebra: #f9fafb;
    --table-hover: #f3f4f6;
    --focus-ring: rgba(0, 0, 0, 0.2);
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Container */
.container {
    width: 100%;
    max-width: 1320px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Header */
.app-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.logo-wrapper,
.header-title-wrapper {
    display: flex;
    align-items: center;
    margin: 0;
}

.header-brand-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #111827;
    text-decoration: none;
    letter-spacing: -0.025em;
    display: inline-block;
    transition: color 0.15s ease-in-out;
}

.header-brand-title:hover {
    color: #374151;
}

.user-header-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-badge-info {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background-color: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #1f2937;
    font-weight: 500;
}

.user-badge-icon {
    display: flex;
    align-items: center;
    color: #6b7280;
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #dc2626;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background-color: #fef2f2;
    border-color: #fca5a5;
    color: #b91c1c;
}

.app-logo {
    max-height: 68px;
    width: auto;
    object-fit: contain;
    display: inline-block;
}

.app-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--primary-black);
    margin: 0;
}

.app-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    font-weight: 500;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* Card Container */
.search-container-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}

/* Tabs */
.tab-group {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    user-select: none;
    white-space: nowrap;
}

.tab-btn.active {
    background-color: var(--primary-black);
    color: #ffffff;
    border: 1px solid var(--primary-black);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.tab-btn:not(.active) {
    background-color: #ffffff;
    color: #374151;
    border: 1px solid var(--border-color);
}

.tab-btn:not(.active):hover {
    background-color: #f3f4f6;
    color: var(--primary-black);
    border-color: #9ca3af;
}

/* Search Box */
.search-form-wrapper {
    max-width: 750px;
    margin: 0 auto 1.5rem auto;
}

.search-input-group {
    display: flex;
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input-group:focus-within {
    border-color: var(--primary-black);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

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

.search-input::placeholder {
    color: #9ca3af;
}

.btn-search {
    background-color: var(--primary-black);
    color: #ffffff;
    border: none;
    padding: 0 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.15s ease;
    border-top-right-radius: 3px;
    border-bottom-right-radius: 3px;
}

.btn-search:hover {
    background-color: var(--hover-black);
}

.btn-clear-search {
    background: none;
    border: none;
    padding: 0 0.75rem;
    color: #9ca3af;
    cursor: pointer;
    font-size: 1.1rem;
    display: none;
}

.btn-clear-search:hover {
    color: var(--primary-black);
}

/* Controls Bar (Results info & Page size) */
.results-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.results-count-badge {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.results-count-badge span {
    font-weight: 700;
    color: var(--primary-black);
}

.page-size-selector {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.page-size-selector select {
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    background-color: #ffffff;
    font-size: 0.875rem;
    color: var(--text-primary);
    outline: none;
    cursor: pointer;
}

.page-size-selector select:focus {
    border-color: var(--primary-black);
}

/* Results Table */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: #ffffff;
    margin-bottom: 1.25rem;
    position: relative;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    text-align: left;
    white-space: normal;
}

.data-table thead th {
    background-color: var(--table-header-bg);
    color: var(--table-header-text);
    padding: 0.75rem 0.85rem;
    font-weight: 600;
    font-size: 0.825rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-right: 1px solid #374151;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
    overflow: visible;
}

.data-table thead th:last-child {
    border-right: none;
}

.data-table thead th.sortable {
    cursor: pointer;
    user-select: none;
}

.data-table thead th.sortable:hover {
    background-color: #374151;
}

.data-table thead th .sort-icon {
    display: inline-block;
    margin-left: 0.35rem;
    opacity: 0.7;
    font-size: 0.75rem;
}

.data-table tbody td {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--border-light);
    border-right: 1px solid var(--border-light);
    color: var(--text-primary);
    vertical-align: middle;
}

.data-table tbody td:last-child {
    border-right: none;
}

.data-table tbody tr:nth-child(even) {
    background-color: var(--table-zebra);
}

.data-table tbody tr:hover {
    background-color: var(--table-hover);
}

.data-table .cell-sicil {
    font-weight: 700;
    font-family: Consolas, "Courier New", monospace;
    white-space: nowrap;
    color: #111827;
}

.data-table .cell-unvan {
    font-weight: 500;
    min-width: 260px;
    max-width: 480px;
    word-break: break-word;
}

.data-table .cell-adres {
    min-width: 260px;
    max-width: 450px;
    word-break: break-word;
    font-size: 0.825rem;
    color: #4b5563;
}

.data-table .cell-nowrap {
    white-space: nowrap;
}

/* Custom Text Colors */
.data-table .cell-bordo {
    color: #881337 !important; /* Bordo / Burgundy */
    font-weight: 600;
}

.data-table .cell-mavi {
    color: #1d4ed8 !important; /* Mavi / Blue */
    font-weight: 600;
}

/* Excel-like Header Filter Button and Popovers */
.th-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    width: 100%;
    position: relative;
}

.th-title {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    flex: 1;
    white-space: nowrap;
    user-select: none;
}

.th-title:hover {
    color: #93c5fd;
}

.filter-popover-container {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.btn-filter-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background-color: rgba(255, 255, 255, 0.1);
    color: #9ca3af;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-filter-toggle:hover {
    background-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
}

.btn-filter-toggle.has-filter {
    background-color: #2563eb !important;
    color: #ffffff !important;
    border-color: #1d4ed8 !important;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
}

.filter-popover-menu {
    position: fixed;
    min-width: 220px;
    max-width: 300px;
    background: #ffffff;
    color: #111827;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 99999;
    display: none;
    flex-direction: column;
    text-align: left;
    font-size: 0.85rem;
    overflow: hidden;
}

.filter-popover-menu.open {
    display: flex;
}

.filter-popover-header {
    padding: 0.6rem 0.75rem;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background-color: #f1f5f9;
    color: #334155;
    border-bottom: 1px solid #e2e8f0;
}

.filter-search-box {
    padding: 0.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.filter-popover-search {
    width: 100%;
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    outline: none;
}

.filter-popover-search:focus {
    border-color: #2563eb;
}

.filter-popover-list {
    max-height: 220px;
    overflow-y: auto;
    padding: 0.25rem 0;
}

.filter-popover-item {
    padding: 0.45rem 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.1s ease;
    font-size: 0.825rem;
    color: #1e293b;
    white-space: normal;
    word-break: break-word;
    user-select: none;
}

.filter-popover-item:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.filter-popover-item.checked {
    background-color: #eff6ff;
    color: #1d4ed8;
    font-weight: 600;
}

/* Checkbox icon inside each item */
.filter-cb-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    min-width: 16px;
    border: 2px solid #cbd5e1;
    border-radius: 3px;
    background-color: #ffffff;
    transition: all 0.12s ease;
}

.filter-popover-item.checked .filter-cb-icon {
    background-color: #2563eb;
    border-color: #2563eb;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2 6l3 3 5-5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 10px;
}

/* Filter count badge on toggle button */
.filter-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    font-size: 0.65rem;
    font-weight: 700;
    color: #ffffff;
    background-color: #dc2626;
    border-radius: 8px;
    line-height: 1;
    position: absolute;
    top: -5px;
    right: -5px;
}

/* Popover footer with Apply / Clear buttons */
.filter-popover-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.65rem;
    border-top: 1px solid #e2e8f0;
    background-color: #f8fafc;
}

.btn-filter-apply {
    flex: 1;
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: #ffffff;
    background-color: #2563eb;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.btn-filter-apply:hover {
    background-color: #1d4ed8;
}

.btn-filter-clear-col {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-filter-clear-col:hover {
    color: #dc2626;
    border-color: #fca5a5;
    background-color: #fef2f2;
}

.btn-reset-filters {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #991b1b;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.btn-reset-filters:hover {
    background-color: #fee2e2;
    border-color: #fca5a5;
}

/* Pagination */
.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

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

.pagination {
    display: inline-flex;
    list-style: none;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.pagination li {
    display: inline;
}

.pagination li a,
.pagination li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 36px;
    padding: 0 0.6rem;
    border-right: 1px solid var(--border-color);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    background-color: #ffffff;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.pagination li:last-child a,
.pagination li:last-child span {
    border-right: none;
}

.pagination li.active span {
    background-color: var(--primary-black);
    color: #ffffff;
    font-weight: 700;
    cursor: default;
}

.pagination li.disabled span {
    color: #9ca3af;
    background-color: #f9fafb;
    cursor: not-allowed;
}

.pagination li a:hover:not(.disabled) {
    background-color: #f3f4f6;
}

/* Status / Alert Messages */
.alert-box {
    padding: 1rem 1.25rem;
    border-radius: 4px;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-box.alert-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert-box.alert-info {
    background-color: #f3f4f6;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    text-align: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
}

.alert-box.alert-warning {
    background-color: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.empty-state-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
    color: #9ca3af;
}

/* Loading Overlay */
.loading-overlay {
    position: relative;
    min-height: 200px;
}

.loading-spinner-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid var(--primary-black);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Footer */
.app-footer {
    background-color: #ffffff;
    border-top: 1px solid var(--border-color);
    padding: 1.25rem 0;
    text-align: center;
    font-size: 0.825rem;
    color: var(--text-muted);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .search-container-card {
        padding: 1rem;
    }

    .tab-group {
        flex-direction: column;
    }

    .tab-btn {
        width: 100%;
        padding: 0.65rem 1rem;
    }

    .search-input-group {
        flex-direction: column;
    }

    .btn-search {
        width: 100%;
        padding: 0.75rem 1rem;
        justify-content: center;
        border-radius: 0 0 3px 3px;
    }

    .results-header-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .pagination-wrapper {
        flex-direction: column;
        align-items: center;
    }
}
