/* Genel Stiller */
* {
    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;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo {
    height: 50px;
    width: auto;
    object-fit: contain;
}

header h1 {
    color: #2c3e50;
    font-size: 2rem;
    margin: 0;
}

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

.logout-btn {
    background: #e74c3c;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: #c0392b;
}

/* Login Sayfası */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.logo-container {
    text-align: center;
    margin-bottom: 20px;
}

.logo {
    height: 80px;
    width: auto;
    object-fit: contain;
    max-width: 200px;
}

.login-box h2 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.login-box h3 {
    color: #7f8c8d;
    margin-bottom: 30px;
    font-weight: normal;
}

/* Form Stilleri */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

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

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Butonlar */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #3498db;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
    margin: 5px;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

/* Mesajlar */
.message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-weight: 600;
}

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

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

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

/* Upload Bölümü */
.upload-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.upload-section h2 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.upload-section p {
    color: #7f8c8d;
    margin-bottom: 25px;
    line-height: 1.6;
}

.upload-form {
    display: grid;
    gap: 20px;
}

.file-group {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 2px dashed #ddd;
    transition: border-color 0.3s;
}

.file-group:hover {
    border-color: #3498db;
}

.file-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #2c3e50;
}

.file-group input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
}

.file-status {
    margin-top: 5px;
    font-size: 0.9rem;
    font-weight: 600;
}

.file-status.success {
    color: #27ae60;
}

.file-status.error {
    color: #e74c3c;
}

/* Progress Bar */
.progress-container {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    text-align: center;
    font-weight: 600;
    color: #2c3e50;
}

/* Sonuçlar Bölümü */
.results-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.results-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.results-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

/* Eşleşmeyen Kayıtlar Bölümü */
.unmatched-section {
    border-left: 4px solid #e74c3c;
}

.unmatched-section h3 {
    color: #e74c3c;
    border-bottom-color: #e74c3c;
}

.unmatched-table th {
    background: #e74c3c;
}

.unmatched-table .status.unmatched {
    background: #e74c3c;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
}

/* Birleşik tablo satır türleri */
.results-table tr.match {
    background: rgba(40, 167, 69, 0.1);
    border-left: 4px solid #28a745;
}

.results-table tr.unmatched_bank {
    background: rgba(220, 53, 69, 0.1);
    border-left: 4px solid #e74c3c;
}

.results-table tr.unmatched_stock {
    background: rgba(255, 193, 7, 0.1);
    border-left: 4px solid #ffc107;
}

.results-table tr:hover {
    background: rgba(0, 0, 0, 0.05);
}

.results-table .status {
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    text-align: center;
}

.results-table tr.match .status {
    background: #28a745;
    color: white;
}

.results-table tr.unmatched_bank .status {
    background: #e74c3c;
    color: white;
}

.results-table tr.unmatched_stock .status {
    background: #ffc107;
    color: #212529;
}

.result-actions {
    margin-bottom: 20px;
    text-align: center;
}

/* Özet Bilgileri */
.results-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.summary-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid #3498db;
}

.summary-item .label {
    display: block;
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.summary-item .value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.summary-item .value.highlight {
    color: #27ae60;
}

.summary-item .value.unmatched {
    color: #e74c3c;
}

/* Tablo */
.table-container {
    overflow-x: auto;
    margin-top: 20px;
}

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

.results-table th {
    background: #34495e;
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

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

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

.results-table .amount {
    font-weight: bold;
    color: #27ae60;
    text-align: right;
}

.results-table .account-name {
    max-width: 200px;
    word-wrap: break-word;
    font-size: 0.9rem;
}

.results-table .similarity {
    text-align: center;
    font-weight: bold;
    color: #3498db;
}

/* Boş Sonuç */
.no-results {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.no-results p {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

/* Login Bilgi */
.login-info {
    margin-top: 20px;
    padding: 15px;
    background: #e8f4f8;
    border-radius: 8px;
    text-align: left;
}

.login-info p {
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.login-info strong {
    color: #2c3e60;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .upload-form {
        grid-template-columns: 1fr;
    }
    
    .results-summary {
        grid-template-columns: 1fr;
    }
    
    .account-name {
        max-width: 150px;
    }
    
    .login-box {
        padding: 30px 20px;
    }
}

/* Yeni Tablo Stilleri */
.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 14px;
}

.table th {
    background: #f8f9fa;
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table td {
    padding: 10px 8px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.row-number {
    background: #e9ecef !important;
    font-weight: bold;
    text-align: center;
    width: 50px;
    color: #495057;
}

.match-row:hover {
    background: #f8f9fa;
}

.similarity-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    color: white;
}

.similarity-excellent { background: #28a745; }
.similarity-very-good { background: #20c997; }
.similarity-good { background: #17a2b8; }
.similarity-fair { background: #ffc107; color: #212529; }
.similarity-poor { background: #dc3545; }

/* Durum Rozetleri */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    color: white;
}

.status-badge.match {
    background: #28a745;
}

.status-badge.no-match {
    background: #dc3545;
}

/* Satır Durumları - Benzerlik Renklerine Göre */
.match-row.match {
    background: rgba(40, 167, 69, 0.05);
}

.match-row.no-match {
    background: rgba(220, 53, 69, 0.05);
}

.match-row.match:hover {
    background: rgba(40, 167, 69, 0.1);
}

.match-row.no-match:hover {
    background: rgba(220, 53, 69, 0.1);
}

/* Benzerlik Renklerine Göre Satır Arka Planları */
.match-row.similarity-excellent {
    background: linear-gradient(90deg, rgba(40, 167, 69, 0.1), rgba(40, 167, 69, 0.05));
    border-left: 4px solid #28a745;
}

.match-row.similarity-very-good {
    background: linear-gradient(90deg, rgba(32, 201, 151, 0.1), rgba(32, 201, 151, 0.05));
    border-left: 4px solid #20c997;
}

.match-row.similarity-good {
    background: linear-gradient(90deg, rgba(23, 162, 184, 0.1), rgba(23, 162, 184, 0.05));
    border-left: 4px solid #17a2b8;
}

.match-row.similarity-fair {
    background: linear-gradient(90deg, rgba(255, 193, 7, 0.1), rgba(255, 193, 7, 0.05));
    border-left: 4px solid #ffc107;
}

.match-row.similarity-poor {
    background: linear-gradient(90deg, rgba(220, 53, 69, 0.1), rgba(220, 53, 69, 0.05));
    border-left: 4px solid #dc3545;
}

/* Hover Efektleri */
.match-row.similarity-excellent:hover {
    background: linear-gradient(90deg, rgba(40, 167, 69, 0.15), rgba(40, 167, 69, 0.08));
}

.match-row.similarity-very-good:hover {
    background: linear-gradient(90deg, rgba(32, 201, 151, 0.15), rgba(32, 201, 151, 0.08));
}

.match-row.similarity-good:hover {
    background: linear-gradient(90deg, rgba(23, 162, 184, 0.15), rgba(23, 162, 184, 0.08));
}

.match-row.similarity-fair:hover {
    background: linear-gradient(90deg, rgba(255, 193, 7, 0.15), rgba(255, 193, 7, 0.08));
}

.match-row.similarity-poor:hover {
    background: linear-gradient(90deg, rgba(220, 53, 69, 0.15), rgba(220, 53, 69, 0.08));
}

.btn-detail {
    background: #007bff;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.btn-detail:hover { background: #0056b3; }

.btn-close {
    background: #6c757d;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.btn-close:hover { background: #545b62; }

/* Excel Export Butonu */
#exportBtn {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin-left: 15px;
    transition: all 0.3s ease;
}

#exportBtn:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.results-table h3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.detail-content {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 10px 0;
}

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

.detail-header h4 {
    margin: 0;
    color: #495057;
}

.detail-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.detail-section {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.detail-section h5 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 14px;
}

.data-preview {
    font-size: 13px;
    line-height: 1.5;
}

.raw-data {
    margin-top: 10px;
}

.raw-data details {
    margin-bottom: 10px;
}

.raw-data summary {
    cursor: pointer;
    font-weight: 600;
    color: #007bff;
    margin-bottom: 5px;
}

.raw-data pre {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    font-size: 11px;
    overflow-x: auto;
    border: 1px solid #e9ecef;
}

/* Yeni Tablo Stilleri */
.bank-section {
    background-color: #f8f9fa !important; /* Gri ton */
    color: #495057;
}

.stock-section {
    background-color: #e3f2fd !important; /* Açık mavi */
    color: #1565c0;
}

/* Tutar Renkleri */
.negative-amount {
    color: #dc3545 !important; /* Kırmızı */
    font-weight: bold;
}

.positive-amount {
    color: #000000 !important; /* Siyah */
    font-weight: normal;
}

.zero-amount {
    color: #6c757d !important; /* Gri */
    font-style: italic;
}

/* Eşleşme Oranı Renkleri */
.similarity-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    min-width: 50px;
    display: inline-block;
}

.similarity-excellent {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.similarity-very-good {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.similarity-good {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.similarity-fair {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.similarity-poor {
    background-color: #f5c6cb;
    color: #721c24;
    border: 1px solid #f1b0b7;
}

/* Tablo Başlık Stilleri */
.table th {
    background-color: #343a40;
    color: white;
    font-weight: 600;
    text-align: center;
    padding: 12px 8px;
    border: 1px solid #495057;
}

.table th:nth-child(2),
.table th:nth-child(3),
.table th:nth-child(4) {
    background-color: #6c757d; /* Gri başlık */
}

.table th:nth-child(5),
.table th:nth-child(6),
.table th:nth-child(7) {
    background-color: #007bff; /* Mavi başlık */
}

/* Tablo Hücre Stilleri */
.table td {
    padding: 8px;
    border: 1px solid #dee2e6;
    text-align: center;
    vertical-align: middle;
}

.table td.bank-section {
    background-color: #f8f9fa;
    border-left: 3px solid #6c757d;
}

.table td.stock-section {
    background-color: #e3f2fd;
    border-left: 3px solid #007bff;
}

/* Satır Hover Efekti */
.table tbody tr:hover {
    background-color: #f1f3f4;
}

.table tbody tr:hover .bank-section {
    background-color: #e9ecef !important;
}

.table tbody tr:hover .stock-section {
    background-color: #bbdefb !important;
}