/* ===== GLOBAL STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}
/* ===== HEADER ===== */
header{
  text-align: center;
  color: white;
  margin-bottom: 40px;
  animation: slideDown 0.5s ease;
}
header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}
header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* ===== MAIN CONTAINER ===== */
main {
  max-width: 700px;
  margin: 0 auto;
  background: white;
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* ===== BOARD SECTION ===== */
.board-section h2 {
  font-size: 1.4rem;
  margin-bottom: 15px;
  color: #333;
}
.board {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    min-height: 80px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 30px;
}
.board.active {
    background: #f0f4ff;
    box-shadow: inset 0 0 10px rgba(102, 126, 234, 0.1);
}
.empty-state {
    width: 100%;
    text-align: center;
    color: #999;
    padding: 20px;
    font-style: italic;
}

/* ===== CARD STYLES ===== */
.card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 300px;
  word-break: break-word;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  animation: cardPop 0.3s ease;
}
.card-text {
    flex: 1;
}
.card-delete {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.9rem;
    transition: background 0.2s;
    flex-shrink: 0;
}
.card-delete:hover {
    background: rgba(255, 255, 255, 0.4);
}
.card-index {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-right: 4px;
}

/* ===== FORM SECTION ===== */
.form-section {
  margin-bottom: 30px;
}
#addForm {
    display: flex;
    gap: 10px;
}
#cardInput {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}
#cardInput:focus {
    outline: none;
    border-color: #667eea;
}

#addForm button {
    padding: 12px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
#addForm button:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}
#addForm button:active {
    transform: translateY(0);
}
/* ===== WebMCP VISUAL FEEDBACK ===== */
/* When an agent is actively filling the form */
#addForm:has(input:focus) {
  outline: 2px solid #667eea;
  outline-offset: 4px;
  border-radius: 8px;
  padding: 4px;
}
/* Browser-specific pseudo-classes for agent interaction (when supported) */
#addForm:tool-form-active {
  outline: 3px solid #ffc107;
  outline-offset: 6px;
  border-radius: 8px;
  padding: 4px;
}
#addForm button:tool-submit-active {
    background: #ffc107;
    color: #333;
    box-shadow: 0 0 20px rgba(255, 193, 7, 0.5);
}

/* ===== STATUS SECTION ===== */
.status-section {
  text-align: center;
  margin: 20px 0;
}
.status-text {
    font-size: 0.9rem;
    color: #666;
    padding: 8px 12px;
    background: #f0f0f0;
    border-radius: 6px;
    display: inline-block;
}
.status-text.active {
    background: #d4edda;
    color: #155724;
}
.status-text.error {
    background: #f8d7da;
    color: #721c24;
}

/* ===== INFO SECTION ===== */
.info-section {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
}
details {
    cursor: pointer;
}
details summary {
    font-weight: 600;
    color: #667eea;
    user-select: none;
    margin-bottom: 10px;
}
details p {
    color: #555;
    margin: 10px 0;
    padding-left: 20px;
    font-size: 0.9rem;
}
details code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

/* ===== ANIMATIONS ===== */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        }
}
@keyframes cardPop {
    from {
        opacity: 0;
        transform: scale(0.8);
        }
        to {
            opacity: 1;
            transform: scale(1);
            }
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 600px) {
  header h1 {
      font-size: 2rem;
}
main {
    padding: 20px;
}
#addForm {
    flex-direction: column;
}
#addForm button {
    width: 100%;
}
.card {
    max-width: 100%;
    }
}