@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background: #0f0f12;
    color: #f5f5f5;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.04) 1px, transparent 0);
    background-size: 40px 40px;
}

.container { max-width: 1400px; margin: 0 auto; position: relative; z-index: 10; }

.card {
    background: rgba(22, 22, 26, 0.7);
    border-radius: 16px;
    padding: 32px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
}

h1 { font-size: 36px; font-weight: 800; letter-spacing: -1px; margin-bottom: 8px; color: #ffffff; }
.subtitle { color: #a0a0a0; margin-bottom: 32px; font-size: 16px; }

/* Upload Section */
.upload-section { margin-bottom: 32px; }
.upload-label {
    display: block; border: 2px dashed #34343b; border-radius: 12px; padding: 48px;
    cursor: pointer; background: rgba(255, 255, 255, 0.02); transition: all 0.3s ease; text-align: center;
}
.upload-label:hover, .upload-label.dragover { border-color: #6c5ce7; background: rgba(108, 92, 231, 0.1); }
.upload-content { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.upload-icon { width: 40px; height: 40px; color: #a0a0a0; }
.upload-text { font-size: 16px; font-weight: 600; color: #f5f5f5; }
.upload-hint { font-size: 13px; color: #707070; }

/* Empty State & How-To */
.empty-state {
    text-align: center; padding: 40px 20px; color: #a0a0a0;
    background: rgba(255, 255, 255, 0.02); border-radius: 12px;
}
.empty-state h2 { font-size: 20px; color: #fff; margin-bottom: 24px; }
.steps { list-style: none; display: inline-flex; flex-direction: column; align-items: flex-start; gap: 16px; text-align: left;}
.steps li { display: flex; align-items: center; gap: 12px; font-size: 15px; }
.steps span {
    font-weight: 700; color: #6c5ce7; background: rgba(108, 92, 231, 0.15);
    border-radius: 50%; width: 28px; height: 28px; display: inline-flex;
    align-items: center; justify-content: center;
}

/* Main Workspace */
.workspace-container { display: flex; gap: 24px; }
.image-list-panel { width: 35%; max-width: 400px; }
.text-editor-panel { width: 65%; display: flex; flex-direction: column; }

.image-list-panel h3, .text-header h3 { font-size: 18px; margin-bottom: 16px; color: #fff; }

.images-list {
    max-height: 500px; overflow-y: auto; padding-right: 10px;
    display: flex; flex-direction: column; gap: 12px;
}

.image-card-small {
    display: flex; align-items: center; gap: 12px; padding: 10px;
    background: rgba(255, 255, 255, 0.03); border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.07);
}
.image-card-small .thumb { width: 50px; height: 50px; object-fit: cover; border-radius: 6px; }
.image-card-small .info { flex: 1; min-width: 0; }
.image-card-small .name { 
    font-size: 13px; font-weight: 500; color: #e0e0e0; 
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.image-card-small .status { font-size: 12px; color: #888; display: flex; align-items: center; gap: 6px; }

.loader {
    width: 14px; height: 14px; border: 2px solid #555;
    border-top-color: #fff; border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.delete-btn { background: none; border: none; cursor: pointer; color: #ff6b6b; opacity: 0.6; transition: opacity 0.2s; padding: 4px;}
.delete-btn:hover { opacity: 1; }
.delete-btn svg { width: 18px; height: 18px; display: block; }

/* Text Editor & Actions */
.text-header { display: flex; justify-content: space-between; align-items: center; }
.actions-panel { display: flex; gap: 10px; }
.action-btn {
    display: flex; align-items: center; gap: 6px; padding: 8px 14px;
    background: #34343b; color: #f5f5f5; border: none;
    border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer;
    transition: background-color 0.2s;
}
.action-btn:hover { background: #45454e; }
.action-btn.primary { background: #6c5ce7; }
.action-btn.primary:hover { background: #5a4bdb; }
.action-btn svg { width: 16px; height: 16px; }

.text-output {
    flex-grow: 1; width: 100%; min-height: 450px; padding: 16px;
    background: rgba(10, 10, 10, 0.8); color: #e0e0e0; border: 1px solid #34343b;
    border-radius: 8px; font-size: 14px; line-height: 1.6; font-family: 'Inter', monospace; resize: none;
    transition: border-color 0.3s;
}
.text-output:focus { outline: none; border-color: #6c5ce7; }

/* ADVANCED ON-PAGE SEO STYLES */
.info-section {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}
.info-block h3 { font-size: 20px; color: #ffffff; margin-bottom: 16px; }
.info-block p { color: #a0a0a0; line-height: 1.7; margin-bottom: 16px; }
.info-block ul { list-style: none; color: #a0a0a0; padding-left: 0; }
.info-block ul li { margin-bottom: 10px; list-style-type: '✓  '; padding-left: 8px; }

.faq-item { margin-bottom: 20px; }
.faq-item h4 { font-size: 16px; color: #e0e0e0; margin-bottom: 8px; font-weight: 600; }

/* Toast Notification Styles */
.toast-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #2ecc71;
    color: #fff;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    z-index: 1000;
    opacity: 0;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}
.toast-notification.error { background-color: #e74c3c; }
.toast-notification.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* Responsive */
@media (max-width: 900px) {
    .workspace-container { flex-direction: column; }
    .image-list-panel, .text-editor-panel { width: 100%; max-width: none; }
    .images-list { max-height: 200px; }
    .info-section { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    body { padding: 10px; }
    .card { padding: 20px; }
    h1 { font-size: 28px; }
    .text-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}