/* 
 * Frontend CSS - Birikim Teklif Takip Sistemi
 * Mavi tonlarında modern ve kullanıcı dostu tasarım
 */

/* Reset ve temel stil tanımları */
.btts-blank-page * {
    box-sizing: border-box;
}

.btts-blank-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #1e293b;
    background: #f8fafc;
    margin: 0;
    padding: 0;
}

/* Ana sayfalar için genel layout */
.btts-tablo-ayarlari-page,
.btts-yetki-kontrol-page,
.btts-teklif-takip-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

/* Header stil tanımları */
.btts-page-header {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
    padding: 2rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.btts-header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.btts-header-logo {
    max-height: 60px;
    filter: brightness(0) invert(1);
}

.btts-header-text {
    flex-grow: 1;
}

.btts-header-text h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btts-user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1rem;
    opacity: 0.9;
}

.btts-logout-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btts-logout-link:hover {
    background: rgba(255, 255, 255, 0.3);
    text-decoration: none;
    color: white;
}

/* Content wrapper */
.btts-content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem 2rem 2rem;
}

/* Card stil tanımları */
.btts-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    margin-bottom: 2rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btts-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.btts-card h2 {
    background: linear-gradient(135deg, #e0f2fe 0%, #b3e5fc 100%);
    color: #0f172a;
    margin: 0;
    padding: 1.5rem 2rem;
    font-size: 1.5rem;
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
}

.btts-card h3 {
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
}

.btts-card p {
    color: #64748b;
    margin: 0 0 1.5rem 0;
    padding: 0 2rem;
    line-height: 1.7;
}

.btts-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #e0f2fe 0%, #b3e5fc 100%);
    border-bottom: 1px solid #e2e8f0;
}

.btts-card-header h3 {
    margin: 0;
    color: #0f172a;
}

/* Button stil tanımları */
.btts-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    line-height: 1;
}

.btts-btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.btts-btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

.btts-btn-secondary {
    background: white;
    color: #64748b;
    border: 2px solid #e2e8f0;
}

.btts-btn-secondary:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
    text-decoration: none;
}

.btts-btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.btts-btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

.btts-btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.btts-btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

.btts-btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btts-btn-icon {
    background: none;
    border: none;
    color: #64748b;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btts-btn-icon:hover {
    background: #f1f5f9;
    color: #3b82f6;
}

/* İkon stil tanımları */
.btts-icon-plus::before { content: "➕"; }
.btts-icon-edit::before { content: "✏️"; }
.btts-icon-trash::before { content: "🗑️"; }
.btts-icon-save::before { content: "💾"; }
.btts-icon-download::before { content: "⬇️"; }
.btts-icon-search::before { content: "🔍"; }
.btts-icon-sort::before { content: "↕️"; }
.btts-icon-drag::before { content: "≡"; }

/* Login form stil tanımları */
.btts-login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
}

.btts-login-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    padding: 3rem;
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.btts-login-header {
    margin-bottom: 2rem;
}

.btts-login-logo {
    max-height: 80px;
    margin-bottom: 1.5rem;
}

.btts-login-header h2 {
    color: #1e293b;
    margin: 0 0 0.5rem 0;
    font-size: 1.75rem;
    font-weight: 600;
}

.btts-login-header p {
    color: #64748b;
    margin: 0;
}

.btts-login-form {
    text-align: left;
}

.btts-login-links {
    text-align: center;
    margin-top: 1.5rem;
}

.btts-login-links a {
    color: #3b82f6;
    text-decoration: none;
    font-size: 0.9rem;
}

.btts-login-links a:hover {
    text-decoration: underline;
}

/* Form elementi stil tanımları */
.btts-form-group {
    margin-bottom: 1.5rem;
}

.btts-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #374151;
    font-weight: 500;
}

.btts-form-group input,
.btts-form-group select,
.btts-form-group textarea {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.btts-form-group input:focus,
.btts-form-group select:focus,
.btts-form-group textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.btts-required {
    color: #ef4444;
    font-weight: bold;
}

/* Tablo stil tanımları */
.btts-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.btts-table th,
.btts-table td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

.btts-table th {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: #374151;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.btts-table tbody tr {
    transition: all 0.3s ease;
}

.btts-table tbody tr:hover {
    background: #f8fafc;
}

.btts-table-scroll {
    overflow-x: auto;
    border-radius: 12px;
}

.btts-sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.btts-sortable:hover {
    background: #e2e8f0;
}

.btts-sortable .btts-icon-sort {
    margin-left: 0.5rem;
    opacity: 0.5;
}

.btts-checkbox-column,
.btts-actions-column {
    width: 80px;
    text-align: center;
}

.btts-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

/* Tabs stil tanımları */
.btts-tabs {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.btts-tab-nav {
    display: flex;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
}

.btts-tab-button {
    flex: 1;
    padding: 1rem 2rem;
    background: none;
    border: none;
    color: #64748b;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.btts-tab-button:hover {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.btts-tab-button.active {
    color: #3b82f6;
    background: white;
    font-weight: 600;
}

.btts-tab-button.active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.btts-tab-content {
    padding: 2rem;
}

.btts-tab-panel {
    display: none;
}

.btts-tab-panel.active {
    display: block;
}

/* Grid layout stil tanımları */
.btts-roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
}

.btts-role-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.btts-role-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.btts-role-card h4 {
    color: #1e293b;
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.btts-role-card p {
    color: #64748b;
    margin: 0 0 1rem 0;
    padding: 0;
    font-size: 0.9rem;
}

.btts-role-permissions {
    margin-bottom: 1.5rem;
}

.btts-permission-badge {
    display: inline-block;
    background: #dbeafe;
    color: #1e40af;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin: 0 0.5rem 0.5rem 0;
}

.btts-role-actions {
    display: flex;
    gap: 0.5rem;
}

/* Toolbar stil tanımları */
.btts-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.btts-toolbar-left,
.btts-toolbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.btts-search-box {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btts-search-box:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btts-search-box input {
    background: none;
    border: none;
    padding: 0.75rem;
    outline: none;
    min-width: 250px;
}

.btts-search-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.75rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btts-search-btn:hover {
    background: #2563eb;
}

.btts-filter-box select {
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    min-width: 150px;
}

/* Modal stil tanımları */
.btts-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.btts-modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.btts-modal-large {
    max-width: 800px;
}

.btts-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 2rem 1rem 2rem;
    border-bottom: 1px solid #e2e8f0;
}

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

.btts-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    line-height: 1;
}

.btts-modal-close:hover {
    background: #f1f5f9;
    color: #3b82f6;
}

.btts-modal-body {
    padding: 2rem;
}

.btts-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1rem 2rem 2rem 2rem;
    border-top: 1px solid #e2e8f0;
}

/* Switch (toggle) stil tanımları */
.btts-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.btts-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.btts-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #cbd5e1;
    transition: 0.3s;
    border-radius: 24px;
}

.btts-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .btts-slider {
    background: #3b82f6;
}

input:checked + .btts-slider:before {
    transform: translateX(24px);
}

/* Pagination stil tanımları */
.btts-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
    gap: 1rem;
}

.btts-pagination button {
    padding: 0.75rem 1rem;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btts-pagination button:hover:not(:disabled) {
    border-color: #3b82f6;
    color: #3b82f6;
}

.btts-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btts-pagination button.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

/* Table builder (frontend) stil tanımları */
.btts-table-builder-frontend {
    padding: 2rem;
}

.btts-actions-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.btts-columns-preview {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    min-height: 200px;
}

.btts-columns-container-frontend {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btts-column-item-frontend {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    cursor: move;
}

.btts-column-item-frontend:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.btts-column-drag-handle {
    color: #94a3b8;
    font-size: 1.25rem;
    cursor: move;
}

.btts-column-info {
    flex-grow: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.btts-column-info strong {
    color: #1e293b;
    font-weight: 600;
}

.btts-column-type-badge {
    background: #dbeafe;
    color: #1e40af;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.btts-required-badge {
    background: #fee2e2;
    color: #dc2626;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.btts-column-actions {
    display: flex;
    gap: 0.5rem;
}

/* Preview table stil tanımları */
.btts-table-preview {
    padding: 2rem;
    background: #f8fafc;
    border-radius: 12px;
    margin: 1rem 0;
}

.btts-preview-table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btts-preview-table th {
    background: #f1f5f9;
    color: #374151;
    font-weight: 600;
}

/* Permissions matrix stil tanımları */
.btts-permissions-matrix {
    padding: 2rem;
}

.btts-matrix-table {
    overflow-x: auto;
    border-radius: 12px;
}

.btts-permissions-table th:first-child {
    position: sticky;
    left: 0;
    background: #f8fafc;
    z-index: 5;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

.btts-permissions-table td:first-child {
    position: sticky;
    left: 0;
    background: white;
    z-index: 5;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

/* Empty state stil tanımları */
.btts-empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #64748b;
    font-style: italic;
}

.btts-empty-state::before {
    content: "📋";
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

/* Loading state stil tanımları */
.btts-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    color: #64748b;
}

.btts-loading::before {
    content: "";
    width: 24px;
    height: 24px;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.75rem;
}

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

/* Success/Error messages */
.btts-success {
    background: #dcfce7;
    border: 2px solid #86efac;
    color: #166534;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btts-success::before {
    content: "✅";
    font-size: 1.25rem;
}

.btts-error {
    background: #fef2f2;
    border: 2px solid #fca5a5;
    color: #dc2626;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btts-error::before {
    content: "❌";
    font-size: 1.25rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .btts-header-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .btts-header-text h1 {
        font-size: 2rem;
    }
    
    .btts-content-wrapper {
        padding: 0 1rem 1rem 1rem;
    }
    
    .btts-card h2,
    .btts-card p {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .btts-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btts-toolbar-left,
    .btts-toolbar-right {
        justify-content: center;
    }
    
    .btts-search-box input {
        min-width: 200px;
    }
    
    .btts-roles-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .btts-tab-nav {
        flex-direction: column;
    }
    
    .btts-modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .btts-column-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .btts-table-scroll {
        font-size: 0.875rem;
    }
    
    .btts-table th,
    .btts-table td {
        padding: 0.75rem;
    }
}

/* Print styles */
@media print {
    .btts-page-header,
    .btts-toolbar,
    .btts-btn,
    .btts-actions,
    .btts-modal {
        display: none !important;
    }
    
    .btts-content-wrapper {
        max-width: none;
        padding: 0;
    }
    
    .btts-card {
        box-shadow: none;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
    
    .btts-table {
        font-size: 0.8rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btts-card {
        border: 2px solid #000;
    }
    
    .btts-btn-primary {
        background: #000;
        border: 2px solid #000;
    }
    
    .btts-btn-secondary {
        border: 2px solid #000;
        color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Focus styles for accessibility */
.btts-btn:focus-visible,
.btts-tab-button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}

/* Custom scrollbar for webkit browsers */
.btts-table-scroll::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.btts-table-scroll::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.btts-table-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.btts-table-scroll::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}