@tailwind base;
@tailwind components;
@tailwind utilities;

/* DataTable Genel Stiller */
.dataTables_wrapper {
    padding: 1.5rem;
    font-family: inherit;
}

/* Arama ve Gösterim Sayısı */
.dataTables_length select {
    padding: 0.5rem 2rem 0.5rem 0.75rem !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 0.375rem !important;
    background-color: #fff !important;
    font-size: 0.875rem !important;
    color: #475569 !important;
    cursor: pointer !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") !important;
    background-position: right 0.5rem center !important;
    background-repeat: no-repeat !important;
    background-size: 1.5em 1.5em !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.dataTables_filter input {
    padding: 0.5rem 1rem !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 0.375rem !important;
    font-size: 0.875rem !important;
    color: #475569 !important;
    min-width: 250px !important;
}

.dataTables_filter input:focus {
    outline: none !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

/* Tablo Başlıkları ve Hücreler */
table.dataTable {
    border-collapse: collapse !important;
    width: 100% !important;
}

table.dataTable thead th {
    padding: 1rem !important;
    background-color: #f8fafc !important;
    border-bottom: 2px solid #e2e8f0 !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    font-size: 0.875rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}

table.dataTable tbody td {
    padding: 1rem !important;
    border-bottom: 1px solid #f1f5f9 !important;
    color: #475569 !important;
    font-size: 0.875rem !important;
    vertical-align: middle !important;
}

table.dataTable tbody tr:hover {
    background-color: #f8fafc !important;
}

/* Pagination Stilleri */
.dataTables_paginate {
    margin-top: 1rem !important;
    padding: 0.5rem 0 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    margin: 0 0.25rem !important;
    padding: 0.5rem 1rem !important;
    border: none !important;
    border-radius: 0.375rem !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    color: #475569 !important;
    background: transparent !important;
    transition: all 0.2s !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    color: #3b82f6 !important;
    background: #f0f9ff !important;
    transform: translateY(-1px) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: #3b82f6 !important;
    color: white !important;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    color: #cbd5e1 !important;
    cursor: not-allowed !important;
    background: transparent !important;
    transform: none !important;
}

/* Bilgi Metni */
.dataTables_info {
    padding-top: 1rem !important;
    font-size: 0.875rem !important;
    color: #64748b !important;
}

/* Loading Durumu */
.dataTables_processing {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 0.375rem !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    font-size: 0.875rem !important;
    color: #475569 !important;
    padding: 1rem !important;
}

@layer components {
    /* Modal Styles */
    .modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1000;
    }

    .modal.show {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    .modal-content {
        background-color: #fff;
        padding: 20px;
        border-radius: 8px;
        width: 90%;
        max-width: 600px;
        max-height: 90vh;
        overflow-y: auto;
        position: relative;
    }

    .modal-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        padding-bottom: 10px;
        border-bottom: 1px solid #e5e7eb;
    }

    .modal-header h3 {
        margin: 0;
        font-size: 1.5rem;
        font-weight: 600;
        color: #1f2937;
    }

    .close-modal {
        background: none;
        border: none;
        font-size: 1.5rem;
        color: #6b7280;
        cursor: pointer;
        padding: 5px;
    }

    .close-modal:hover {
        color: #1f2937;
    }

    .modal-body {
        margin-bottom: 20px;
    }

    .detail-item {
        margin-bottom: 15px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid #f3f4f6;
    }

    .detail-item strong {
        color: #4b5563;
        font-weight: 500;
    }

    .detail-item span {
        color: #1f2937;
    }

    .modal-footer {
        display: flex;
        justify-content: flex-end;
        padding-top: 15px;
        border-top: 1px solid #e5e7eb;
    }

    .modal-footer button {
        padding: 8px 16px;
        background-color: #e5e7eb;
        color: #4b5563;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        font-weight: 500;
    }

    .modal-footer button:hover {
        background-color: #d1d5db;
    }

    /* Select2 özelleştirmeleri */
    .select2-container {
        @apply w-full;
    }

    /* Kredi talepleri sayfası için özel Select2 stilleri */
    .credit-filter + .select2-container .select2-selection--single {
        height: 42px !important;
    }

    .credit-filter + .select2-container .select2-selection--single .select2-selection__rendered {
        line-height: 40px !important;
        padding-left: 12px !important;
    }

    .credit-filter + .select2-container .select2-selection--single .select2-selection__arrow {
        height: 40px !important;
    }

    .select2-container .select2-selection--single {
        @apply h-[38px] border-gray-300 rounded-md;
    }

    .select2-container--default .select2-selection--single .select2-selection__rendered {
        @apply leading-[36px] pl-3;
    }

    .select2-container--default .select2-selection--single .select2-selection__arrow {
        @apply h-[36px];
    }

    .select2-dropdown {
        @apply border-gray-300 rounded-md;
    }

    .select2-search__field {
        @apply rounded-md p-2;
    }

    .select2-results__option {
        @apply p-2;
    }

    .select2-container--default .select2-results__option--highlighted[aria-selected] {
        @apply bg-blue-600;
    }

    /* Buton Stilleri */
    .btn {
        @apply inline-flex items-center px-4 py-2 border text-sm font-medium rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 transition-colors duration-200;
    }

    .btn-sm {
        @apply px-3 py-1.5 text-sm rounded-md;
    }

    .btn-lg {
        @apply px-6 py-3 text-base rounded-lg;
    }

    .btn-primary {
        @apply bg-blue-600 text-white border-transparent hover:bg-blue-700 focus:ring-blue-500;
    }

    .btn-secondary {
        @apply bg-white text-gray-700 border-gray-300 hover:bg-gray-50 focus:ring-blue-500;
    }

    .btn-success {
        @apply bg-green-600 text-white border-transparent hover:bg-green-700 focus:ring-green-500;
    }

    .btn-danger {
        @apply bg-red-600 text-white border-transparent hover:bg-red-700 focus:ring-red-500;
    }

    /* Form Elemanları */
    .form-input {
        @apply mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50;
    }

    .form-label {
        @apply block text-sm font-medium text-gray-700;
    }

    /* Form Stilleri */
    .form-input {
        @apply mt-1 block w-full rounded-md border-secondary-300 shadow-sm focus:border-primary-500 focus:ring-primary-500;
    }

    .form-label {
        @apply block text-sm font-medium text-secondary-700;
    }

    /* DataTable Stilleri */
    .dataTables_wrapper {
        @apply p-4;
    }

    .dataTables_filter input {
        @apply border border-gray-300 rounded-md shadow-sm px-3 py-2 focus:ring-2 focus:ring-primary-500 focus:border-primary-500 text-sm;
    }

    .dataTables_length select {
        @apply border border-gray-300 rounded-md shadow-sm px-3 py-2 focus:ring-2 focus:ring-primary-500 focus:border-primary-500 text-sm;
    }

    table.dataTable thead th {
        @apply bg-secondary-50 text-secondary-700 text-sm font-medium py-3 px-6 border-b border-secondary-200;
    }

    table.dataTable tbody td {
        @apply text-secondary-600 text-sm py-3 px-6 border-b border-secondary-100;
    }

    table.dataTable tbody tr:hover {
        @apply bg-secondary-50;
    }

    .dataTables_info {
        @apply text-sm text-secondary-600;
    }

    /* Responsive Tasarım */
    @media (max-width: 640px) {
        .dataTables_wrapper {
            @apply p-2;
        }
        
        .dataTables_filter input {
            @apply min-w-[150px];
        }
        
        .dataTables_length,
        .dataTables_filter {
            @apply float-none text-left mb-4;
        }
        
        .dataTables_info,
        .dataTables_paginate {
            @apply float-none text-center mt-4;
        }
    }

    /* Login sayfası stilleri */
    .login-container {
        background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.13) 100%);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(255,255,255,0.18);
    }

    .login-logo img {
        width: 200px !important;
        max-width: 200px !important;
        height: auto !important;
        margin: 0 auto;
        display: block;
    }

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

    .fade-in {
        animation: fadeIn 0.5s ease-out;
    }

    /* Sidebar stilleri */
    .sidebar-menu-item {
        @apply flex items-center px-3 py-2 text-sm font-medium rounded-md transition-all duration-200;
    }

    .sidebar-menu-item:hover {
        @apply bg-gray-50 text-blue-600;
    }

    .sidebar-menu-item.active {
        @apply bg-blue-50 text-blue-600;
    }

    .sidebar-menu-item svg {
        @apply mr-3 h-5 w-5 transition-colors duration-200;
    }

    /* Alert stilleri */
    .alert {
        border-radius: 0.375rem;
        padding: 1rem;
        margin-bottom: 1rem;
        border-left-width: 4px;
    }

    .alert-error {
        background-color: #FEE2E2;
        border-color: #EF4444;
        color: #991B1B;
    }

    .alert-success {
        background-color: #DCFCE7;
        border-color: #22C55E;
        color: #166534;
    }

    /* İçerik alanı stilleri */
    .content-wrapper {
        @apply bg-white rounded-lg shadow-sm p-6;
    }

    .page-title {
        @apply text-2xl font-bold text-gray-900 mb-6;
    }

    /* Tablo stilleri */
    .table-container {
        @apply overflow-x-auto rounded-lg border border-gray-200;
    }

    .data-table {
        @apply min-w-full divide-y divide-gray-200;
    }

    .data-table th {
        @apply px-6 py-3 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider;
    }

    .data-table td {
        @apply px-6 py-4 whitespace-nowrap text-sm text-gray-900;
    }

    .data-table tr {
        @apply hover:bg-gray-50;
    }

    /* Login sayfası stilleri */
    .login-container {
        background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.13) 100%);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(255,255,255,0.18);
    }

    .input-field {
        transition: all 0.3s ease;
    }

    .input-field:focus {
        transform: translateY(-2px);
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    }

    /* Modal Ortalama */
    .modal-dialog {
        margin: 0;
        display: flex;
        align-items: center;
        min-height: calc(100% - 1rem);
        width: 100%;
        max-width: 500px;
    }

    @media (min-width: 576px) {
        .modal-dialog {
            min-height: calc(100% - 3.5rem);
        }
    }

    .modal.fade .modal-dialog {
        transform: translate(0, -50px);
    }

    .modal.show .modal-dialog {
        transform: none;
    }
} 