/**
 * Ana CSS Dosyası
 */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
}

html {
    scrollbar-gutter: stable both-edges;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #212529;
    background-color: #f8f9fa;
    overscroll-behavior-y: none;
}

body,
button,
input,
select,
textarea,
.sidebar-modern,
.sidebar {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
}

p,
li,
span,
a,
td,
th {
    font-size: 14px;
    line-height: 1.6;
}

small,
.text-muted {
    font-size: 12px;
}

h1, h2, h3, h4, h5, h6,
.section-title,
.card-title {
    font-weight: 500;
    color: #212529;
    line-height: 1.3;
}

.fw-medium {
    font-weight: 600;
}

code,
pre,
.text-code,
.reference-code {
    font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', monospace;
    font-size: 13px;
    color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
}

.reference-highlight,
.text-reference,
.badge-reference {
    color: var(--primary-color);
    font-weight: 600;
}

body.modal-open {
    overflow: hidden !important;
    padding-right: 0 !important;
    overscroll-behavior: contain;
}

.modal {
    overscroll-behavior: contain;
}

/* Modern Compact Sidebar */
.sidebar-modern {
    position: fixed;
    left: 0;
    top: 56px;
    width: 250px;
    height: calc(100vh - 56px);
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: width 0.3s ease;
    z-index: 1000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar-modern.collapsed {
    width: 70px;
}

/* Sidebar'ı içeren col-md-3'ü gizle ve sidebar'ı fixed yap */
.col-md-3 .sidebar-modern {
    position: fixed;
    left: 0;
}

/* col-md-3 içindeki sidebar-modern varsa col-md-3'ü daralt */
.col-md-3:has(.sidebar-modern) {
    width: 0 !important;
    max-width: 0 !important;
    padding: 0 !important;
    flex: 0 !important;
}

.sidebar-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.sidebar-toggle:hover {
    background: #0b5ed7;
    transform: scale(1.1);
}

.sidebar-modern.collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

.sidebar-header {
    padding: 20px 15px;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.sidebar-modern.collapsed .sidebar-header {
    padding: 20px 10px;
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.sidebar-modern.collapsed .sidebar-user-info {
    justify-content: center;
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, #0b5ed7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
}

.sidebar-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.sidebar-user-details {
    flex: 1;
    min-width: 0;
    transition: all 0.3s ease;
    overflow: hidden;
}

.sidebar-modern.collapsed .sidebar-user-details {
    opacity: 0;
    width: 0;
    height: 0;
    overflow: hidden;
}

.sidebar-user-name {
    font-size: 14px;
    font-weight: 600;
    color: #212529;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 12px;
    color: #6c757d;
    display: block;
    margin-top: 2px;
}

.sidebar-menu {
    list-style: none;
    padding: 10px 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-menu::-webkit-scrollbar {
    width: 4px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 2px;
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

.sidebar-menu li {
    margin-bottom: 5px;
    padding: 0 10px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: #495057;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
}

.sidebar-menu a:hover {
    background: linear-gradient(90deg, rgba(13, 110, 253, 0.1) 0%, rgba(13, 110, 253, 0.05) 100%);
    color: var(--primary-color);
    transform: translateX(5px);
}

.sidebar-modern.collapsed .sidebar-menu a:hover {
    transform: translateX(0);
}

.sidebar-menu a.active {
    background: linear-gradient(90deg, var(--primary-color) 0%, #0b5ed7 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
}

.sidebar-menu a i {
    width: 24px;
    font-size: 18px;
    text-align: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.sidebar-modern.collapsed .sidebar-menu a i {
    margin: 0;
}

.menu-text {
    margin-left: 12px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    opacity: 1;
    white-space: nowrap;
}

.sidebar-modern.collapsed .menu-text {
    opacity: 0;
    width: 0;
    margin: 0;
    overflow: hidden;
}

/* Eski sidebar stilleri (geriye dönük uyumluluk için) */
.sidebar {
    background-color: #fff;
    min-height: calc(100vh - 56px);
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    margin-top: 0;
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    overflow-y: auto;
}

.container-fluid {
    margin-top: 0;
    padding-top: 20px;
}

/* Sidebar'ın container dışında görünmesini engelle */
body > .sidebar {
    display: none !important;
}

.main-content {
    padding: 20px;
    transition: margin-left 0.3s ease;
}

/* Sidebar varsa main-content'e margin ekle (JavaScript ile body'ye class eklenecek) */
body.has-sidebar .main-content {
    margin-left: 250px;
}

/* Sidebar collapsed durumunda main-content ayarı */
body.sidebar-collapsed .main-content {
    margin-left: 70px;
}

/* Modal açıkken geçici animasyonları kapat (titremeyi engelle) */
body.modal-open .main-content,
body.modal-open .sidebar-modern {
    transition: none !important;
}

.modal-dialog {
    max-width: 95vw;
    margin: 1.75rem auto;
}

.modal-dialog.modal-xl {
    max-width: min(1140px, 95vw);
}

.modal-dialog.modal-lg {
    max-width: min(900px, 95vw);
}

.modal-dialog.modal-dialog-centered {
    min-height: calc(100vh - 3.5rem);
}

.modal-content {
    max-height: calc(100vh - 3.5rem);
    overflow-y: auto;
}

.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

/* Eski card-header ve btn-primary stilleri modern stillerle değiştirildi */

.table-responsive {
    border-radius: 5px;
    overflow: hidden;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.03);
}

.table-responsive::-webkit-scrollbar {
    height: 6px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 3px;
}

.table {
    margin-bottom: 0;
}

.table th,
.table td {
    vertical-align: middle;
}

.badge {
    padding: 5px 10px;
    border-radius: 3px;
}

/* Modern Form Elements */
.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    font-size: 14px;
    display: block;
}

.form-control,
.form-select {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: #fff;
    color: #495057;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
    outline: none;
    background-color: #fff;
}

.form-control:hover:not(:disabled):not(:focus),
.form-select:hover:not(:disabled):not(:focus) {
    border-color: #ced4da;
}

.form-control:disabled,
.form-select:disabled {
    background-color: #f8f9fa;
    cursor: not-allowed;
    opacity: 0.6;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Input Groups */
.input-group .form-control,
.input-group .form-select {
    border-radius: 8px;
}

.input-group > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group > :not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* Form Check */
.form-check-input {
    width: 20px;
    height: 20px;
    border: 2px solid #ced4da;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-check-label {
    margin-left: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #495057;
}

/* Form Switch */
.form-check-input[type="checkbox"]:checked {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e");
}

.form-switch .form-check-input {
    width: 40px;
    height: 22px;
    border-radius: 11px;
    background-color: #ced4da;
    border: none;
    transition: all 0.3s ease;
}

.form-switch .form-check-input:checked {
    background-color: var(--primary-color);
}

/* Form Select */
.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 12px;
    padding-right: 40px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* File Input */
.form-control[type="file"] {
    padding: 8px;
    cursor: pointer;
}

.form-control[type="file"]::-webkit-file-upload-button {
    padding: 8px 16px;
    margin-right: 12px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #0b5ed7 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.form-control[type="file"]::-webkit-file-upload-button:hover {
    background: linear-gradient(135deg, #0b5ed7 0%, #0a58ca 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(13, 110, 253, 0.3);
}

/* Invalid/Valid States */
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--danger-color);
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.15);
}

.form-control.is-valid,
.form-select.is-valid {
    border-color: var(--success-color);
}

.form-control.is-valid:focus,
.form-select.is-valid:focus {
    border-color: var(--success-color);
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.15);
}

.invalid-feedback,
.valid-feedback {
    font-size: 13px;
    margin-top: 5px;
    display: block;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

/* Modern Buttons */
.btn {
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0b5ed7 100%);
    border-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0b5ed7 0%, #0a58ca 100%);
    border-color: #0a58ca;
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #5a6268 100%);
    border-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #545b62 100%);
    border-color: #545b62;
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #157347 100%);
    border-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #157347 0%, #146c43 100%);
    border-color: #146c43;
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #bb2d3b 100%);
    border-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #bb2d3b 0%, #b02a37 100%);
    border-color: #b02a37;
    color: white;
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0b5ed7 100%);
    color: white;
    border-color: var(--primary-color);
}

/* Card Modernization */
.card {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

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

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0b5ed7 100%);
    color: white;
    font-weight: 600;
    padding: 15px 20px;
    border-bottom: none;
}

.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5,
.card-header h6,
.card-header .card-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.card.bg-primary,
.card.bg-success,
.card.bg-info,
.card.bg-warning,
.card.bg-danger,
.card.bg-secondary,
.card.bg-dark {
    color: #fff;
}

.card.bg-primary .card-body h1,
.card.bg-primary .card-body h2,
.card.bg-primary .card-body h3,
.card.bg-success .card-body h1,
.card.bg-success .card-body h2,
.card.bg-success .card-body h3,
.card.bg-info .card-body h1,
.card.bg-info .card-body h2,
.card.bg-info .card-body h3,
.card.bg-warning .card-body h1,
.card.bg-warning .card-body h2,
.card.bg-warning .card-body h3,
.card.bg-danger .card-body h1,
.card.bg-danger .card-body h2,
.card.bg-danger .card-body h3,
.card.bg-secondary .card-body h1,
.card.bg-secondary .card-body h2,
.card.bg-secondary .card-body h3,
.card.bg-dark .card-body h1,
.card.bg-dark .card-body h2,
.card.bg-dark .card-body h3 {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.card.bg-primary .card-body p,
.card.bg-success .card-body p,
.card.bg-info .card-body p,
.card.bg-warning .card-body p,
.card.bg-danger .card-body p,
.card.bg-secondary .card-body p,
.card.bg-dark .card-body p {
    color: rgba(255, 255, 255, 0.9);
}

.card-body {
    padding: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        min-height: auto;
    }
    
    .form-control,
    .form-select {
        font-size: 16px; /* iOS zoom önleme */
    }
    
    .main-content {
        padding: 15px;
    }
    
    .table-responsive {
        overflow-x: auto;
        border-radius: 10px;
        margin-bottom: 20px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    }
    
    .table-responsive table {
        min-width: 600px;
    }
    
    .table {
        font-size: 13px;
    }
    
    .table th,
    .table td {
        padding: 10px;
        white-space: normal;
        word-break: break-word;
    }
    
    .table td .btn,
    .table th .btn {
        padding: 6px 10px;
        font-size: 12px;
        border-width: 1px;
    }
    
    .table td .badge,
    .table th .badge {
        font-size: 11px;
        padding: 4px 8px;
    }
}

/* Aktivasyon Kodu Stilleri */
.activation-code-box {
    transition: all 0.3s ease;
}

.activation-code-box:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #0d6efd !important;
}

.activation-code-text {
    user-select: all;
    -webkit-user-select: all;
    -moz-user-select: all;
    -ms-user-select: all;
    cursor: text;
    display: block;
    padding: 8px;
    background: white;
    border-radius: 4px;
    border: 1px dashed #0d6efd;
}

.activation-flow {
    animation: fadeIn 0.3s ease-in;
}

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

