/* Reset and base styles */
* {
    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%);
    overflow: hidden;
}

/* Main container with responsive height */
.container {
    width: 100%;
    height: 450px; /* Default iframe height */
    position: relative;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

/* Responsive height for full browser */
@media (min-height: 600px) {
    body:not(.iframe-mode) .container {
        height: 90vh;
    }
}

/* Removed tooltip styles - no longer needed */

/* Control panel styling */
.control-panel {
    background: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-bottom: 2px solid #e0e0e0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.input-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    font-size: 12px;
}

.input-group textarea {
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 6px;
    resize: none;
    height: 60px;
    font-size: 11px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Button styling */
.button-group {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.action-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    min-height: 40px;
    white-space: nowrap;
}

.action-btn.primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.action-btn.secondary {
    background: #f5f5f5;
    color: #666;
    border: 2px solid #ddd;
}

.action-btn.secondary:hover {
    background: #e0e0e0;
    border-color: #ccc;
}

/* Mapping area */
.mapping-area {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at center, #f8f9ff 0%, #e8f0ff 100%);
}

#connectionCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.concept-nodes {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 2;
}

/* Concept node styling */
.concept-node {
    position: absolute;
    background: white;
    border-radius: 15px;
    padding: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid;
    min-width: 120px;
    max-width: 180px;
    font-size: 11px;
    text-align: center;
    user-select: none;
}

.concept-node:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.concept-node.selected {
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.3);
}

/* Color coding for different categories */
.concept-node.qualities {
    border-color: #ff6b6b;
    background: linear-gradient(135deg, #ff6b6b, #ffa8a8);
    color: white;
}

.concept-node.aspirations {
    border-color: #4ecdc4;
    background: linear-gradient(135deg, #4ecdc4, #7fdbda);
    color: white;
}

.concept-node.community {
    border-color: #45b7d1;
    background: linear-gradient(135deg, #45b7d1, #74c7e3);
    color: white;
}

.concept-node.work {
    border-color: #96ceb4;
    background: linear-gradient(135deg, #96ceb4, #b8dcc6);
    color: white;
}

/* Action suggestions (thought bubbles) */
.action-suggestions {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 200px;
    z-index: 3;
}

.thought-bubble {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    font-size: 11px;
    line-height: 1.4;
    border: 2px solid #f0f0f0;
}

.thought-bubble::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 20px;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 15px solid rgba(255, 255, 255, 0.95);
}

.thought-bubble h4 {
    color: #667eea;
    margin-bottom: 8px;
    font-size: 12px;
}

/* Map controls */
.map-controls {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    gap: 8px;
    z-index: 4;
}

.control-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Connection indicator */
.connection-indicator {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 11px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 4;
}

.connection-indicator.show {
    opacity: 1;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .input-section {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .input-group textarea {
        height: 50px;
        font-size: 12px;
    }
    
    .action-suggestions {
        width: 150px;
        right: 10px;
        top: 10px;
    }
    
    .thought-bubble {
        padding: 10px;
        font-size: 10px;
    }
    
    .concept-node {
        min-width: 100px;
        max-width: 140px;
        padding: 10px;
        font-size: 10px;
    }
    
    .control-btn {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
}

/* Touch support */
@media (pointer: coarse) {
    .concept-node {
        min-height: 44px;
        min-width: 44px;
    }
    
    .control-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    .action-btn {
        min-height: 44px;
        padding: 12px 24px;
    }
}