/**
 * Tags input and display styles
 */

/* Tags Input Container */
.tags-input-container {
    position: relative;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px;
    background: #ffffff;
    min-height: 50px;
    cursor: text;
    transition: border-color 0.2s ease;
}

.tags-input-container:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Tags Display */
.tags-display {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

/* Individual Tag */
.tag-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background-color: #3b82f6;
    color: #ffffff;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    transition: all 0.2s ease;
}

.tag-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Tag Remove Button */
.tag-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tag-remove:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

/* New Tag Input */
.tag-new-input {
    flex: 1;
    min-width: 120px;
    border: none;
    outline: none;
    padding: 4px 0;
    font-size: 14px;
    background: transparent;
}

.tag-new-input::placeholder {
    color: #9ca3af;
}

/* Autocomplete List */
.tags-autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    padding: 0;
    list-style: none;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
}

.autocomplete-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.autocomplete-item:hover {
    background-color: #f3f4f6;
}

.autocomplete-item.create-new {
    color: #3b82f6;
    font-weight: 500;
    border-top: 1px solid #e5e7eb;
}

.autocomplete-item.create-new:hover {
    background-color: #eff6ff;
}

/* Tag Color Indicator */
.tag-color-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* Tag Icon (for create new) */
.tag-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #3b82f6;
    color: #ffffff;
    border-radius: 50%;
    font-size: 16px;
    font-weight: bold;
}

/* Tag Name */
.tag-name {
    flex: 1;
}

/* Tags Display on Detail Pages */
.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.tag-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background-color: #3b82f6;
    color: #ffffff;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.tag-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    color: #ffffff;
}

/* Responsive */
@media (max-width: 768px) {
    .tags-input-container {
        padding: 6px;
        min-height: 44px;
    }

    .tag-item {
        font-size: 13px;
        padding: 3px 8px;
    }

    .tag-new-input {
        font-size: 13px;
    }

    .autocomplete-item {
        padding: 8px 10px;
    }
}

/* Form Help Text for Tags */
.tags-help-text {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #6b7280;
}

/* Empty State */
.tags-empty {
    color: #9ca3af;
    font-size: 14px;
    font-style: italic;
}
