* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* Navbar Styles */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    color: white;
    font-size: 1.5em;
    font-weight: 700;
    text-decoration: none;
}

.navbar-links {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.navbar-link {
    padding: 8px 16px;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.navbar-link:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.navbar-link.active {
    background: rgba(255, 255, 255, 0.3);
    border-color: white;
}

.navbar-link.btn-danger {
    background: #dc3545;
    border-color: #dc3545;
}

.navbar-link.btn-danger:hover {
    background: #c82333;
    border-color: #c82333;
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: stretch;
    }

    .navbar-links {
        width: 100%;
        justify-content: center;
    }

    .navbar-link {
        flex: 1;
        text-align: center;
        min-width: 120px;
    }
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.upload-section {
    padding: 30px;
    border-bottom: 2px solid #f0f0f0;
}

.upload-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.upload-box {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

#excelFile {
    padding: 12px;
    border: 2px dashed #667eea;
    border-radius: 8px;
    font-size: 1em;
    flex: 1;
    min-width: 200px;
    cursor: pointer;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-primary {
    background: #667eea;
    color: white;
}

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

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.btn-select {
    background: #28a745;
    color: white;
    padding: 6px 12px;
    font-size: 0.9em;
}

.btn-select:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.status-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    font-weight: 500;
    display: none;
}

.status-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.products-section {
    padding: 30px;
}

.products-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.search-section {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 300px;
}

#searchInput {
    width: 100%;
    padding: 12px;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 1em;
    outline: none;
    transition: border-color 0.3s ease;
}

#searchInput:focus {
    border-color: #764ba2;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-top: 5px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
}

.search-result-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-result-item:hover {
    background: #f8f9fa;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-count {
    color: #6c757d;
    font-size: 0.9em;
    font-weight: normal;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

#pageInfo {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
}

.products-container {
    min-height: 400px;
}

.empty-message {
    text-align: center;
    color: #6c757d;
    font-size: 1.2em;
    padding: 50px;
}

.products-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.products-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.products-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.products-table td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}

.products-table td:nth-child(4) {
    font-size: 0.95em;
    line-height: 1.8;
}

.products-table tbody tr {
    transition: background 0.2s ease;
}

.products-table tbody tr:hover {
    background: #f8f9fa;
}

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

.page-end-row {
    background: #e8f5e9 !important;
    border-left: 4px solid #28a745;
}

.page-end-row:hover {
    background: #c8e6c9 !important;
}

.badge-success {
    background: #d4edda;
    color: #155724;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.badge-primary {
    background: #e3f2fd;
    color: #1976d2;
}

.loading {
    text-align: center;
    padding: 50px;
    color: #667eea;
    font-size: 1.2em;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

.page-summary-section {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #667eea;
}

.page-summary-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.page-summary-content {
    background: white;
    border-radius: 8px;
    padding: 15px;
}

.ana-stok-kod-summary {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.ana-stok-kod-summary:last-child {
    margin-bottom: 0;
}

.ana-stok-kod-title {
    font-size: 1.2em;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ana-stok-kod-total {
    font-size: 0.9em;
    color: #666;
    font-weight: normal;
}

.variants-list {
    margin-top: 10px;
    padding-left: 20px;
}

.variant-item {
    padding: 8px 12px;
    margin: 5px 0;
    background: white;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #e0e0e0;
}

.variant-info {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.variant-renk {
    color: #667eea;
    font-weight: 600;
}

.variant-beden {
    color: #764ba2;
    font-weight: 600;
}

.variant-adet {
    background: #28a745;
    color: white;
    padding: 5px 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1em;
    min-width: 50px;
    text-align: center;
}

.no-match {
    color: #dc3545;
    font-style: italic;
    padding: 10px;
    background: #fff3cd;
    border-radius: 6px;
    margin-top: 10px;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }

    .upload-box {
        flex-direction: column;
    }

    #excelFile {
        width: 100%;
    }

    .btn {
        width: 100%;
    }

    .search-section {
        flex-direction: column;
    }

    .search-box {
        width: 100%;
        min-width: 100%;
    }

    #selectPageEndBtn {
        width: 100%;
    }

    .products-table {
        font-size: 0.85em;
    }

    .products-table th,
    .products-table td {
        padding: 10px;
    }
}

