* {
    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;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.input-section {
    padding: 40px;
}

.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
}

input[type="text"], input[type="password"] {
    width: 100%;
    padding: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input[type="text"]:focus, input[type="password"]:focus {
    outline: none;
    border-color: #4f46e5;
}

small {
    display: block;
    margin-top: 5px;
    color: #6b7280;
    font-size: 14px;
}

#generateBtn, #loginBtn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

#generateBtn:hover, #loginBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

#generateBtn:disabled, #loginBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.loader {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hidden {
    display: none;
}

.mind-map-container {
    padding: 40px;
    border-top: 1px solid #e5e7eb;
}

.map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.map-header h2 {
    color: #374151;
    font-size: 1.8rem;
}

#downloadBtn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s;
}

#downloadBtn:hover {
    transform: translateY(-1px);
}

.mind-map {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 30px;
    min-height: 400px;
    position: relative;
}

.central-topic {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 25px;
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.3);
    z-index: 10;
}

.branch {
    position: absolute;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 15px;
    padding: 15px 20px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.branch:hover {
    transform: scale(1.05);
}

.branch.level-1 {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-size: 16px;
}

.branch.level-2 {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    font-size: 14px;
}

.branch.level-3 {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    font-size: 12px;
}

.connection-line {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, #6b7280 0%, transparent 100%);
    transform-origin: left center;
    z-index: 1;
}

.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 15px;
    margin: 20px 40px;
    border-radius: 8px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
}

.checkbox-container input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.2);
}

.checkbox-container .checkmark {
    user-select: none;
}

.info-icon {
    position: relative;
    display: inline-block;
    margin-left: 8px;
    cursor: pointer;
    font-size: 16px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.info-icon:hover {
    opacity: 1;
}

.info-icon:hover .tooltip {
    visibility: visible;
    opacity: 1;
    transition-delay: 0s;
}

.tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    z-index: 1000;
    left: 25px;
    top: -150px;
    width: 500px;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    transition: opacity 0.3s, visibility 0.3s;
    transition-delay: 0s, 0s;
}

.tooltip:hover {
    visibility: visible;
    opacity: 1;
    transition-delay: 1s;
}

.tooltip-header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 12px 15px;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    font-size: 14px;
}

.tooltip-content {
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.4;
    color: #374151;
    background: #f9fafb;
    border-radius: 0 0 8px 8px;
    white-space: pre-line;
    max-height: 300px;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .tooltip {
        width: 280px;
        left: -250px;
    }
}

@media (max-width: 768px) {
    .container {
        margin: 10px;
    }
    
    header {
        padding: 30px 20px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .input-section, .mind-map-container {
        padding: 20px;
    }
    
    .map-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
}