/* Modern Professional Table Styles */
.modern-table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    border: 1px solid #e5e7eb;
    /* Enable horizontal scrolling for wide tables */
    overflow-x: auto;
    max-width: 100%;
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    line-height: 1.2rem;
    min-width: 800px; /* Ensure minimum width for proper layout */
}

/* Table Header */
.modern-table thead {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 2px solid #e2e8f0;
}

.modern-table th {
    padding: 7px 8px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.65rem;
    position: relative;
    white-space: pre-line;
    word-break: break-word;
    line-height: 1.1;
    border-right: 1px solid #e5e7eb;
    width: auto;
    min-width: 90px;
    max-width: 220px;
}

/* Başlık metni için span ile düzgün satır kırılması */
.modern-table th span, .modern-table th div {
    display: block;
    white-space: pre-line;
    word-break: break-word;
}

/* Sayı içeren sütunlar için daha dar width */
.modern-table th[data-sort="stok"],
.modern-table th[data-sort="sold"],
.modern-table th[data-sort="reserved"],
.modern-table th[data-sort="quantity"],
.modern-table th[data-sort="price"],
.modern-table th[data-sort="b2bQuantity"],
.modern-table th[data-sort="b2bPrice"],
.modern-table th[data-sort="adet"],
.modern-table th[data-sort="rezerve"],
.modern-table th[data-sort="satildi"] {
    width: 60px;
    min-width: 50px;
    max-width: 70px;
    text-align: center;
    white-space: nowrap;
}

.modern-table th[data-sort="status"] {
    width: 100px;
    min-width: 100px;
}

.modern-table th[data-sort="createdAt"],
.modern-table th[data-sort="acceptedAt"],
.modern-table th[data-sort="orderedAt"] {
    width: 120px;
    min-width: 120px;
}

.modern-table th[data-sort="product"],
.modern-table th[data-sort="username"],
.modern-table th[data-sort="mail"] {
    min-width: 120px;
}

.modern-table th[data-sort="note"] {
    min-width: 150px;
}

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

/* Sortable Headers */
.modern-table th.sortable {
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.modern-table th.sortable:hover {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    color: #3730a3;
}

.modern-table th.sortable::after {
    content: '⇅';
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.65rem;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.modern-table th.sortable:hover::after {
    opacity: 1;
}

.modern-table th.sort-asc::after {
    content: '▲';
    opacity: 1;
    color: #059669;
}

.modern-table th.sort-desc::after {
    content: '▼';
    opacity: 1;
    color: #dc2626;
}

/* Table Body */
.modern-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: all 0.2s ease;
}

.modern-table tbody tr:hover {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.modern-table tbody tr:last-child {
    border-bottom: none;
}

.modern-table td {
    padding: 8px 10px;
    vertical-align: middle;
    border-right: 1px solid #f3f4f6;
    color: #374151;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* Specific cell styling for better layout */
.modern-table td[data-field="id"],
.modern-table td[data-field="quantity"],
.modern-table td[data-field="price"],
.modern-table td[data-field="b2bQuantity"],
.modern-table td[data-field="b2bPrice"] {
    text-align: center;
    max-width: 80px;
}

.modern-table td[data-field="status"] {
    max-width: 100px;
}

.modern-table td[data-field="createdAt"],
.modern-table td[data-field="acceptedAt"],
.modern-table td[data-field="orderedAt"] {
    max-width: 120px;
    font-size: 0.75rem;
}

.modern-table td[data-field="note"] {
    max-width: 150px;
    white-space: normal;
    word-wrap: break-word;
}

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

/* Specific cell styling for better layout */
.modern-table td[data-field="stok"],
.modern-table td[data-field="sold"],
.modern-table td[data-field="reserved"],
.modern-table td[data-field="quantity"],
.modern-table td[data-field="price"],
.modern-table td[data-field="b2bQuantity"],
.modern-table td[data-field="b2bPrice"],
.modern-table td[data-field="adet"],
.modern-table td[data-field="rezerve"],
.modern-table td[data-field="satildi"] {
    text-align: center;
    max-width: 70px;
    font-variant-numeric: tabular-nums;
}

/* Compact variant */
.modern-table.compact th,
.modern-table.compact td {
    padding: 6px 8px;
    font-size: 0.75rem;
}

/* Filter Row */
.modern-table-filter-row {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.modern-table-filter-row td {
    padding: 6px 10px;
    background: transparent;
    border-right: 1px solid #e5e7eb;
}

.modern-table-filter-row td:last-child {
    border-right: none;
}

/* Filter Inputs */
.modern-filter-input {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.75rem;
    background: white;
    transition: all 0.2s ease;
}

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

.modern-filter-select {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.75rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modern-filter-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    white-space: nowrap;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-accepted {
    background: #d1fae5;
    color: #065f46;
}

.status-ordered {
    background: #dbeafe;
    color: #1e40af;
}

.status-rejected {
    background: #fee2e2;
    color: #991b1b;
}

.status-cancelled {
    background: #f3f4f6;
    color: #374151;
}

/* Action Buttons */
.modern-action-btn {
    display: inline-flex;
    align-items: center;
    padding: 4px 6px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 1px;
    white-space: normal;
    min-width: 60px;
    max-width: 100px;
    justify-content: center;
    text-align: center;
    line-height: 1.1;
    word-wrap: break-word;
    hyphens: auto;
}

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

.modern-action-btn.edit {
    background: #dbeafe;
    color: #1e40af;
    border-color: #93c5fd;
}

.modern-action-btn.edit:hover {
    background: #bfdbfe;
    color: #1e3a8a;
}

.modern-action-btn.delete {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
}

.modern-action-btn.delete:hover {
    background: #fecaca;
    color: #b91c1b;
}

.modern-action-btn.view {
    background: #d1fae5;
    color: #059669;
    border-color: #6ee7b7;
}

.modern-action-btn.view:hover {
    background: #a7f3d0;
    color: #047857;
}

.modern-action-btn.hide {
    background: #fef3c7;
    color: #d97706;
    border-color: #fcd34d;
}

.modern-action-btn.hide:hover {
    background: #fde68a;
    color: #b45309;
}

.modern-action-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #9ca3af;
    border-color: #9ca3af;
    color: #6b7280;
}

.modern-action-btn.disabled:hover {
    background-color: #9ca3af;
    border-color: #9ca3af;
    color: #6b7280;
}

/* Table Controls */
.modern-table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 8px;
}

.modern-table-controls-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}

.modern-table-controls-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Search Box */
.modern-search-box {
    position: relative;
    min-width: 180px;
    max-width: 300px;
}

.modern-search-box input {
    width: 100%;
    padding: 6px 10px 6px 32px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.8rem;
    background: white;
    transition: all 0.2s ease;
}

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

.modern-search-box::before {
    content: '🔍';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: #6b7280;
    pointer-events: none;
}

/* Filter Groups */
.modern-filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.modern-filter-group label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
}

/* Export Button */
.modern-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.modern-export-btn:hover {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(5, 150, 105, 0.3);
}

/* Empty State */
.modern-table-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.modern-table-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.modern-table-empty-text {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 6px;
}

.modern-table-empty-subtext {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Loading State */
.modern-table-loading {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.modern-table-loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

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

/* Responsive Design */
@media (max-width: 1024px) {
    .modern-table-container {
        overflow-x: auto;
        border-radius: 8px;
    }
    
    .modern-table {
        min-width: 900px;
        font-size: 0.75rem;
    }
    
    .modern-table th,
    .modern-table td {
        padding: 6px 8px;
    }
    
    .modern-table-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }
    
    .modern-table-controls-left {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    
    .modern-search-box {
        min-width: 150px;
        max-width: 250px;
    }
    
    .modern-filter-group {
        flex-direction: row;
        align-items: center;
        gap: 4px;
    }
}

@media (max-width: 768px) {
    .modern-table-container {
        border-radius: 6px;
        margin: 0 -8px;
    }
    
    .modern-table {
        font-size: 0.7rem;
        min-width: 800px;
    }
    
    .modern-table th,
    .modern-table td {
        padding: 4px 6px;
    }
    
    .modern-table-controls {
        padding: 8px 12px;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }
    
    .modern-table-controls-left {
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .modern-table-controls-right {
        justify-content: center;
    }
    
    .modern-search-box {
        min-width: auto;
        width: 100%;
        max-width: none;
    }
    
    .modern-filter-group {
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
    }
    
    .modern-filter-group label {
        text-align: center;
        font-size: 0.7rem;
    }
    
    .modern-action-btn {
        padding: 3px 6px;
        font-size: 0.65rem;
        min-width: 50px;
    }
    
    .status-badge {
        padding: 2px 4px;
        font-size: 0.65rem;
    }
}

/* Print Styles */
@media print {
    .modern-table-container {
        box-shadow: none;
        border: 1px solid #000;
        overflow: visible;
    }
    
    .modern-table-controls,
    .modern-action-btn {
        display: none;
    }
    
    .modern-table th {
        background: #f3f4f6 !important;
        color: #000 !important;
    }
    
    .modern-table tbody tr:hover {
        background: transparent !important;
        transform: none !important;
        box-shadow: none !important;
    }
}

/* Accessibility */
.modern-table th:focus,
.modern-action-btn:focus,
.modern-filter-input:focus,
.modern-filter-select:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .modern-table th {
        background: #000;
        color: #fff;
    }
    
    .modern-table td {
        border-color: #000;
    }
    
    .modern-action-btn {
        border-width: 2px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .modern-table tbody tr,
    .modern-action-btn,
    .modern-export-btn {
        transition: none;
    }
    
    .modern-table tbody tr:hover {
        transform: none;
    }
    
    .modern-action-btn:hover,
    .modern-export-btn:hover {
        transform: none;
    }
} 

/* Action Button Group: Her zaman yatayda */
.modern-action-group {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 4px;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
    padding: 2px;
}
@media (max-width: 768px) {
    .modern-action-group {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 2px;
    }
} 

/* Tablo başlık font boyutu kontrolü için class'lar */
.modern-table-header-size-sm th {
    font-size: 0.60rem !important;
    padding-top: 5px !important;
    padding-bottom: 5px !important;
}
.modern-table-header-size-md th {
    font-size: 0.70rem !important;
    padding-top: 7px !important;
    padding-bottom: 7px !important;
}
.modern-table-header-size-lg th {
    font-size: 0.85rem !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
} 