/**
 * Dekupaj Modülü - Stil Dosyası
 * Açık Tema, Modern Tasarım
 */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #dbeafe;
    --success-color: #16a34a;
    --success-light: #dcfce7;
    --warning-color: #ca8a04;
    --warning-light: #fef9c3;
    --error-color: #dc2626;
    --error-light: #fee2e2;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --transition: all 0.2s ease;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--gray-800);
    background-color: var(--gray-50);
}

/* ============================================
   LAYOUT
   ============================================ */
.dekupaj-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.dekupaj-header {
    text-align: center;
    margin-bottom: 32px;
}

.dekupaj-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 8px 0;
}

.dekupaj-header p {
    color: var(--gray-500);
    margin: 0;
}

/* ============================================
   UPLOAD AREA
   ============================================ */
.upload-area {
    background: var(--white);
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-xl);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 24px;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.upload-area.drag-over {
    border-color: var(--primary-color);
    background: var(--primary-light);
    transform: scale(1.01);
}

.upload-area.has-files {
    border-style: solid;
    border-color: var(--success-color);
    background: var(--success-light);
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    color: var(--gray-400);
}

.upload-area:hover .upload-icon {
    color: var(--primary-color);
}

.upload-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-700);
    margin: 0 0 8px 0;
}

.upload-subtitle {
    color: var(--gray-500);
    margin: 0 0 16px 0;
}

.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.upload-btn:hover {
    background: var(--primary-hover);
}

.upload-info {
    margin-top: 16px;
    font-size: 12px;
    color: var(--gray-400);
}

/* ============================================
   FORMAT SELECTOR
   ============================================ */
.format-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.format-label {
    font-weight: 500;
    color: var(--gray-700);
}

.format-options {
    display: flex;
    gap: 8px;
}

.format-option {
    padding: 8px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: var(--white);
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
}

.format-option:hover {
    border-color: var(--primary-color);
}

.format-option.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

/* ============================================
   FILE LIST
   ============================================ */
.file-list {
    display: grid;
    gap: 16px;
    margin-bottom: 24px;
}

.file-item {
    display: flex;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.file-preview {
    width: 120px;
    min-height: 120px;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    /* Satranç tahtası arka plan - şeffaflık göstergesi */
    background-image: 
        linear-gradient(45deg, var(--gray-200) 25%, transparent 25%),
        linear-gradient(-45deg, var(--gray-200) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, var(--gray-200) 75%),
        linear-gradient(-45deg, transparent 75%, var(--gray-200) 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

.file-preview img {
    max-width: 100%;
    max-height: 120px;
    object-fit: contain;
}

.file-info {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
}

.file-name {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 4px;
    word-break: break-all;
}

.file-meta {
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 12px;
}

.file-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.pending {
    background: var(--gray-100);
    color: var(--gray-600);
}

.status-badge.processing {
    background: var(--warning-light);
    color: var(--warning-color);
}

.status-badge.success {
    background: var(--success-light);
    color: var(--success-color);
}

.status-badge.error {
    background: var(--error-light);
    color: var(--error-color);
}

.file-actions {
    display: flex;
    gap: 8px;
    padding: 16px;
    align-items: center;
}

.btn-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: var(--white);
    cursor: pointer;
    transition: var(--transition);
    color: var(--gray-600);
}

.btn-icon:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-icon.danger:hover {
    border-color: var(--error-color);
    color: var(--error-color);
}

/* ============================================
   ACTION BUTTONS
   ============================================ */
.action-bar {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

.btn-success {
    background: var(--success-color);
    color: var(--white);
}

.btn-success:hover:not(:disabled) {
    background: #15803d;
}

.btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

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

/* ============================================
   PREVIEW MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-xl);
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9);
    transition: var(--transition);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--gray-500);
    border-radius: var(--radius);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow: auto;
}

.preview-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.preview-box {
    text-align: center;
}

.preview-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    margin-bottom: 12px;
}

.preview-image-container {
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    padding: 16px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Şeffaflık göstergesi */
    background-image: 
        linear-gradient(45deg, var(--gray-200) 25%, transparent 25%),
        linear-gradient(-45deg, var(--gray-200) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, var(--gray-200) 75%),
        linear-gradient(-45deg, transparent 75%, var(--gray-200) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.preview-image-container img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 20px;
    border-top: 1px solid var(--gray-200);
}

/* ============================================
   ALERTS & NOTIFICATIONS
   ============================================ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
}

.alert-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.alert-message {
    font-size: 13px;
}

.alert-warning {
    background: var(--warning-light);
    color: var(--warning-color);
}

.alert-error {
    background: var(--error-light);
    color: var(--error-color);
}

.alert-success {
    background: var(--success-light);
    color: var(--success-color);
}

.alert-info {
    background: var(--primary-light);
    color: var(--primary-color);
}

/* ============================================
   PROGRESS & LOADING
   ============================================ */
.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--gray-200);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-200);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    max-width: 350px;
}

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

.toast-success {
    border-left: 4px solid var(--success-color);
}

.toast-error {
    border-left: 4px solid var(--error-color);
}

.toast-warning {
    border-left: 4px solid var(--warning-color);
}

/* ============================================
   API SUGGESTION BOX
   ============================================ */
.api-suggestion {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 24px;
    text-align: center;
}

.api-suggestion-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.api-suggestion-text {
    color: var(--gray-500);
    margin-bottom: 16px;
    font-size: 13px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .dekupaj-container {
        padding: 16px;
    }
    
    .file-item {
        flex-direction: column;
    }
    
    .file-preview {
        width: 100%;
        height: 150px;
    }
    
    .file-actions {
        justify-content: flex-end;
        padding: 12px 16px;
        border-top: 1px solid var(--gray-100);
    }
    
    .preview-compare {
        grid-template-columns: 1fr;
    }
    
    .action-bar {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   HIDDEN INPUT
   ============================================ */
.hidden {
    display: none !important;
}
