/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    color: #333;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

/* Home Page Styles */
.home-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-top: 50px;
}

.home-container h1 {
    font-size: 3em;
    margin-bottom: 10px;
    color: #4a5568;
}

.subtitle {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 40px;
}

.instructions {
    text-align: left;
    margin-bottom: 40px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.instructions h2 {
    color: #4a5568;
    margin-bottom: 15px;
}

.instructions ul {
    list-style-position: inside;
    line-height: 1.6;
}

.instructions li {
    margin-bottom: 8px;
}

.instructions code {
    background: #e2e8f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

.quick-start h3 {
    color: #4a5568;
    margin-bottom: 20px;
}

.board-examples {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.board-link {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 25px;
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: 500;
}

.board-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.create-board {
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
}

.url-input {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.url-prefix {
    color: #666;
    font-family: monospace;
}

#board-name {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 5px;
    font-size: 16px;
    min-width: 200px;
}

#board-name:focus {
    outline: none;
    border-color: #667eea;
}

/* Board Page Styles */
.settings-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
}

.settings-toggle {
    background: #666;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s;
}

.settings-toggle:hover {
    background: #555;
}

.settings-content {
    position: absolute;
    top: 50px;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 150px;
    display: none;
}

.settings-content.open {
    display: block;
}

.settings-content h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 14px;
}

.layout-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
}

.radio-option input {
    margin-right: 8px;
}

.board-container {
    position: relative;
    min-height: calc(100vh - 80px);
    padding: 20px;
}

.thought-board {
    position: relative;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    min-height: calc(100vh - 120px);
    overflow: auto;
}

/* Grid Layout Mode */
.thought-board.grid-layout {
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-content: flex-start;
}

/* Spiral Layout Mode */
.thought-board.spiral-layout {
    padding: 0;
    display: block;
    position: relative;
}

/* List Layout Mode */
.thought-board.list-layout {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
}

.bottom-controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

.thought-input-container {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    background: white;
    padding: 8px;
    border-radius: 25px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
}

#thought-input {
    border: none;
    outline: none;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 20px;
    min-width: 250px;
    background: transparent;
    resize: none;
    max-height: 150px;
    overflow-y: auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.4;
}

#thought-input::placeholder {
    color: #999;
}

.submit-btn {
    background: #666;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
    font-size: 14px;
    white-space: nowrap;
}

.submit-btn:hover {
    background: #555;
}

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Thought Styles */
.thought {
    background: #f8f8f8;
    padding: 15px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid #e0e0e0;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    box-sizing: border-box;
}

/* Grid layout thoughts */
.grid-layout .thought {
    width: 200px;
    position: relative;
}

/* Spiral layout thoughts */
.spiral-layout .thought {
    position: absolute;
    width: auto;
    min-width: 60px;
    max-width: 180px;
    padding: 8px 12px;
    transform-origin: center;
    text-align: center;
    /* white-space: nowrap; */
    overflow: hidden;
}

/* List layout thoughts */
.list-layout .thought {
    width: 100%;
    max-width: 600px;
    position: relative;
    padding: 15px 20px;
}

.thought:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.thought-content {
    color: #333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .settings-panel {
        top: 10px;
        right: 10px;
    }
    
    .settings-content {
        right: -100px; /* Offset to prevent going off screen */
    }
    
    .board-container {
        padding: 10px;
        min-height: calc(100vh - 100px);
    }
    
    .thought-board.grid-layout {
        padding: 10px;
        gap: 10px;
    }
    
    .bottom-controls {
        bottom: 10px;
    }
    
    .thought-input-container {
        flex-direction: row;
        width: calc(100vw - 40px);
        max-width: 400px;
    }
    
    #thought-input {
        min-width: 200px;
        flex: 1;
    }
    
    .grid-layout .thought {
        width: calc(50% - 5px);
        font-size: 13px;
    }
    
    .spiral-layout .thought {
        min-width: 50px;
        max-width: 140px;
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .url-input {
        flex-direction: column;
        gap: 10px;
    }
    
    #board-name {
        width: 100%;
    }
    
    .board-examples {
        flex-direction: column;
        align-items: center;
    }
}

/* Animation for new thoughts */
@keyframes thoughtAppear {
    from {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.thought.new {
    animation: thoughtAppear 0.5s ease-out;
}
