* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

/* Navigation */
.main-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.nav-tab {
    padding: 10px 30px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.nav-tab:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.nav-tab.active {
    background: white;
    color: #667eea;
    border-color: white;
}

.nav-tab:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Page Views */
.page-view {
    display: none;
}

.page-view.active {
    display: block;
}

.section {
    padding: 30px;
    border-bottom: 1px solid #eee;
}

.section:last-child {
    border-bottom: none;
}

/* Upload Area */
.upload-area {
    border: 3px dashed #667eea;
    border-radius: 8px;
    padding: 60px 20px;
    text-align: center;
    background: #f8f9ff;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #764ba2;
    background: #f0f2ff;
}

.upload-area.dragover {
    border-color: #764ba2;
    background: #e8ebff;
    transform: scale(1.02);
}

.upload-content svg {
    color: #667eea;
    margin-bottom: 20px;
}

.upload-content p {
    font-size: 1.1em;
    color: #666;
    margin: 10px 0;
}

.link-button {
    background: none;
    border: none;
    color: #667eea;
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
}

.link-button:hover {
    color: #764ba2;
}

.file-info {
    font-size: 0.9em;
    color: #999;
}

.file-info-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: #f0f2ff;
    border-radius: 8px;
    margin-top: 15px;
}

.file-info-display span {
    font-weight: 500;
    color: #667eea;
}

.remove-button {
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    transition: background 0.2s;
}

.remove-button:hover {
    background: #ff3838;
}

/* Input Mode Buttons */
.input-mode-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    justify-content: center;
}

.mode-btn {
    padding: 12px 30px;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
    color: #667eea;
    font-family: inherit;
}

.mode-btn:hover {
    background: #f0f2ff;
    border-color: #764ba2;
    color: #764ba2;
}

.mode-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.mode-btn.active:hover {
    background: #5568d3;
    border-color: #5568d3;
}

/* Text Input Container */
#text-container {
    margin-top: 20px;
}

#text-input {
    width: 100%;
    min-height: 300px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
    line-height: 1.6;
    transition: border-color 0.3s;
}

#text-input:focus {
    outline: none;
    border-color: #667eea;
}

#text-input::placeholder {
    color: #999;
}

.text-input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.char-counter {
    font-size: 0.9em;
    color: #666;
    font-weight: 500;
}

.char-counter.warning {
    color: #ff9500;
}

.char-counter.danger {
    color: #ff4757;
}

.text-actions {
    display: flex;
    gap: 10px;
}

/* Progress Section */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.progress-text {
    text-align: center;
    color: #666;
    font-size: 0.95em;
}

/* Error Message */
.error-message {
    background: #fff5f5;
    border-left: 4px solid #ff4757;
    padding: 15px;
    border-radius: 4px;
}

.error-message p {
    color: #ff4757;
    font-weight: 500;
}

/* Mind Map Section */
.mindmap-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.mindmap-header h2 {
    color: #333;
    font-size: 1.8em;
}

.mindmap-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #ff4757;
    color: white;
}

.btn-danger:hover {
    background: #ff3838;
}

.mindmap-container {
    width: 100%;
    height: 600px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    position: relative;
}

/* Edit Panel */
.edit-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    min-width: 300px;
    max-width: 500px;
}

.edit-panel h3 {
    margin-bottom: 20px;
    color: #333;
}

.edit-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1em;
    font-family: inherit;
    margin-bottom: 20px;
}

.edit-input:focus {
    outline: none;
    border-color: #667eea;
}

.edit-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.edit-actions .btn {
    flex: 1;
    min-width: 80px;
}

/* Overlay */
.edit-panel::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
    margin: -30px;
}

/* Progress Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlay-content {
    background: white;
    padding: 40px;
    border-radius: 8px;
    min-width: 300px;
    max-width: 500px;
    text-align: center;
}

.overlay-content .progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.overlay-content .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
    animation: pulse 2s infinite;
}

.overlay-content .progress-text {
    color: #333;
    font-size: 1em;
}

/* Error Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    min-width: 300px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.3em;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-body p {
    margin: 0;
    color: #333;
    line-height: 1.6;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }

    .mindmap-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .mindmap-container {
        height: 400px;
    }

    .edit-panel {
        width: 90%;
        max-width: none;
    }
}



