/**
 * Pos Yazılımı - Ana CSS
 * okutsat.com.tr
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    position: relative;
    z-index: 1100;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
}

.header h1 {
    color: white;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.main-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 20px;
    padding: 20px;
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.left-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.barcode-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.barcode-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.barcode-input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
}

.barcode-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-success {
    background: linear-gradient(45deg, #56ab2f, #a8e6cf);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(86, 171, 47, 0.3);
}

.btn-danger {
    background: linear-gradient(45deg, #ff6b6b, #ffa8a8);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

.btn-warning {
    background: linear-gradient(45deg, #ffd32a, #ffef96);
    color: #333;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 211, 42, 0.3);
}

.btn-secondary {
    background: linear-gradient(45deg, #6c757d, #95a5a6);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.3);
}

.camera-scan-btn {
    padding: 12px 16px;
    font-size: 18px;
}

.products-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Ürünler başlık + arama (max %40) + barkod/butonlar sağda */
.products-header-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.products-header-row h3 {
    margin: 0;
    margin-right: auto; /* Başlık sola yapışır */
}

.products-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    justify-content: flex-end;
}

/* Arama kutusu: Ürünler alanının max %40'ı, sağda (products-header-row = products-section genişliği) */
.product-search-input {
    flex: 0 1 auto;
    width: 100%;
    max-width: 40%; /* Ürünler bölümü genişliğinin %40'ını geçmez */
    min-width: 100px;
    padding: 8px 12px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.product-search-input:focus {
    outline: none;
    border-color: #667eea;
}

.barcode-compact-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.barcode-input-compact {
    width: 140px;
    min-width: 100px;
    padding: 8px 10px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 14px;
}

.barcode-input-compact:focus {
    outline: none;
    border-color: #667eea;
}

.btn-compact {
    padding: 8px 10px !important;
    font-size: 14px !important;
    min-width: 36px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    column-gap: var(--products-grid-gap, 4px);
    row-gap: var(--products-grid-row-gap, 4px);
    align-content: start; /* Satırları üstte topla, büyük ekranda stretch ile aralık açılmasın */
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 400px);
}

.product-card {
    background: #f8f9fa;
    padding: 8px;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    min-height: auto;
    height: fit-content;
}

.product-card:hover {
    border-color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.product-card h4 {
    color: #333;
    margin-bottom: 5px;
    font-size: 14px;
}

.product-card .price {
    color: #e74c3c;
    font-weight: bold;
    font-size: 16px;
}

.product-card .stock {
    color: #27ae60;
    font-size: 12px;
    margin-top: 5px;
}

.right-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-height: 0;
}

.cart-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.cart-items {
    flex: 1;
    min-height: 100px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
    margin-bottom: 5px;
    border-radius: 8px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.cart-item-details {
    font-size: 12px;
    color: #666;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 10px;
}

.quantity-btn {
    width: 25px;
    height: 25px;
    border: none;
    border-radius: 50%;
    background: #667eea;
    color: white;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
}

.quantity-display {
    min-width: 30px;
    text-align: center;
    font-weight: bold;
}

.cart-item-total {
    font-weight: bold;
    color: #e74c3c;
    min-width: 60px;
    text-align: right;
}

.remove-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 5px 8px;
    cursor: pointer;
    font-size: 12px;
}

.total-section {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.total-main {
    font-size: 18px;
    font-weight: bold;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    padding-top: 10px;
    margin-top: 10px;
}

/* POS Akordiyon (Ödeme, Hızlı İşlemler) */
.pos-accordion {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.pos-accordion-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.pos-accordion-header:hover {
    background: rgba(102, 126, 234, 0.08);
}

.pos-accordion-pin {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.pos-accordion-title {
    flex: 1;
    font-weight: 600;
    color: #333;
    font-size: 15px;
}

.pos-accordion-arrow {
    font-size: 12px;
    transition: transform 0.3s;
    color: #666;
}

.pos-accordion.collapsed .pos-accordion-arrow {
    transform: rotate(-90deg);
}

.pos-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.pos-accordion:not(.collapsed) .pos-accordion-content {
    max-height: 800px;
}

.pos-accordion.payment-section .pos-accordion-content,
.pos-accordion.quick-actions-section .pos-accordion-content {
    padding: 0 15px 15px;
}

.pos-accordion.payment-section .pos-accordion-content {
    padding-top: 5px;
}

.payment-section .payment-methods {
    margin-top: 0;
}

.payment-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    margin-top: -10px;
}

.close:hover {
    color: black;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    z-index: 1001;
    transform: translateX(400px);
    transition: all 0.3s;
}

.notification.success {
    background: linear-gradient(45deg, #56ab2f, #a8e6cf);
}

.notification.error {
    background: linear-gradient(45deg, #ff6b6b, #ffa8a8);
}

.notification.info {
    background: linear-gradient(45deg, #667eea, #764ba2);
}

.notification.show {
    transform: translateX(0);
}

.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    padding: 0 20px;
}

/* Settings Sayfası Stilleri */
.settings-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

.settings-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e1e8ed;
}

.tab-button {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    transition: all 0.3s;
}

.tab-button:hover {
    color: #667eea;
}

.tab-button.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.tab-content.active {
    display: block;
}

.tax-rate-list {
    margin-top: 20px;
}

.tax-rate-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
}

.tax-rate-info {
    flex: 1;
}

.tax-rate-name {
    font-weight: 600;
    color: #333;
}

.tax-rate-rate {
    color: #667eea;
    font-size: 18px;
    font-weight: bold;
}

.tax-rate-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 10px;
}

.badge-default {
    background: #667eea;
    color: white;
}

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    color: #666;
    font-size: 12px;
    margin-top: 5px;
}

@media (max-width: 768px) {
    .main-container {
        grid-template-columns: 1fr;
    }
    
    .payment-methods {
        grid-template-columns: 1fr;
    }
    
    /* Barkod grubu yan yana kalsın, butonlar küçülsün */
    .barcode-input-group {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 5px;
    }
    
    .barcode-input-group .btn {
        padding: 10px 12px;
        font-size: 14px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .barcode-input-group .camera-scan-btn {
        padding: 10px 12px;
    }
    
    .header h1 {
        font-size: 1.2rem;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-number {
        font-size: 20px;
    }
}

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

/* Scroll Bar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd6, #6a4190);
}

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 5px);
}

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success {
    background: linear-gradient(135deg, #56ab2f, #a8e6cf);
    color: white;
}

.badge-warning {
    background: linear-gradient(135deg, #f39c12, #f7dc6f);
    color: #333;
}

.badge-danger {
    background: linear-gradient(135deg, #e74c3c, #ffa8a8);
    color: white;
}

.badge-info {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

/* Card Hover Effects */
.card-hover {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.2);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glass Effect */
.glass {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

/* Input Focus Ring */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15) !important;
}

/* Button Ripple Effect */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 10%, transparent 10%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform 0.5s, opacity 0.5s;
}

.btn-ripple:active::after {
    transform: scale(0, 0);
    opacity: 1;
    transition: 0s;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.empty-state-desc {
    font-size: 14px;
    color: #666;
}

/* Status Indicators */
.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-dot.online {
    background: #27ae60;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.2);
}

.status-dot.offline {
    background: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2);
}

.status-dot.warning {
    background: #f39c12;
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.2);
}

/* Category Tabs Widget */
.category-tabs-section {
    background: white;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    margin-bottom: 15px;
    overflow: visible; /* Alt kategori dropdown'unun görünmesi için */
}

.category-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    overflow: visible; /* overflow-x: auto dropdown'u kesiyordu */
    padding-bottom: 5px;
}

.category-tab {
    padding: 10px 20px;
    background: #f0f2f5;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.category-tab:hover {
    background: #e1e8ed;
    color: #333;
}

.category-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Quick Actions Widget */
.quick-actions-section {
    background: white;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    margin-top: 10px;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 10px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 70px;
}

.quick-action-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.quick-action-btn span:first-child {
    font-size: 24px;
    margin-bottom: 5px;
}

.quick-action-label {
    font-size: 12px;
    font-weight: 500;
}

/* Widget Transitions */
[data-widget-type] {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Real-time Update Indicator */
.updating-indicator {
    position: fixed;
    top: 80px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 999;
    animation: fadeIn 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.updating-indicator .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

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

/* Print Styles */
@media print {
    body {
        background: white !important;
    }
    
    .header, .no-print {
        display: none !important;
    }
    
    .modal {
        display: none !important;
    }
}
