/* ---------- Base reset ---------- */
*{margin:0;padding:0;box-sizing:border-box}
/* Basic Reset & Font */
:root { /* Define color variables */
        --primary-color: #3498db;
        --primary-hover: #2980b9;
        --secondary-color: #2ecc71;
        --secondary-hover: #27ae60;
        --tertiary-color: #e67e22; /* Orange for Text/Prompt */
        --tertiary-hover: #d35400;
        --image-color: #9b59b6; /* Purple for Image */
        --image-hover: #8e44ad;
        --youtube-color: #e74c3c; /* Red for YouTube */
        --youtube-hover: #c0392b;
        --border-color: #ccc;
        --border-light:#e0e0e0;
        --border-focus-color: #3498db;
        --background-light: #f4f7f9;
        --background-card: #fff;
        --text-primary: #333;
        --text-secondary: #555;
        --text-light: #888;
        --success-bg: #dff0d8;
        --success-border: #d6e9c6;
        --success-text: #3c763d;
        --error-bg: #f2dede;
        --error-border: #ebccd1;
        --error-text: #a94442;
        --loading-bg: #d9edf7;
        --loading-border: #bce8f1;
        --loading-text: #31708f;
        --progress-bg: #e9ecef;
        --progress-fill: #5cb85c;
        --input-bg: #fff;
}

/* ---------- Layout (from dashboard.css) ---------- */
body{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
  background:var(--background-light);
  color:var(--text-primary);
  padding:20px;
  line-height:1.6;
}

.container{padding:20px 20px}

/* ---------- Header (from dashboard.css) ---------- */
.header-controls{
  display:flex;justify-content:space-between;align-items:center;
  flex-wrap:nowrap;gap:15px;margin-bottom:25px
}
.header-left{display:flex;align-items:center;gap:12px}
.header-logo{width:32px;height:32px}
.header-brand{font-size:1.5rem;font-weight:700;color:#2c3e50}
.header-title{
  font-size:1.5rem;font-weight:400;color:var(--text-secondary);
  margin:0;padding-left:12px;border-left:1px solid var(--border-light)
}
.header-right{display:flex;align-items:center;gap:8px}

.icon-btn{
  background:transparent;border:none;border-radius:50%;width:40px;height:40px;
  display:flex;align-items:center;justify-content:center;padding:0;
  color:var(--text-secondary);
  transition:background-color .2s,color .2s;
  cursor:pointer;
  text-decoration: none;
}
.icon-btn:hover{background:#e9ecef;color:var(--text-primary)}
.icon-btn svg{width:22px;height:22px}

hr {
  border: none;
  height: 1px;
  background: rgba(0,0,0,0.08); /* very light line */
  margin: 12px 0 28px;
}


/* Form Styling */
#create-form {
    max-width: 800px;      /* NEW: cap width */
    width: 100%;           /* Allow shrink on small screens */
    margin: 20px auto;        /* 20px vertical, center horizontally */
    background-color: var(--background-card);
    padding: 30px 40px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label:not(.file-label):not(.radio-label) {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.95em;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 1rem;
    background-color: var(--input-bg);
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="url"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--border-focus-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}
    .form-group input[type="text"]::placeholder,
    .form-group input[type="url"]::placeholder,
    .form-group textarea::placeholder {
        color: #aaa;
        opacity: 1;
    }

.form-group textarea {
    min-height: 90px;
    resize: vertical;
}
#mindmap-text-input {
    min-height: 150px;
}

/* Creation Method Selection */
.creation-method-options {
    display: none;
}

.radio-group {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.radio-group input[type="radio"] {
    margin: 0;
    cursor: pointer;
    accent-color: var(--primary-color);
}
.radio-label {
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.95em;
}

/* Input sections */
.input-section {
    display: none;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #eee;
}
.input-section.active {
    display: block;
}

/* File Input Styling */
.file-input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.95em;
}
.file-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}
.file-input {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    z-index: -1;
}
.file-label {
    display: inline-block;
    padding: 8px 15px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    background-color: #f8f8f8;
    color: var(--text-secondary);
    transition: background-color 0.2s ease;
    white-space: nowrap;
}
.file-label:hover {
    background-color: #eee;
}
.file-name-display {
    font-style: italic;
    color: var(--text-light);
    font-size: 0.9em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Button Styling */
button {
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    color: white;
    display: inline-block;
}
button:hover {
    opacity: 0.9;
}
button:active {
    transform: scale(0.98);
}

button:disabled {
    background-color: #bdc3c7 !important;
    cursor: not-allowed;
    opacity: 0.7;
}

/* --- NEW Action Button Container --- */
.form-actions-container {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.form-actions-container button {
    width: auto; /* Override any full-width styles */
    margin-top: 0;
}

#cancel-btn {
    flex: 1;
    background-color: #6c757d;
}

#cancel-btn:hover {
    background-color: #5a6268;
}

#save-generate-btn {
    flex: 3;
}

/* --- END NEW --- */


#save-generate-btn.method-pdf { background-color: var(--primary-color); }
#save-generate-btn.method-pdf:hover { background-color: var(--primary-hover); }
#save-generate-btn.method-prompt { background-color: var(--tertiary-color); }
#save-generate-btn.method-prompt:hover { background-color: var(--tertiary-hover); }
#save-generate-btn.method-text { background-color: var(--tertiary-color); }
#save-generate-btn.method-text:hover { background-color: var(--tertiary-hover); }
#save-generate-btn.method-image { background-color: var(--image-color); }
#save-generate-btn.method-image:hover { background-color: var(--image-hover); }
#save-generate-btn.method-youtube { background-color: var(--youtube-color); }
#save-generate-btn.method-youtube:hover { background-color: var(--youtube-hover); }


/* Status & Progress */
.progress-container {
    margin-top: 15px;
}
.progress-bar-outer {
    background-color: var(--progress-bg);
    border-radius: 5px;
    overflow: hidden;
    height: 22px;
    width: 100%;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}
.progress-bar-inner {
    background-color: var(--progress-fill);
    height: 100%;
    width: 0%;
    color: white;
    text-align: center;
    line-height: 22px;
    font-size: 0.8rem;
    font-weight: bold;
    transition: width 0.4s ease;
    white-space: nowrap;
}

#status-message {
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: 5px;
    font-size: 0.95em;
    display: none;
    text-align: center;
}

.status-success {
    background-color: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success-text);
}
.status-error {
    background-color: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error-text);
}
.status-loading {
    background-color: var(--loading-bg);
    border: 1px solid var(--loading-border);
    color: var(--loading-text);
}

/* --- Responsive Header --- */
@media (max-width: 768px) {
  .header-brand {
    display: none;
  }
}
/* Add this to the end of public/recreate.css */

.original-file-info {
    background-color: #e9ecef;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: var(--text-secondary);
    border: 1px solid #dee2e6;
}

.original-file-info strong {
    color: var(--text-primary);
    font-weight: 600;
}
.original-source-link {
    text-decoration: underline;
    color: var(--accent-color, #0d9488);
    font-weight: 500;
}

.original-source-link:hover {
    text-decoration: none;
}

#original-pdf-info, #original-image-info {
    margin-top: 4px;
    font-size: 0.85rem;
    line-height: 1.3;
}

#original-pdf-info .error,
#original-image-info .error {
    color: #b91c1c;
    font-weight: 500;
}
