/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

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

/* Header */
.header {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 2rem;
    margin-bottom: 5px;
}

.header .subtitle {
    opacity: 0.9;
    font-size: 1rem;
}

/* Upload Section */
.upload-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.upload-area {
    border: 2px dashed #3498db;
    border-radius: 10px;
    padding: 50px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #f8fafc;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #2980b9;
    background-color: #ebf5fb;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.upload-hint {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-top: 10px;
}

/* File List */
.file-list {
    margin-top: 20px;
}

.file-list h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid #e1e8ed;
}

.file-item .file-icon {
    font-size: 1.5rem;
}

.file-item .file-name {
    flex: 1;
    font-weight: 500;
}

.file-item input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    width: 120px;
}

.file-item input:focus {
    outline: none;
    border-color: #3498db;
}

.file-item .remove-btn {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
}

.file-item .remove-btn:hover {
    color: #c0392b;
}

/* Form Group */
.form-group {
    margin-top: 20px;
}

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

.form-group select {
    width: 100%;
    max-width: 400px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
}

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

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background-color: #2980b9;
}

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

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

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

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-warning {
    background-color: #f39c12;
    color: white;
}

.btn-warning:hover {
    background-color: #d68910;
}

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

#submitBtn {
    margin-top: 20px;
    width: 100%;
    max-width: 400px;
    padding: 15px 30px;
    font-size: 1.1rem;
}

/* Queue Section */
.queue-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.queue-header h2 {
    color: #2c3e50;
}

.queue-actions {
    display: flex;
    gap: 10px;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat {
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.stat-total { background-color: #ecf0f1; }
.stat-pending { background-color: #fff3cd; color: #856404; }
.stat-processing { background-color: #cce5ff; color: #004085; }
.stat-completed { background-color: #d4edda; color: #155724; }
.stat-error { background-color: #f8d7da; color: #721c24; }

/* Queue Table */
.queue-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.queue-table th,
.queue-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e1e8ed;
}

.queue-table th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #2c3e50;
}

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

.queue-table .empty-message {
    text-align: center;
    color: #7f8c8d;
    padding: 40px;
}

/* Status Icons */
.status-icon {
    display: inline-block;
    width: 24px;
    text-align: center;
}

.status-completed { color: #27ae60; }
.status-processing { color: #f39c12; }
.status-pending { color: #3498db; }
.status-error { color: #e74c3c; }

/* Action Buttons */
.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px 8px;
    border-radius: 5px;
    transition: background-color 0.2s;
}

.action-btn:hover {
    background-color: #f0f0f0;
}

/* Result Badge */
.result-badge {
    display: inline-flex;
    gap: 5px;
    font-size: 0.85rem;
}

.result-badge span {
    padding: 2px 8px;
    border-radius: 10px;
}

.badge-pozitif { background-color: #92D050; color: #155724; }
.badge-kismi { background-color: #FFFF00; color: #856404; }
.badge-negatif { background-color: #FF6B6B; color: white; }

/* Legend */
.legend {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: #7f8c8d;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-content.modal-small {
    max-width: 400px;
}

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

.modal-header h3 {
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #7f8c8d;
}

.modal-close:hover {
    color: #2c3e50;
}

.modal-body {
    padding: 20px;
}

.modal-body p {
    margin-bottom: 10px;
}

.modal-body pre {
    background: #f8fafc;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    font-size: 0.9rem;
    color: #e74c3c;
}

.modal-footer {
    display: flex;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #e1e8ed;
    justify-content: flex-end;
}

/* Result Summary */
.result-summary {
    display: flex;
    gap: 15px;
    margin: 20px 0;
}

.result-item {
    flex: 1;
    text-align: center;
    padding: 20px;
    border-radius: 10px;
}

.result-pozitif { background-color: #92D050; }
.result-kismi { background-color: #FFFF00; }
.result-negatif { background-color: #FF6B6B; color: white; }

.result-label {
    display: block;
    font-weight: 500;
    margin-bottom: 5px;
}

.result-value {
    font-size: 2rem;
    font-weight: bold;
}

/* Mail Status */
.mail-status {
    padding: 10px 15px;
    border-radius: 5px;
    margin-top: 15px;
}

.mail-status.sent {
    background-color: #d4edda;
    color: #155724;
}

.mail-status.not-sent {
    background-color: #fff3cd;
    color: #856404;
}

.mail-status.error {
    background-color: #f8d7da;
    color: #721c24;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-top: 30px;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .header {
        padding: 20px;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .queue-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-bar {
        flex-direction: column;
        gap: 10px;
    }

    .queue-table {
        font-size: 0.9rem;
    }

    .queue-table th,
    .queue-table td {
        padding: 8px;
    }

    .result-summary {
        flex-direction: column;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 2000;
    animation: slideIn 0.3s ease;
}

.toast.success { background-color: #27ae60; }
.toast.error { background-color: #e74c3c; }
.toast.info { background-color: #3498db; }

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
