* {
    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;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    max-width: 900px;
    width: 100%;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 2.5em;
}

.upload-section {
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    margin-bottom: 30px;
    transition: all 0.3s ease;
    background: #f8f9ff;
}

.upload-section:hover {
    border-color: #764ba2;
    background: #f0f2ff;
}

.upload-section.dragover {
    border-color: #764ba2;
    background: #e8ebff;
    transform: scale(1.02);
}

#fileInput {
    display: none;
}

.upload-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.upload-btn:active {
    transform: translateY(0);
}

.direction-section {
    margin: 30px 0;
    padding: 25px;
    background: #f8f9ff;
    border-radius: 15px;
}

.direction-section h3 {
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.direction-options {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.direction-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 15px 25px;
    border: 2px solid #ddd;
    border-radius: 10px;
    transition: all 0.3s ease;
    background: white;
}

.direction-option:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.2);
}

.direction-option input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.direction-option input[type="radio"]:checked+label {
    color: #667eea;
    font-weight: bold;
}

.direction-option label {
    cursor: pointer;
    font-size: 16px;
    color: #555;
}

.process-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 18px;
    font-size: 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    margin-top: 20px;
}

.process-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.process-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.preview-section {
    margin-top: 30px;
}

.preview-section h3 {
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.image-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    background: #f5f5f5;
}

.image-item img {
    width: 100%;
    height: auto;
    display: block;
}

/* İşlenmiş resimler için sabit boyut */
.preview-section .image-item {
    height: 250px;
}

.preview-section .image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.image-item .image-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px;
    font-size: 12px;
    text-align: center;
}

.download-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.download-btn:hover {
    background: #218838;
    transform: translateY(-2px);
}

.remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.remove-btn:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.preview-item {
    border: 2px solid #667eea;
    cursor: pointer;
    height: 250px;
    display: flex;
    flex-direction: column;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.preview-item .image-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(102, 126, 234, 0.8);
    border-radius: 0 0 10px 10px;
    z-index: 1;
}

.preview-item .hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    gap: 15px;
    border-radius: 10px;
    z-index: 2;
}

.preview-item:hover .hover-overlay {
    display: flex;
}

.preview-item:hover .image-label {
    z-index: 3;
}

.preview-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.preview-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.preview-item .remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    margin-top: 0;
}

.preview-item .remove-btn:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: relative;
    margin: auto;
    padding: 20px;
    width: 90%;
    max-width: 1200px;
    top: 50%;
    transform: translateY(-50%);
    text-align: center;
}

.modal-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-content p {
    color: white;
    margin-top: 20px;
    font-size: 18px;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #fff;
}

.download-all-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

.download-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.6);
}

/* İşlenmiş resimler için hover efekti */
.preview-section .image-item {
    cursor: pointer;
}

.preview-section .image-item .hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    gap: 15px;
    border-radius: 10px;
    z-index: 2;
}

.preview-section .image-item:hover .hover-overlay {
    display: flex;
}

.preview-section .image-item:hover .image-label {
    z-index: 3;
}

.preview-section .image-item .download-btn-hover {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.preview-section .image-item .download-btn-hover:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.selected-files {
    margin-top: 20px;
    padding: 15px;
    background: #e8f5e9;
    border-radius: 10px;
    color: #2e7d32;
    text-align: center;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #667eea;
    font-size: 18px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

